XFusion API v1.3.0
|
#include "xf_hal.h"
#include "xf_sle_connection_manager.h"
#include "xf_sle_device_discovery.h"
#include "xf_sle_ssap_server.h"
#include "string.h"
宏定义 | |
#define | TAG "sample_ssaps" |
#define | SAMPLE_ADV_ID 1 |
#define | SAMPLE_ADV_HANDLE 1 |
#define | SAMPLE_SLE_CONN_INTV_MIN 0x64 |
#define | SAMPLE_SLE_CONN_INTV_MAX 0x64 |
#define | SAMPLE_SLE_ADV_INTERVAL_MIN 0xC8 |
#define | SAMPLE_SLE_ADV_INTERVAL_MAX 0xC8 |
#define | SAMPLE_SLE_CONN_SUPERVISION_TIMEOUT 0x1F4 |
#define | SAMPLE_SLE_CONN_MAX_LATENCY 0 |
#define | SAMPLE_SLE_ADV_TX_POWER 10 |
函数 | |
static xf_err_t | sample_ssaps_event_cb (xf_sle_ssaps_event_t event, xf_sle_ssaps_evt_cb_param_t *param) |
static void | sample_sle_set_adv_data (void) |
static void | sample_sle_set_adv_param (void) |
void | xf_main (void) |
全局函数定义: [Global Functions]. | |
变量 | |
static uint8_t | s_local_name [] = "XF_SSAPS" |
static xf_sle_uuid_info_t | s_app_uuid = {0} |
static uint8_t | s_aap_id = 0 |
static uint8_t | s_prop_value [8] = {0xCC} |
static uint8_t | s_ntf_value [] = {0x01, 0x0} |
static uint8_t | s_rsp_value [] = "I M SSAPS RSP" |
static uint8_t | s_sle_mac_addr [XF_SLE_ADDR_LEN] = {0x33, 0x22, 0x22, 0x66, 0x11, 0x22} |
static bool | is_connected = false |
static xf_sle_ssaps_service_t | service_struct |
#define SAMPLE_ADV_ID 1 |
#define SAMPLE_ADV_HANDLE 1 |
#define SAMPLE_SLE_CONN_INTV_MIN 0x64 |
#define SAMPLE_SLE_CONN_INTV_MAX 0x64 |
#define SAMPLE_SLE_ADV_INTERVAL_MIN 0xC8 |
#define SAMPLE_SLE_ADV_INTERVAL_MAX 0xC8 |
#define SAMPLE_SLE_CONN_SUPERVISION_TIMEOUT 0x1F4 |
#define SAMPLE_SLE_CONN_MAX_LATENCY 0 |
|
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" 的打印
< 打开过滤器
< 设置过滤器为黑名单
< 不用彩色打印
< 启用彩色打印
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |