This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to print an array using NRF_LOG_INFO

Hallo everyone,

I am reciving a notification from my server, which lenght can be 8, 20, 30 bytes but when I want to display the info using NRF_LOG_INFO is not printing out the whole notification, only one byte

I use the following code to save the data and printting it out

    for (int i = 0;i <p_ble_gattc_evt->params.hvx.len; i++ )
	{
		valor[i] = p_ble_gattc_evt->params.hvx.data[(p_ble_gattc_evt->params.hvx.len-1)-i];
	}

	NRF_LOG_INFO("Sensor %d %.40X \r\n",(number_sensor +1 ),*valor);

I dont want to interate the NRF_LOG_INFO because the data from the notification is not clearly seen.

Regards, David Caraveo

  • The points/letter are the corresponding ascii characters. Take a look at the table here. E.g. 4D in hex is the letter M.

    The APP:INFO tells you that the message is printed from the module named APP(printing from main.c; you have the #define NRF_LOG_MODULE_NAME "APP" at top of main.c. If the message is from e.g. the softdevice_handler.c module it would have been e.g. SDH:INFO). The :INFO is the severity level of the message. You can have INFO, ERROR, WARNING and DEBUG.

    If you for some reason don't want this, you will have to set the LOG_INFO_PREFIX in nrf_log_internal.h to #define LOG_INFO_PREFIX ""

Related