« Close

Datasheets and User Guides

App Notes

Software & Driver

 

2.6.4 - NumberToMAC

Takes an integer representing a MAC address and outputs the corresponding hex-colon MAC address as a null-terminated string.

Syntax

LJM_ERROR_RETURN LJM_NumberToMAC(
                      unsigned long long Number, 
                      char * MACString)

Parameters

Number [in]
The number representing a MAC address.
MACString [out]
A character array which will be updated to contain the null-terminated string representation of the MAC address. Must be allocated to size LJM_MAC_STRING_SIZE.

Returns

LJM errorcodes or 0 for no error.

Remarks

Use this function to get a more human-readable interpretation of a MAC address.

Examples

[C/C++] Convert a number into a MAC string.

int LJMError;
char MACString[18];
 
LJMError = LJM_NumberToIP(81952921372024, MACString);
printf ("%s \n", MACString);
// prints "78:45:C4:26:89:4A"