I'm trying to design custom advertising package.The code as follow:
static void advertising_init(uint8_t type) { uint32_t err_code; ble_advertising_init_t init; ble_advdata_service_data_t self_data; memset(&init, 0, sizeof(init)); init.advdata.name_type = BLE_ADVDATA_FULL_NAME; init.advdata.include_appearance = true; init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE; init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]); init.advdata.uuids_complete.p_uuids = m_adv_uuids; add_type = type; self_data.service_uuid = BLE_UUID_DEVICE_INFORMATION_SERVICE; self_data.data.p_data = &add_type; self_data.data.size = sizeof(add_type); init.advdata.p_service_data_array = &self_data; init.advdata.service_data_count = 1; init.config.ble_adv_fast_enabled = true; init.config.ble_adv_fast_interval = APP_ADV_INTERVAL; init.config.ble_adv_fast_timeout = APP_ADV_DURATION; init.evt_handler = NULL; err_code = ble_advertising_init(&m_advertising, &init); APP_ERROR_CHECK(err_code); ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG); }
The addtype is a global variable.
However,The raw of advertising package look like this.
The type is 0x08 and it finded in gap is BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME.
But it should be a fullname.
How should I correct it?