XFusion API v1.3.0
|
宏定义 | |
#define | TAG "sample_gatts" |
#define | DEFAULT_BLE_GAP_ADV_MIN_INTERVAL 0x30 |
#define | DEFAULT_BLE_GAP_ADV_MAX_INTERVAL 0x60 |
#define | DEFAULT_BLE_GAP_ADV_HANDLE_DEFAULT 0x01 |
#define | DEFAULT_BLE_GAP_ADV_FOREVER_DURATION 0 |
#define | DEFAULT_SERVER_HANDLE (1) |
#define | DEFAULT_SERVER_ID (1) |
#define | DEFAULT_SERVICE_UUID (0x1234) |
#define | DEFAULT_CHARA_UUID (0xCDEF) |
#define | DEFAULT_CHARA_CFG_UUID (0x2902) |
函数 | |
static void | sample_ble_set_adv_data (void) |
static void | sample_ble_set_adv_param (void) |
static xf_err_t | sample_ble_gatts_event_cb (xf_ble_gatts_event_t event, xf_ble_gatts_evt_cb_param_t param) |
void | xf_main (void) |
全局函数定义: [Global Functions]. | |
变量 | |
uint8_t | sample_gatts_device_name [] = "XF_GATTS" |
uint8_t | sample_adv_data [] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66} |
uint8_t | sample_adv_rsp_data [] = {0x11, 0x00, 0x00, 0x00, 0x00, 0x66} |
static uint8_t | read_req_indication [] = "REQ_READ RSP" |
static uint8_t | write_req_indication [] = "REQ_WRITE RSP" |
static uint8_t | chara_value_array [][10] |
static xf_ble_gatts_service_t | service_set [] |
static xf_ble_uuid_info_t | app_uuid |
static uint8_t | app_id = 0 |
#define DEFAULT_BLE_GAP_ADV_MIN_INTERVAL 0x30 |
#define DEFAULT_BLE_GAP_ADV_MAX_INTERVAL 0x60 |
#define DEFAULT_BLE_GAP_ADV_FOREVER_DURATION 0 |
#define DEFAULT_SERVICE_UUID (0x1234) |
#define DEFAULT_CHARA_UUID (0xCDEF) |
|
static |
|
static |
|
static |
void xf_main | ( | void | ) |
全局函数定义: [Global Functions].
主函数。 正常情况下此行空白:函数之间需要有一个空行作为分隔
< 用于接收 _xf_template_func 的传出
< 防止警告
分支语句哪怕只有一句也必须加花括号。
判断语句中,如果一行不足以放下判断语句, 分行时需要将逻辑符号放在新行的开头。 此时最好还是用变量表达判断语句。
常量在前可以避免不必要的逻辑错误。 如 if (XF_TEMPL_FAIL = ret) 时编译会报错。
对于返回值为 void 的函数, return;
可有可无,文件风格统一即可。
注意! xf_init() 会在 xf_main() 前运行,此处不需要重复调用 xf_init()!
此示例仅用于演示自动初始化的使用方法。
< 所有等级打印都带有全部信息
< 过滤文件名为 "file1.c" 的打印
< 打开过滤器
< 设置过滤器为黑名单
< 不用彩色打印
< 启用彩色打印
uint8_t sample_gatts_device_name[] = "XF_GATTS" |
uint8_t sample_adv_data[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66} |
uint8_t sample_adv_rsp_data[] = {0x11, 0x00, 0x00, 0x00, 0x00, 0x66} |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |