|
您好,我是先接触的CC2541再转到的nrf51822.有关广播数据内容我想请教下?
在CC2541里,广播数据在数组里定义,比较直观
static uint8 advertData[] =
{
0x02, // length of this data
GAP_ADTYPE_FLAGS,
DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
// service UUID, to notify central devices what services are included
// in this peripheral
0x0c, // length of this data
//GAP_ADTYPE_16BIT_MORE, // some of the UUID's, but not all
//LO_UINT16( SIMPLEPROFILE_SERV_UUID ),
//HI_UINT16( SIMPLEPROFILE_SERV_UUID ),
0x09,
0x4d,
0x54,
0x4b,
0x42,
0x54,
0x44,
0x45,
0x56,
0x49,
0x43,
0x45,
};
但是在Nrf51822l里的static void advertising_init(void)
{
uint32_t err_code;
ble_advdata_t advdata;
uint8_t flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
// YOUR_JOB: Use UUIDs for service(s) used in your application.
ble_uuid_t adv_uuids[] = {{BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE}};
// Build and set advertising data
memset(&advdata, 0, sizeof(advdata));
advdata.name_type = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance = true;
advdata.flags.size = sizeof(flags);
advdata.flags.p_data = &flags;
advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
advdata.uuids_complete.p_uuids = adv_uuids;
err_code = ble_advdata_set(&advdata, NULL);
APP_ERROR_CHECK(err_code);
}
里我实在没找到具体明确的广播内容,通过抓包数据看ADvdata,真不知道他是怎么组织的广播包内容?请大家帮我看看
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|