suunto_common.h (1776B)
1 /* 2 * libdivecomputer 3 * 4 * Copyright (C) 2008 Jef Driesen 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 * MA 02110-1301 USA 20 */ 21 22 #ifndef SUUNTO_COMMON_H 23 #define SUUNTO_COMMON_H 24 25 #include "device-private.h" 26 27 #ifdef __cplusplus 28 extern "C" { 29 #endif /* __cplusplus */ 30 31 typedef struct suunto_common_device_t { 32 dc_device_t base; 33 unsigned char fingerprint[5]; 34 } suunto_common_device_t; 35 36 typedef struct suunto_common_layout_t { 37 // End-of-profile marker 38 unsigned int eop; 39 // Profile ringbuffer 40 unsigned int rb_profile_begin; 41 unsigned int rb_profile_end; 42 // Fingerprint 43 unsigned int fp_offset; 44 // Peek 45 unsigned int peek; 46 } suunto_common_layout_t; 47 48 void 49 suunto_common_device_init (suunto_common_device_t *device); 50 51 dc_status_t 52 suunto_common_device_set_fingerprint (dc_device_t *device, const unsigned char data[], unsigned int size); 53 54 dc_status_t 55 suunto_common_extract_dives (suunto_common_device_t *device, const suunto_common_layout_t *layout, const unsigned char data[], dc_dive_callback_t callback, void *userdata); 56 57 #ifdef __cplusplus 58 } 59 #endif /* __cplusplus */ 60 #endif /* SUUNTO_COMMON_H */