2.6.6 - MACToNumber | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver

Friday April 3rd, 2020
Support: LabJack engineers available through email and chat.
Shipping: We are processing and shipping all orders.
Stock: 55/56 products in stock. More details.
Supply Chain: Some disruptions. More details.

2.6.6 - MACToNumber

Takes a hex-colon string representing a MAC address and outputs the corresponding integer version of the address.


                      const char * MACString, 
                      unsigned long long * Number)


MACString [in]
A hex-colon string representing a MAC address.
Number [out]
The numerical representation of MACString.


LJM errorcodes or 0 for no error. Returns LJME_INVALID_PARAMETER if MACString could not be parsed as a MAC address.


Use this function to convert a human-readable interpretation of a MAC address into an integer value.


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

int LJMError;
unsigned long long Number;
LJMError = LJM_MACToNumber("78:45:C4:26:89:4A", &Number);
printf ("%llu \n", Number);
// prints 81952921372024