aboutsummaryrefslogtreecommitdiff
path: root/src/survive_internal.h
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2016-11-30 22:05:43 -0500
committercnlohr <lohr85@gmail.com>2016-11-30 22:05:43 -0500
commit8b77db6280c6d832eb89455e1b30877454a9a5a1 (patch)
treea192a404d5596caf04915170c33cc6e598a55b65 /src/survive_internal.h
parentc1542a78999791d9fefc6e0d2805494eb1d1bd44 (diff)
downloadlibsurvive-8b77db6280c6d832eb89455e1b30877454a9a5a1.tar.gz
libsurvive-8b77db6280c6d832eb89455e1b30877454a9a5a1.tar.bz2
Starting to get data.
Diffstat (limited to 'src/survive_internal.h')
-rw-r--r--src/survive_internal.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/survive_internal.h b/src/survive_internal.h
index 70249e3..394842b 100644
--- a/src/survive_internal.h
+++ b/src/survive_internal.h
@@ -6,7 +6,7 @@
#include <stdint.h>
#include <libusb-1.0/libusb.h>
-#define SV_INFO( x... ) printf( x )
+#define SV_INFO( x... ) { char stbuff[1024]; sprintf( stbuff, x ); ctx->notefunction( ctx, stbuff ); }
#define SV_ERROR( x... ) { char stbuff[1024]; sprintf( stbuff, x ); ctx->faultfunction( ctx, stbuff ); }
//XXX TODO This one needs to be rewritten.
@@ -26,7 +26,8 @@
#define USB_IF_LIGHTCAP 4
#define MAX_INTERFACES 5
-#define INTBUFFSIZE 64
+#define INTBUFFSIZE 64
+#define SENSORS_PER_OBJECT 32
struct SurviveContext;
struct SurviveUSBInterface;
@@ -44,18 +45,27 @@ struct SurviveUSBInterface
const char * hname; //human-readable names
};
+struct SurvivePhoto
+{
+ uint32_t last;
+ uint32_t lastcode;
+ uint32_t lastlength;
+};
+
struct SurviveContext
{
//USB Subsystem
struct libusb_context* usbctx;
void(*faultfunction)( struct SurviveContext * ctx, const char * fault );
+ void(*notefunction)( struct SurviveContext * ctx, const char * fault );
struct libusb_device_handle * udev[MAX_USB_DEVS];
struct SurviveUSBInterface uiface[MAX_INTERFACES];
+
+// struct SurvivePhoto
};
//USB Subsystem
-
void survive_usb_close( struct SurviveContext * t );
int survive_usb_init( struct SurviveContext * t );
int survive_usb_poll( struct SurviveContext * ctx );