CC2541更改设备名称
CC2541广播的名字改不了,改了之后在手机上还是显示SimpleBLEPeripheral,请大神解答
更改的代码如下:
// GAP - SCAN RSP data (max size = 31 bytes)
static uint8 scanRspData[] =
{
// complete name
0x08, // length of this data
GAP_ADTYPE_LOCAL_NAME_COMPLETE,
0x53, // 'S'
0x53, // 'S'
0x53, // 'S'
0x70, // 'p'
0x6c, // 'l'
0x65, // 'e'
0x42, // 'B'
// connection interval range
0x05, // length of this data
GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
LO_UINT16( DEFAULT_DESIRED_MIN_CONN_INTERVAL ), // 100ms
HI_UINT16( DEFAULT_DESIRED_MIN_CONN_INTERVAL ),
LO_UINT16( DEFAULT_DESIRED_MAX_CONN_INTERVAL ), // 1s
HI_UINT16( DEFAULT_DESIRED_MAX_CONN_INTERVAL ),
// Tx power level
0x02, // length of this data
GAP_ADTYPE_POWER_LEVEL,
0 // 0dBm
};
设备名称的问题论坛上很多讨论,请参考这边解答:
http://www.deyisupport.com/question_answer/wireless_connectivity/bluetooth/f/103/t/61571.aspx
http://www.deyisupport.com/question_answer/wireless_connectivity/bluetooth/f/103/t/18365.aspx
谢谢