Skip to main content
Skip table of contents

MACToNumber [LJM User's Guide]

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

Syntax

LJM_ERROR_RETURN LJM_MACToNumber(

const char * MACString,

unsigned long long * Number)

Parameters

MACString [in]

A hex-colon string representing a MAC address.

Number [out]

The numerical representation of MACString.

Returns

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

Remarks

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

Example

Convert a MAC string into a number.

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

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.