I'm sending a command over BLE from the central (Android) to the nRF52832, and receive SPI data back, but in wrong format. How can I convert/display this data as it is.
I expect to receive [1.2 2.2 3.2]
when I send '1'
to the nRF52832. All I get till now is hex data [FF?@]
.
if (p_evt->params.rx_data.p_data[0] == '1') // If the Rx_Central input is '1', ble_nus_data_send the accelerometer data.
{
spim_rx_buffer.AccX = 1.2; // Random dummy data
spim_rx_buffer.AccY = 2.2; // Random dummy data
spim_rx_buffer.AccZ = 3.2; // Random dummy data
for(int i = 0; i < 3; i++)
{
uint16_t len = sizeof(float);
float* spi_p = (float*) &spim_rx_buffer;
err_code = ble_nus_data_send (&m_nus, (uint8_t*)spi_p+i*sizeof(float), &len, m_conn_handle);
}
}