添加厂商数据,以及修改透传UUID
This commit is contained in:
@@ -91,11 +91,21 @@ static void ble_server_connect_handler(ble_server_status_t status)
|
||||
SYS_LOG_INF("ble stop");
|
||||
}
|
||||
}
|
||||
static void _sb_manufacturer_encode(uint8_t manufacturer_data[20])
|
||||
{
|
||||
memset(manufacturer_data, 0, 20);
|
||||
manufacturer_data[0] = 'K';
|
||||
manufacturer_data[1] = 'Y';
|
||||
manufacturer_data[2] = PRODUCT0;
|
||||
manufacturer_data[3] = PRODUCT1;
|
||||
manufacturer_data[4] = VERSIONS;
|
||||
|
||||
}
|
||||
uint8_t ble_init(init_device_t *port)
|
||||
{
|
||||
ble_server_init_t ble_init_param = {
|
||||
.device_name = "Sertorf", // 设备名
|
||||
.manufacturer_data = NULL, // 回调函数,生成 manufacturer[20]
|
||||
.manufacturer_data = _sb_manufacturer_encode, // 回调函数,生成 manufacturer[20] 设置厂商数据
|
||||
.connect_cb = ble_server_connect_handler, // 回调函数, NULL 值可用
|
||||
};
|
||||
//初始化参数
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
#include "../data_port/socket_inet/socket_inet.h"
|
||||
#include "sys_log.h"
|
||||
|
||||
#define PRODUCT0 0x24
|
||||
#define PRODUCT1 0x78
|
||||
#define VERSIONS 0X01
|
||||
|
||||
#define UART_ENABLE 1
|
||||
#define BLE_ENABLE 1
|
||||
#define WIFI_ENABLE 1
|
||||
|
||||
Reference in New Issue
Block a user