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

How to use "app_uart_put()" & "app_uart_get()" in ble_app_uart / ble_app_uart_c: Communication Protocols

Hi,

I am using an NRF 51422 DK, SDK 12.3, and Soft Device S130. I am also a beginner to development with Nordic Products, and RSSI collection in general. I am using the ble_peripheral -> ble_app_uart example as a foundation to slowly build upon more and more. Initially, I was trying to calculate RSSI values and have them print to a Terminal.

My intention is to program two of these boards (one central, one peripheral) to react when the RSSI strength between them varies at certain levels. This would be in the form of lighting up an LED.

Once I found success with RSSI data collection, I wanted to try and have it set to collect RSSI values once BLE_GAP_EVT_CONNECTED went off. My hopes now, is to send UART data from the peripheral to the central device every time a RSSI value triggers one of my defined conditionals.

I want to send a simple integer value of 1, 2, 3, and 4 from peripheral to central to define things like "less than 4 ft" or "less than 6 ft". And at these times, an LED would go off.

I have tried using app_uart_put (peripheral) and app_uart_get (central) to send this data (that is smaller than 1 byte "uint8_t"), but the only thing this "put" seems to do, is print to the peripherals Terminal instead of sending over to the central device.

I haven't been able to trigger APP_UART_DATA_READY (which from what I understand is where it should be going) and I am out of ideas. Can anyone explain in very careful detail how I create this communication protocol? Am I even able to send basic values with this command, or do I have to use the systems for data already in place in the uart_app examples.

Can some

Related