This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

getting address of device while scanning


Hello

I am doing a project and the part of it is to, scan the advertisements..

the application has to scan for the device advertising and get the device address, before connecting.

I am not much interested in connection,just to get address of scan device.
 
I am trying to use the parameter GAPROLE_SCAN_RSP_DATA, am I using the correct parameter?

how can I get the address of the device,if I am correct

if I am wrong can you tell how to get address. 

 case GAPROLE_SCAN_RSP_DATA:
      if ( len <= B_MAX_ADV_LEN ) 
      {
        VOID osal_memset( gapRole_ScanRspData, 0, B_MAX_ADV_LEN );
        VOID osal_memcpy( gapRole_ScanRspData, pValue, len );
        gapRole_ScanRspDataLen = len;
        
        // Update the Response Data
        ret = GAP_UpdateAdvertisingData( gapRole_TaskID,
                              FALSE, gapRole_ScanRspDataLen, gapRole_ScanRspData );
      }
Regards,

Lokesh

  • Lokesh,

    If your device is the central device, then you should use the GAPCentralRole_StartDiscovery function to discover the peripheral devices.  Then you should be able to get the peripheral address when you receive the GAP_DEVICE_DISCOVERY_EVENT in the central event callback function.  You can use the sampleBLECentral sample project that came with the BLE stack as reference.

    Leo

  • thank you for the replay,

    The event GAP_DEVICE_DISCOVERY_EVENT is raised whenever HAL_KEY_LEFT is pressed.

    I am using the Bluegiga BLE112a module and do I need to configure pin according to the input pin or is that possible to directly go to scan mode once after GAP_DEVICE_INIT_DONE_EVENT is set

    Regards

    Lokesh