#include <time.h>
#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);
int mw_set_rtc(mwdevice_t *mwdevice, unsigned char clk1224, unsigned char date_fmt);
+int mw_nval_operation(mwdevice_t *mwdevice, unsigned char operation, unsigned short identifier, unsigned char size, void *mdata);
+
int mw_set_vibrate_mode(mwdevice_t *mwdevice, unsigned char enable, unsigned short on_time, unsigned short off_time, unsigned char cycles);
int mw_configure_watch_mode(mwdevice_t *mwdevice, unsigned char mode, unsigned char save, unsigned char timeout, unsigned char invert);
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);