This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to get Peripheral service 128 bit UUID before connection???

Hi i am using nrf52832 development board as central which scans for peripheral devices.

how to get peripheral device service UUID(128 bit) completely before connection?

is it possible to get uuid either using Advertisement packet or scan response packet ?

Thanks,

Rekha

Parents
  • I got it.  I added a case for BLE_GAP_EVT_ADV_REPORT in ble_evt_handler() in main.c.

    Within the case, I obtained a pointer to the advertising data from the pointer to the ble event data..

    	const ble_gap_evt_adv_report_t *p_adv_report;					// Pointer to advertising report
    	char txt[20];
    
        switch (p_ble_evt->header.evt_id)
        {
    		case BLE_GAP_EVT_ADV_REPORT:								// This could be an advertising packet or scan response.
    			p_adv_report = &p_gap_evt->params.adv_report;						// Point to the advertising data.
    			ble_addr_to_str(txt, (uint8_t *)p_adv_report->peer_addr.addr);		// Convert BLE address to string
    			printf("adv %s\n", txt);
    			break;
    

Reply
  • I got it.  I added a case for BLE_GAP_EVT_ADV_REPORT in ble_evt_handler() in main.c.

    Within the case, I obtained a pointer to the advertising data from the pointer to the ble event data..

    	const ble_gap_evt_adv_report_t *p_adv_report;					// Pointer to advertising report
    	char txt[20];
    
        switch (p_ble_evt->header.evt_id)
        {
    		case BLE_GAP_EVT_ADV_REPORT:								// This could be an advertising packet or scan response.
    			p_adv_report = &p_gap_evt->params.adv_report;						// Point to the advertising data.
    			ble_addr_to_str(txt, (uint8_t *)p_adv_report->peer_addr.addr);		// Convert BLE address to string
    			printf("adv %s\n", txt);
    			break;
    

Children
No Data
Related