Go to the documentation of this file.
67 #include "custom_config.h"
75 #define WECHAT_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
76 10 : CFG_MAX_CONNECTIONS)
77 #define WECHAT_DATA_LEN 20
78 #define WECHAT_PEDO_TARGET_VAL_LEN 0x04
79 #define WECHAT_PEDO_STEP_COUNT_MAX 0xFFFFFF
86 #define WECHAT_SERVICE_UUID 0XFEE7
87 #define WECHAT_WRITE_CHAR_UUID 0XFEC7
88 #define WECHAT_INDICATE_CHAR_UUID 0XFEC8
89 #define WECHAT_READ_CHAR_UUID 0XFEC9
90 #define WECHAT_PEDOMETER_MEASUREMENT 0XFEA1
91 #define WECHAT_TARGET 0XFEA2
99 #define WECHAT_PEDO_FLAG_STEP_COUNT_BIT 0X01
100 #define WECHAT_PEDO_FLAG_STEP_DISTENCE_BIT 0X02
101 #define WECHAT_PEDO_FLAG_STEP_CALORIE_BIT 0X04
102 #define WECHAT_PEDO_FLAG_ALL_SUP_BIT 0X07
133 uint8_t step_count[3];
134 uint8_t step_dist[3];
135 uint8_t step_calorie[3];
142 uint8_t step_count[3];
@ WECHAT_EVT_INVALID
WeChat invalid event.
void(* wechat_evt_handler_t)(wechat_evt_t *p_evt)
WeChat Service event handler type.
sdk_err_t wechat_pedo_measurement_send(uint8_t conn_idx, wechat_pedo_meas_t *p_pedo_meas)
Send WeChat pedometer measurement information.
@ WECHAT_EVT_PEDO_MEAS_NTF_ENABLE
WeChat Pedometer measurement notification has been enabled.
uint8_t * p_dev_mac
Pointer to WeChat device MAC address.
sdk_err_t wechat_pedo_target_send(uint8_t conn_idx)
Send WeChat pedometer target value.
uint32_t step_count_target
WeChat pedometer step count target value.
@ WECHAT_EVT_PEDO_MEAS_NTF_DISABLE
WeChat Pedometer measurement notification has been disabled.
wechat_pedo_target_t pedo_target
Pedometer target set value.
wechat_data_t data
Data of Airsync.
@ WECHAT_EVT_AIRSYNC_IND_DISABLE
WeChat Airsync indication has been disabled.
const uint8_t * p_data
Pointer to data.
uint16_t length
Length of data.
@ WECHAT_EVT_PEDO_TARGET_IND_ENABLE
WeChat Pedometer target indicaiton has been enabled.
WeChat pedometer target variable.
wechat_evt_type_t
WeChat Service event type.
WeChat Service Init variable.
@ WECHAT_EVT_PEDO_TARGET_IND_DISABLE
WeChat Pedometer target indicaiton has been disabled.
uint8_t flag
Flag for WeChat current pedometer measurement.
uint16_t sdk_err_t
SDK API result type.
@ WECHAT_EVT_AIRSYNC_IND_ENABLE
WeChat Airsync indication has been enabled.
sdk_err_t wechat_service_init(wechat_init_t *p_wechat_init)
Initialize a WeChat Service instance and add in the DB.
sdk_err_t wechat_airsync_data_indicate(uint8_t conn_idx, uint8_t *p_data, uint16_t length)
WeChat Service Airsync indicate data.
wechat_evt_type_t evt_type
Event type.
uint8_t flag
Flag for WeChat pedometer target.
WeChat current pedometer measurement variable.
wechat_evt_handler_t evt_handler
WeChat Service event handler.
@ WECHAT_EVT_AIRSYNC_DATA_RECIEVE
Recieved Airsync data.
uint8_t conn_idx
The index of connection.
@ WECHAT_EVT_PEDO_TARGET_UPDATE
WeChat Pedometer target has been updated.
uint16_t offset
Offset of data.