获取CC2540/CC2541自身的设备地址/串号
请问下,如何获取CC2540/CC2541自身的设备地址/串号呢,即图中的0xD03972A5F5B9 和 0xD03972A5F39C
IEEE地址? 可以借助 Smartrf programmer 也可以使用
uint8 systemId[DEVINFO_SYSTEM_ID_LEN];
GAPRole_GetParameter(GAPROLE_BD_ADDR, systemId);
嗯,我用你的方法试过了,确实可以,那么请问我怎样把蓝牙设备的名称改成设备的MAC地址呢。我看每次初始化的时候就用GGS_SetParameter来设置蓝牙名称了,我在peripheralStateNotificationCB 中增加 GAPRole_GetParameter(GAPROLE_BD_ADDR, systemId);然后再用GGS_SetParameter来设置蓝牙名称,可是改不过来
The device name is a characteristic which resides in the GGS (GapGattServer) profile, and source for this profile is not public. In order to change the device name OTA with standard GATT write commands, it is necessary to first change the permission to writable with
GGS_SetParameter( GGS_W_PERMIT_DEVICE_NAME_ATT, sizeof ( uint8 ), &devNamePermission );
Additionally, you can register a callback function with GGS to notify the application when the device name has been changed.
参考代码
// Set the GAP Characteristics uint8 devNamePermission = GATT_PERMIT_READ|GATT_PERMIT_WRITE; GGS_SetParameter( GGS_W_PERMIT_DEVICE_NAME_ATT, sizeof ( uint8 ), &devNamePermission );