+#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 */
+ unsigned char screen_mode; /* the current assumed screen mode */
+ /* watch message callbacks */
+ void (*mw_get_device_type_response_cb) (struct _mwdevice_t *mwdevice, unsigned char devtype, void *user_data);
+ void *mw_gdtypersp_data;
+ void (*mw_get_real_time_clock_response_cb) (struct _mwdevice_t *mwdevice, struct tm *mw_tm, void *user_data);
+ void *mw_grtcrsp_data;
+ void (*mw_get_battery_voltage_response_cb) (struct _mwdevice_t *mwdevice, unsigned short *voltage, unsigned char *pgood, unsigned char *charging, void *user_data);
+ void *mw_gbatvrsp_data;
+ void (*mw_read_button_config_response_cb) (struct _mwdevice_t *mwdevice, void *user_data);
+ void *mw_rbtncnfrsp_data;
+ void (*mw_button_event_message_cb) (struct _mwdevice_t *mwdevice, unsigned char buttons, unsigned char options, void *user_data);
+ void *mw_btnevmsg_data;
+ void (*mw_read_light_sensor_response_cb) (struct _mwdevice_t *mwdevice, unsigned short *light_level, void *user_data);
+ void *mw_rlsrsp_data;
+ void (*mw_status_change_event_cb) (struct _mwdevice_t *mwdevice, unsigned char *scrmode, unsigned char *status, void *user_data);
+ void *mw_stchev_data;
+} mwdevice_t;
+