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.

------------------------------------------------------------

--------------------

  • Hi,

    Please see the simpleBLEObserver_HandleKeys() fxn which displays received device (Adv) info to the LCD.

    Best wishes
  • First of all, thank you for your reply, I have a look at simpleBLEObserver_HandleKeys(), and I assume you refer to this part:

    // Display discovery results
    if ( !simpleBLEScanning && simpleBLEScanRes > 0 )
    {
        // Increment index of current result (with wraparound)
        simpleBLEScanIdx++;
        if ( simpleBLEScanIdx >= simpleBLEScanRes )
        {
          simpleBLEScanIdx = 0;
        }
            
        LCD_WRITE_STRING_VALUE( "Device", simpleBLEScanIdx + 1,
                                10, HAL_LCD_LINE_1 );
        LCD_WRITE_STRING( bdAddr2Str( simpleBLEDevList[simpleBLEScanIdx].addr ),
                          HAL_LCD_LINE_2 );
    }

    I had already checked simpleBLEDevList[], but according to the documentation the gapDevRec_t structure only has eventType, addrType, and addr fields, so I don't know how to get the custom advertising data from them.

    Maybe I'm missing something?

  • Hi

    If you want to get advertising data, please check simpleBLEObserverEventCB()-->case GAP_DEVICE_INFO_EVENT:

    you should get advertising(scan response) data from pEvent->deviceInfo.pEvtData

    typedef struct
    {
      osal_event_hdr_t  hdr;    //!< GAP_MSG_EVENT and status
      uint8 opcode;             //!< GAP_DEVICE_INFO_EVENT
      uint8 eventType;          //!< Advertisement Type: @ref GAP_ADVERTISEMENT_REPORT_TYPE_DEFINES
      uint8 addrType;           //!< address type: @ref GAP_ADDR_TYPE_DEFINES
      uint8 addr[B_ADDR_LEN];   //!< Address of the advertisement or SCAN_RSP
      int8 rssi;                //!< Advertisement or SCAN_RSP RSSI
      uint8 dataLen;            //!< Length (in bytes) of the data field (evtData)
      uint8 *pEvtData;          //!< Data field of advertisement or SCAN_RSP
    } gapDeviceInfoEvent_t;

  • Thank you, I can't check if it was what I'm looking for until monday, but I appreciate so much your help!

    EDIT: Sorry for the delay, it works like a charm! Thank you very much!