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

Send data over Advertising

Hi,

My goal is to send temperature values on the advertising so, I'm trying to get work this example, but i have an error about this lines of the code on keil:

  1. advdata.flags.p_data = &flags;
  2. advdata.flags.size = sizeof(flags);
  3. #include "ble_debug_assert_handler.h"

Any suggestion ? I'm using SDK 8.1.

Thank you in advance.

  • Hi,

    As you can see in the readme.md file on github the example is meant for the old SDK V5.1.0 and you can't expect it to work with SDK 8.1.0 drivers and libraries.

    But have a look at the function sd_temp_get(). It is a simple function that will measure and return the temperature value from the internal nRF51 temperature sensor. Then you can get inspiration from e.g. this tutorial to see how you can incorporate the value into your advertising packet. The tutorial is written for SDK8.0.0 and sadly won't work with V8.1.0 either, but you should be able to get the inspiration you need to get it working. Look at the comment section to see some suggestions.

    PS: Do you know what nRF51 chip revision you have? It is important to use SDKs and SoftDevices compatible with your particular nRF51 revision. Look at the letters and numbers on top of the chip and compare with the tables in the latest Compatibility Matrix to see what revision you have and what SDKs and SDs to use.

Related