对话框中,
我似乎不能更新设备名称,现在睡眠是启用的。当睡眠被禁用时,通过重复调用app_easy_gap_update_adv_data成功地更新了设备名称。
以下是更新设备名称的功能:
空白bleAppendBDAddressToDevName(空白)
{
uint8_t PCCOMMBDAddress [6];
bleGetBdAddress (PCCOMMBDAddress);
/ /重置
memset(BLEScanResponseData + 2,0,14);
BLEScanResponseData [2] = 0 x54;
BLEScanResponseData [3] = 0 x44;
BLEScanResponseData [4] = 0 x4c;
BLEScanResponseData [5] = 0 x53;
BLEScanResponseData [6] = 0 x2d;
BLEScanResponseData[7] = bleConvertHextoAscii(PCCOMMBDAddress[3] >> 4);
BLEScanResponseData[8] = bleConvertHextoAscii(PCCOMMBDAddress[3] & 0x0F);
BLEScanResponseData[9] = bleConvertHextoAscii(PCCOMMBDAddress[4] >> 4);
BLEScanResponseData[10] = bleConvertHextoAscii(PCCOMMBDAddress[4] & 0x0F);
BLEScanResponseData[11] = bleConvertHextoAscii(PCCOMMBDAddress[5] >> 4);
BLEScanResponseData[12] = bleConvertHextoAscii(PCCOMMBDAddress[5] & 0x0F);
BLEScanResponseData [13] = ' \ 0 ';
//更新广告/扫描数据
app_easy_gap_update_adv_data((uint8_t *)BLEAdvertData, BLE_ADVERT_DATA_LENGTH, (uint8_t *)BLEScanResponseData, BLE_SCAN_RESP_LEN);
}
然后用下面的方式开始做广告:
空白bleStartAdvertising(空白)
{
/ /开始广告
app_easy_gap_undirected_advertise_start ();
//更新广告/扫描数据
app_easy_gap_update_adv_data((uint8_t *)BLEAdvertData, BLE_ADVERT_DATA_LENGTH, (uint8_t *)BLEScanResponseData, BLE_SCAN_RESP_LEN);
//更新保存GAP配置文件状态的本地变量
BLEGapProfileState = GAPSTATE_ADVERTISING;
//发送连接状态
pccommSendConnectionStatus ();
}
嗨jlabuac,
好的,在SDK中有一个例子,将使用app_easy_gap_update_adv_data()更新广告字符串,我没有看到任何问题时,运行fw,你能检查一下吗?
由于MT_dialog