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

How to transmit dynamic sensor datas on nrf52832 BLE?

Thanks in advanced. I achieve 4 uint8_t dynamic sensor datas, I want 52832 transmit them through BLE continuously. Based on examples\ble_peripheral\ble_app_gatts_c, I can see rssi value is advertised dynamicly in nrf connect app, which is done by ble_advertising_init(). I think this value is located in below struct marked red, am I right?

typedef struct
{
......
int8_t * p_tx_power_level; /**< TX Power Level field. */

......


ble_advdata_service_data_t * p_service_data_array; /**< Array of Service data structures. */

......
} ble_advdata_t;

So I want to follow rssi to tranmit my datas, maybe they can be stored in param marked blue. I find p_tx_power_level is encoded by ble_advdata_encode(), but unfortunately, I don't know where p_tx_power_level is assigned. So my question is: where is p_tx_power_level assigned? Is my idea right? Is there any example to transmit user-defined dynamic data continuously?

Parents
  • Hi,

    The RSSI is the power of the signal at the receiver end. That is not part of the advertising packet, but is status information you get in the receiver. (The Tx power level is sometimes part of the advertising packet, but then this is constant, so that the receiver can use that together with the RSSI to estimate distance.)

    I think it would be good to look more specifically at what you want to achieve, which is not entierly clear to me. Can you clarify what you want to achieve? Is it to advertise data that changes regularly (i.e. update the advertising data regularly)? If so then you can set up an advertiser, and update the advertising data whenever you want by calling ble_advertising_advdata_update() if using the advertising module. You can also update it without using the advertising module but then you need to either alternate between two buffers, or stop and re-start the advertising after updating the data.

  • SDK is nRF5_SDK_17.0.2_d674dde, no permanent field at all.

    ret_code_t ble_advertising_advdata_update(ble_advertising_t * const p_advertising,
    ble_advdata_t const * const p_advdata,
    ble_advdata_t const * const p_srdata)

Reply Children
No Data
Related