Hi,
I'm using the Nordic DK52 (52832) along with SDK 15.0 to prototype an application where I can send some data from a sensor attached via UART to an BLE-enabled application. I'm using nRF Toolbox with the Serial feature to test whether I'm getting any data sent from the sensor. I am using SESV4.22 for the development of the application.
I've started out with the ble_app_uart example and attempted to modify it to my needs. Below I'm providing code snippets where I changed the functions; everything else is unchanged:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Send this to the sensor to initiate a measurement
static uint8_t const readLiveDataCmd[] = {0x16, 0x13, 0x2D, 0x10, 0x1F, 0x00, 0x7E};
//Don't care if data is sent to the board
static void nus_data_handler(ble_nus_evt_t * p_evt)
{
/*if (p_evt->type == BLE_NUS_EVT_RX_DATA)
{
uint32_t err_code;
NRF_LOG_DEBUG("Received data from BLE NUS. Writing data on UART.");
NRF_LOG_HEXDUMP_DEBUG(p_evt->params.rx_data.p_data, p_evt->params.rx_data.length);
for (uint32_t i = 0; i < p_evt->params.rx_data.length; i++)
{
do
{
err_code = app_uart_put(p_evt->params.rx_data.p_data[i]);
if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_BUSY))
{
When I run the app as is, I can see the advertisement in the nRF Toolbox and I can connect to the board, but I get nothing transmitted from the sensor. When I try to debug the application, I get an error 0x04 returned a from the app_uart_put() function.
What did I miss in my program?