#ifndef SHEARWATER_COMMON_H
#define SHEARWATER_COMMON_H
#include <libdivecomputer/iostream.h>
#include "device-private.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ID_SERIAL 0x8010
#define ID_FIRMWARE 0x8011
#define ID_LOGUPLOAD 0x8021
#define ID_HARDWARE 0x8050
#define PREDATOR 2
#define PETREL 3
#define PETREL2 PETREL
#define NERD 4
#define PERDIX 5
#define PERDIXAI 6
#define NERD2 7
#define TERIC 8
#define PEREGRINE 9
#define PETREL3 10
#define PERDIX2 11
#define NSTEPS 10000
#define STEP(i,n) ((NSTEPS * (i) + (n) / 2) / (n))
typedef struct shearwater_common_device_t {
dc_device_t base;
dc_iostream_t *iostream;
} shearwater_common_device_t;
dc_status_t
shearwater_common_setup (shearwater_common_device_t *device, dc_context_t *context, dc_iostream_t *iostream);
dc_status_t
shearwater_common_transfer (shearwater_common_device_t *device, const unsigned char input[], unsigned int isize, unsigned char output[], unsigned int osize, unsigned int *actual);
dc_status_t
shearwater_common_download (shearwater_common_device_t *device, dc_buffer_t *buffer, unsigned int address, unsigned int size, unsigned int compression, dc_event_progress_t *progress);
dc_status_t
shearwater_common_identifier (shearwater_common_device_t *device, dc_buffer_t *buffer, unsigned int id);
#ifdef __cplusplus
}
#endif
#endif