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_client.h"
#include "string.h"
#include "xf_task.h"
宏定义 | |
#define | TAG "sample_ssapc" |
#define | SAMPLE_SLE_SEEK_INTERVAL 100 |
#define | SAMPLE_SLE_SEEK_WINDOW 100 |
#define | TASK_PRIORITY 5 |
#define | TASK_DELAY_MS 500 |
函数 | |
static void | sle_client_task (xf_task_t task) |
static xf_err_t | sample_ssapc_event_cb (xf_sle_ssapc_event_t event, xf_sle_ssapc_evt_cb_param_t *param) |
static void | sample_sle_set_seek_param (void) |
static xf_err_t | ssapc_event_seek_result_cb (xf_sle_evt_param_seek_result_t *result) |
void | xf_main (void) |
全局函数定义: [Global Functions]. | |
变量 | |
static uint8_t | target_device_name [] = "XF_SSAPS" |
static xf_sle_uuid_info_t | s_app_uuid = {0} |
static uint8_t | s_app_id = 0 |
static uint8_t | s_conn_id = 0 |
static xf_sle_ssapc_find_struct_param_t | service_struct |
static xf_sle_ssapc_find_struct_param_t | prop_struct |
static bool | is_need_discovery = false |
static bool | is_discovery_cmpl = false |
static bool | is_write_cmpl = false |
#define SAMPLE_SLE_SEEK_INTERVAL 100 |
#define SAMPLE_SLE_SEEK_WINDOW 100 |
|
static |
|
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 |