static void advertising_init(void) { uint32_t err_code; ble_advertising_init_t init; uint8_t m_addl_adv_manuf_data[19] = {0xaa,0xbb,0x00,0x00,0xC4,0xF1,0x00,0x0b,0x03,0x01}; memset(&init, 0, sizeof(init)); ble_advdata_manuf_data_t manuf_data; manuf_data.data.size = sizeof(m_addl_adv_manuf_data); manuf_data.data.p_data = &m_addl_adv_manuf_data[2]; init.advdata.p_manuf_specific_data = &manuf_data; init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE; init.srdata.name_type = BLE_ADVDATA_FULL_NAME; init.srdata.include_appearance = false; init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]); init.srdata.uuids_complete.p_uuids = m_adv_uuids; 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; 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); } ble_gap_scan_params_t const m_scan_params = { .active = 1, .interval = SCAN_INTERVAL, .window = SCAN_WINDOW, .timeout = SCAN_DURATION, .scan_phys = BLE_GAP_PHY_1MBPS, .filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL, }; void on_adv_report(ble_gap_evt_adv_report_t const * p_adv_report) { printf("scan_response=%04x\r\n",p_adv_report->type); printf("%02x %02x %02x %02x %02x %02x\r\n",p_adv_report->peer_addr.addr[5], p_adv_report->peer_addr.addr[4],p_adv_report->peer_addr.addr[3], p_adv_report->peer_addr.addr[2],p_adv_report->peer_addr.addr[1], p_adv_report->peer_addr.addr[0]); if(p_adv_report->peer_addr.addr[5]==0xDE&&p_adv_report->peer_addr.addr[4]==0x88) { printf("ADV data:\r\n"); for(uint8_t i=0;idata.len;i++) printf("%02x ",p_adv_report->data.p_data[i]); printf("\r\n"); } uint32_t ret = sd_ble_gap_scan_start(&m_scan_params, &m_scan_buffer); }