Classes | Macros | Typedefs | Enumerations | Functions
wechat.h File Reference

WeChat Service API. More...

`#include "gr55xx_sys.h"`
`#include "custom_config.h"`
`#include <stdint.h>`
`#include <stdbool.h>`

Go to the source code of this file.

## Classes
struct | wechat_pedo_meas_t
| WeChat current pedometer measurement variable. More...
struct | wechat_pedo_target_t
| WeChat pedometer target variable. More...
struct | wechat_data_t
| WeChat service data. More...
struct | wechat_evt_t
| WeChat Service event. More...
struct | wechat_init_t
| WeChat Service Init variable. More...

## Macros
#define | WECHAT_CONNECTION_MAX
| Maximum number of WeChat connections. More...
#define | WECHAT_DATA_LEN 20
| Maximum length of WeChat Data. More...
#define | WECHAT_PEDO_TARGET_VAL_LEN 0x04
| Maximum length of WeChat pedometer target value. More...
#define | WECHAT_PEDO_STEP_COUNT_MAX 0xFFFFFF
| Maximum value of WeChat pedometer step count. More...
#define | WECHAT_SERVICE_UUID 0XFEE7
| WeChat Service UUID. More...
#define | WECHAT_WRITE_CHAR_UUID 0XFEC7
| WeChat Airsync Write Characteristic UUID. More...
#define | WECHAT_INDICATE_CHAR_UUID 0XFEC8
| WeChat Airsync Indication Characteristic UUID. More...
#define | WECHAT_READ_CHAR_UUID 0XFEC9
| WeChat Airsync Read Characteristic UUID. More...
#define | WECHAT_PEDOMETER_MEASUREMENT 0XFEA1
| WeChat Current Pedometer Measurement Characteristic UUID. More...
#define | WECHAT_TARGET 0XFEA2
| WeChat Pedometer Target Characteristic UUID. More...
#define | WECHAT_PEDO_FLAG_STEP_COUNT_BIT 0X01
| WeChat pedometer measurement step count flag bit. More...
#define | WECHAT_PEDO_FLAG_STEP_DISTENCE_BIT 0X02
| WeChat pedometer measurement step distance flag bit. More...
#define | WECHAT_PEDO_FLAG_STEP_CALORIE_BIT 0X04
| WeChat pedometer measurement step calorie flag bit. More...
#define | WECHAT_PEDO_FLAG_ALL_SUP_BIT 0X07
| WeChat pedometer measurement all flag bit. More...

## Typedefs
typedef void(* | wechat_evt_handler_t) (wechat_evt_t *p_evt)
| WeChat Service event handler type. More...

## Enumerations
enum | wechat_evt_type_t { WECHAT_EVT_INVALID, WECHAT_EVT_AIRSYNC_IND_ENABLE, WECHAT_EVT_AIRSYNC_IND_DISABLE, WECHAT_EVT_PEDO_MEAS_NTF_ENABLE, WECHAT_EVT_PEDO_MEAS_NTF_DISABLE, WECHAT_EVT_PEDO_TARGET_IND_ENABLE, WECHAT_EVT_PEDO_TARGET_IND_DISABLE, WECHAT_EVT_PEDO_TARGET_UPDATE, WECHAT_EVT_AIRSYNC_DATA_RECIEVE }
| WeChat Service event type. More...

## Functions
sdk_err_t | wechat_service_init (wechat_init_t *p_wechat_init)
| Initialize a WeChat Service instance and add in the DB. More...
sdk_err_t | wechat_airsync_data_indicate (uint8_t conn_idx, uint8_t *p_data, uint16_t length)
| WeChat Service Airsync indicate data. More...
sdk_err_t | wechat_pedo_measurement_send (uint8_t conn_idx, wechat_pedo_meas_t *p_pedo_meas)
| Send WeChat pedometer measurement information. More...
sdk_err_t | wechat_pedo_target_send (uint8_t conn_idx)
| Send WeChat pedometer target value. More...

## Detailed Description

WeChat Service API.

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file wechat.h.