Add button message callback handling and sample code
This commit is contained in:
parent
b11171caa5
commit
681932903c
4 changed files with 53 additions and 3 deletions
|
@ -17,6 +17,7 @@ typedef struct _mwdevice_t {
|
|||
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;
|
||||
|
@ -26,6 +27,8 @@ typedef struct _mwdevice_t {
|
|||
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);
|
||||
|
@ -73,6 +76,9 @@ void mw_set_get_battery_voltage_response_cb(mwdevice_t *mwdevice, void (*mw_get_
|
|||
|
||||
int mw_read_button_config_response(mwdevice_t *mwdevice, unsigned char *btnrsp, int len);
|
||||
|
||||
int mw_button_event_message(mwdevice_t *mwdevice, unsigned char *btnevt, int len, unsigned char opts);
|
||||
void mw_set_button_event_message_cb(mwdevice_t *mwdevice, void (*mw_button_event_message_cb) (mwdevice_t *mwdevice, unsigned char buttons, unsigned char options, void *user_data), void *user_data);
|
||||
|
||||
int mw_read_light_sensor_response(mwdevice_t *mwdevice, unsigned char *lightrsp, int len);
|
||||
void mw_set_read_light_sensor_response_cb(mwdevice_t *mwdevice, void (*mw_read_light_sensor_response_cb) (mwdevice_t *mwdevice, unsigned short *light_level, void *user_data), void *user_data);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue