Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

what is the set_id and data_id?

Dear Nordic Engineers

I study central code,I find a param ble_gap_evt_adv_report_t

typedef struct
{
  ble_gap_adv_report_type_t type;                  /**< Advertising report type. See @ref ble_gap_adv_report_type_t. */
  ble_gap_addr_t            peer_addr;             /**< Bluetooth address of the peer device. If the peer_addr is resolved:
                                                        @ref ble_gap_addr_t::addr_id_peer is set to 1 and the address is the
                                                        peer's identity address. */
  ble_gap_addr_t            direct_addr;           /**< Contains the target address of the advertising event if
                                                        @ref ble_gap_adv_report_type_t::directed is set to 1. If the
                                                        SoftDevice was able to resolve the address,
                                                        @ref ble_gap_addr_t::addr_id_peer is set to 1 and the direct_addr
                                                        contains the local identity address. If the target address of the
                                                        advertising event is @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE,
                                                        and the SoftDevice was unable to resolve it, the application may try
                                                        to resolve this address to find out if the advertising event was
                                                        directed to us. */
  uint8_t                   primary_phy;           /**< Indicates the PHY on which the primary advertising packet was received.
                                                        See @ref BLE_GAP_PHYS. */
  uint8_t                   secondary_phy;         /**< Indicates the PHY on which the secondary advertising packet was received.
                                                        See @ref BLE_GAP_PHYS. This field is set to @ref BLE_GAP_PHY_NOT_SET if no packets
                                                        were received on a secondary advertising channel. */
  int8_t                    tx_power;              /**< TX Power reported by the advertiser in the last packet header received.
                                                        This field is set to @ref BLE_GAP_POWER_LEVEL_INVALID if the
                                                        last received packet did not contain the Tx Power field.
                                                        @note TX Power is only included in extended advertising packets. */
  int8_t                    rssi;                  /**< Received Signal Strength Indication in dBm of the last packet received.
                                                        @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */
  uint8_t                   ch_index;              /**< Channel Index on which the last advertising packet is received (0-39). */
  uint8_t                   set_id;                /**< Set ID of the received advertising data. Set ID is not present
                                                        if set to @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */
  uint16_t                  data_id:12;            /**< The advertising data ID of the received advertising data. Data ID
                                                        is not present if @ref ble_gap_evt_adv_report_t::set_id is set to
                                                        @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */
  ble_data_t                data;                  /**< Received advertising or scan response data. If
                                                        @ref ble_gap_adv_report_type_t::status is not set to
                                                        @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the data buffer provided
                                                        in @ref sd_ble_gap_scan_start is now released. */
  ble_gap_aux_pointer_t     aux_pointer;           /**< The offset and PHY of the next advertising packet in this extended advertising
                                                        event. @note This field is only set if @ref ble_gap_adv_report_type_t::status
                                                        is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. */
} ble_gap_evt_adv_report_t;

 I can understand other param of ble_gap_evt_adv_report_t,but I don't understand set_id and data_id.I read the note,data_id is the advertising data ID of the received advertising data.

1、I wonder if data_id is set in advertising data of ble_peripheral?I not found data_id in ble_advdata_t.

2、The note of the set_id says: Set ID is not present if set to @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE.

Data ID is not present if @ref ble_gap_evt_adv_report_t::set_id is set to @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */

I wonder that it's meaings if I set set_id = BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE,the  Data ID doesn't present?

If I would like  use data_id to filter device,How can I do?

Parents
  • Hi,

    The Set ID (SID) and Data ID (DID) are extended advertising concepts used in periodic advertising. From BluetoothRegistered Core Specification Version 5.3 Feature Enhancements:

    ADI consists of two sub-fields named Advertising Data ID (DID) and Advertising Set ID (SID). Identical SID and DID values identify identical or equivalent advertising data within a particular advertising set.

    I wonder that it's meaings if I set set_id = BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE,the  Data ID doesn't present?

    Yes, that is correct. For instance, these fields are never present in "normal" (non-extended) advertising packets.

    If I would like  use data_id to filter device,How can I do?

    The Set ID contains the set ID of the advertiser (useful in case the advertiser are advertising multiple advertising sets), so that you can separate each set from one another. And the data ID lets you distinguish between conceptual advertising packets. If several have the same Set ID and Data ID, they are duplicates and you can typically ignore them until you receive one with a new ID. But again, remember that this only applies to extended advertising. 

  • Dear Einar

    I wonder user SET ID and Data ID,I must set advertising data of peripheral ?

    Eg:I set  peripheral_set_id=xx1,peripheral_data_id=xx2 in advertising data of peripheral .

    And I need to do in central:

    ble_gap_evt_adv_report_t = adv_report;

    adv_report.set_id = xx1;

    adv_report.data_id = xx2;

    So I can use set_id and data_id to filter peripheral device in central?

    Best regards

  • In principle yet, but note that the SoftDevices used in the nRF5 SDK has very limited support for advertising extensions. So to actually implement this you would need to use the nRF Connect SDK instead.

Reply Children
Related