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

How to send the sensor data via beacon ?

Hi, I am working nrf52832. I want to send the string.

#define APP_ADV_DATA_LENGTH             0x1F                             /**< Length of manufacturer specific data in the advertisement

uint16_t length;
   char str[30];
//length = sprintf(str,"hum =%0.2f , temp =%0.2f\n ",temp,hum);
sprintf(str,"hum =%0.2d , temp =%0.2d,pressure1=%0.2d \n ",temperature,humudity,pressure1);  //convert float to string

printf(str,"hum =%f  temp =%f \n ",temperature,humudity,pressure1);


static uint8_t m_beacon_info[APP_BEACON_INFO_LENGTH] =                    /**< Information advertised by the Beacon. */
{
    APP_DEVICE_TYPE,     // Manufacturer specific information. Specifies the device type in this
                         // implementation.
    APP_ADV_DATA_LENGTH, // Manufacturer specific information. Specifies the length of the
                         // manufacturer specific data in this implementation.
    APP_BEACON_UUID,     // 128 bit UUID value.
    APP_MAJOR_VALUE,     // Major arbitrary value that can be used to distinguish between Beacons.
    APP_MINOR_VALUE,     // Minor arbitrary value that can be used to distinguish between Beacons.
    APP_MEASURED_RSSI ,   // Manufacturer specific information. The Beacon's measured TX power in
                         // this implementation.
    str                    
};

Is it correct or not? . thanks

Parents Reply Children
No Data
Related