设备:blueNRG-132
SDK:
更改对象:BLE_Beacon_main.c
更改函数:
void Device_Init(void)
添加内容如下
/* Update device name */
ret = aci_gatt_update_char_value_ext(0, service_handle, dev_name_char_handle, 0,sizeof(device_name), 0, sizeof(device_name), device_name);
if(ret != BLE_STATUS_SUCCESS) {
printf("aci_gatt_update_char_value_ext() failed: 0x%02x\r\n", ret);
}
更改函数:
static void Start_Beaconing(void)
添加内容:
uint8_t local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G'};
/* put device in non connectable mode */
ret = aci_gap_set_discoverable(ADV_NONCONN_IND, 160, 160, PUBLIC_ADDR, NO_WHITE_LIST_USE, sizeof(local_name), local_name, 0, NULL, 0, 0);
更改宏定义
#define ENABLE_FLAGS_AD_TYPE_AT_BEGINNING 0
网友评论