最近用手机在扫描从机的时候,发现有时候Iphone的手机扫描的设备,但是名字是空白或者是“?”,即设备名字不正常显示,很困惑,求指导怎么解决?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
这两个名字不是都可以动态修改吗?我同时修改了呀
void DeviceNameUpdate_Chen(uint8 *name)
{
uint8 scanRspData_length= sizeof(scanRspData);
Device_name_length = strlen((char*)(name));
if(Device_name_length>20)
{
Device_name_length=20;
}
CHEN_scanRspData[0] = Device_name_length+1;
CHEN_scanRspData[1] = scanRspData[1];
osal_memcpy((CHEN_scanRspData+2),name,Device_name_length); // 复制设备名字
osal_memcpy((CHEN_scanRspData+(2+Device_name_length)),(scanRspData+(scanRspData_length-10)),9); // 复制设备名字
//CHEN_scanRspData[2+Device_name_length] = scanRspData[scanRspData_length-10]; //
GAPRole_SetParameter( GAPROLE_SCAN_RSP_DATA, (Device_name_length+11),CHEN_scanRspData);
GAP_UpdateAdvertisingData(simpleBLEPeripheral_TaskID, FALSE,(Device_name_length+11), CHEN_scanRspData); // 更新搜索到的名字
GGS_SetParameter( GGS_DEVICE_NAME_ATT, GAP_DEVICE_NAME_LEN,name);//attDeviceName );
}
这样子,不行吗?