Hi Everyone
I have a 64bit mac address that I want to convert to a 16bit short address (by taking the last 4 numbers from the end of the mac:
MAC: 0xAAAAAAAAAAAAABCD
SHORT: ABCD
I have tried the obvious with:
Which works, but I get a compiler warning:Code:int main() { uint64_t macAddress = 0xABCDEF0123456789; uint16_t shortAddress = 0x0000; shortAddress = macAddress; printf("Short address is: %02X \n", shortAddress); return 0; }
Can anyone suggest another way of doing it that will result in no compiler warnings?Integer constant is to large for long type
Many thanks
David