nrf Connect SDK: Issue Reading FICR

hello,
I'm using nrf52DK & connect sdk v2.6.1.

I'm in the process of migrating from nrf5 SDK to connect SDK.

My previous code to read Mac address to form unique BLE names works in nrf5 SDK but in connect SDK i have an issue. saying this " implicit declaration of function 'itoa' [-Wimplicit-function-declaration]"

My Code below.

static void get_device_name(void)
{
  	itoa((int)NRF_FICR->DEVICEADDR0,MAC_ADDRESS, 16);                           //Getting the Mac_Address from UICR

	uint8_t length = strlen(MAC_ADDRESS);

	for(int i=0;i<length;i++)
	{
	MAC_ADDRESS[i] = toupper(MAC_ADDRESS[i]);                                   //Making sure the MAC_Address is all in Upper Case
	}
	
	SERIAL_NUMBER[5] = MAC_ADDRESS[length-1];                                   //Creating Serial Number for Advertising Purpose
	SERIAL_NUMBER[4] = MAC_ADDRESS[length-2];                                   //Creating Serial Number for Advertising Purpose
	SERIAL_NUMBER[3] = MAC_ADDRESS[length-3];                                   //Creating Serial Number for Advertising Purpose
	SERIAL_NUMBER[2] = MAC_ADDRESS[length-4];                                   //Creating Serial Number for Advertising Purpose
	SERIAL_NUMBER[1] = MAC_ADDRESS[length-5];                                   //Creating Serial Number for Advertising Purpose
	SERIAL_NUMBER[0] = MAC_ADDRESS[length-6];                                   //Creating Serial Number for Advertising Purpose
		
	strcat(DEVICE_NAME,SERIAL_NUMBER);            							  	//Forming the Unique BLE Name
}

unable to find a solution to this as the application is not starting to advertise. 

itoa is included in stdlib.h Usually! so how can I achieve the results in the above case?

Thanks for your support.
Gokulnath

Parents Reply Children
No Data
Related