Hi,
I followed the tutorial in the Github and create a custom service. (Github:https://github.com/NordicPlayground/nRF52-Bluetooth-Course)
1. I use the ble_cus_custom_value_update in the main function like this. I get the data from sensor. First I transmit the float data to uint_8 type and sent it to the function. But I found that there is no delay in the transmission. Why does it happen?
m_custom_value = 0x00; ble_cus_custom_value_update(&m_cus, m_custom_value); nrf_delay_ms(10); uint8_t AccX[4];//store 4 bytes of a float data bds_float_encode(&acceleration_g[0],&AccX); m_custom_value=AccX[0]; ble_cus_custom_value_update(&m_cus, m_custom_value); nrf_delay_ms(10); m_custom_value=AccX[1]; ble_cus_custom_value_update(&m_cus, m_custom_value); nrf_delay_ms(10); m_custom_value=AccX[2]; ble_cus_custom_value_update(&m_cus, m_custom_value); nrf_delay_ms(10); m_custom_value=AccX[3]; ble_cus_custom_value_update(&m_cus, m_custom_value); nrf_delay_ms(100);
2. The above code can work despite the latency. But when I add more data transmission it will have some problems. I want to send six groups of data and every group has four bytes. One group can work successfully. But when adding more groups, some bytes will disappear. They cannot be recieved. What is the reason?