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

wrong sensor data sending over ble

Hi,

I´m using nrf52833 on customized board with a sensor on it. I would like to send the data, collected from sensor ober ble to nrf connect app. I print the collected data on uart terminal too.

The data on uart terminal is correct. I send two Bytes, so the value is between 0 -   65535.

But on nrf connect app the data is shown as different characters, for example "�" or "@".

The Code is really simple, so I would like to Show you a sample:

...

...

This shows the correct value of variable result on uart terminal

  printf(" ACCEL_X:  %u", (unsigned int)result);

This shows the incorrect value on nrf connect app. 

      

 uint32_t       err_code2;
       static uint8_t index2 = 16;
       uint16_t length2 = (uint16_t)index2;
                        err_code2 = ble_nus_data_send(&m_nus, (unsigned int)ergebnis , &length2, m_conn_handle);
                        if ((err_code2 != NRF_ERROR_INVALID_STATE) &&
                            (err_code2 != NRF_ERROR_RESOURCES) &&
                            (err_code2 != NRF_ERROR_NOT_FOUND))
                        {
                            APP_ERROR_CHECK(err_code2);
                        }

What I´m doing wrong? The Code for sending ober BLE is from you SDK example "BLE_UART_APP".

Thanks in advance

Simon

Related