X-Git-Url: https://git.kernelconcepts.de/?p=metawatch.git;a=blobdiff_plain;f=metawatch.h;h=4fbbc9bbe25b7e3de13f447870aff0e4b8391a20;hp=5df07a07493d70242c29e29467eece3e5e52204e;hb=7d8f5f3b7240d9d6418fd92f851ce903aaa49bf0;hpb=44f70f5275339fba3609ec94fe797c907290549b diff --git a/metawatch.h b/metawatch.h index 5df07a0..4fbbc9b 100644 --- a/metawatch.h +++ b/metawatch.h @@ -10,8 +10,12 @@ #include #include "metawatch_protocol.h" +#define MW_PBUF_LEN 512 + typedef struct _mwdevice_t { int mw_fd; /* file decriptor for MW connection */ + char pbuf[MW_PBUF_LEN]; /* protocol receive buffer */ + int pbuf_len; unsigned char devtype; /* the device type of the connected device */ /* watch message callbacks */ void (*mw_get_device_type_response_cb) (struct _mwdevice_t *mwdevice, unsigned char devtype, void *user_data); @@ -79,7 +83,9 @@ int mw_disable_button(mwdevice_t *mwdevice, unsigned char mode, unsigned char bu int mw_advance_watch_hands(mwdevice_t *mwdevice, unsigned char hours, unsigned char minutes, unsigned char seconds); -int decode_frame(mwdevice_t *mwdevice, unsigned char *buf, int len); +int mw_decode_frame(mwdevice_t *mwdevice, unsigned char *buf, int len); + +int mw_feed_msg_buffer(mwdevice_t *mwdevice, unsigned char *buf, int len); int mw_init(mwdevice_t *mwdevice, int mw_fd);