home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] How to convert a character MAC address into individual hex bytes for writing?

  • Subject: Re: [OCLUG-Tech] How to convert a character MAC address into individual hex bytes for writing?
  • From: Alex Pilon <alp [ at ] alexpilon [ dot ] ca>
  • Date: Fri, 28 Jul 2017 11:43:13 -0400
On Fri, Jul 28, 2017 at 07:22:16AM -0400, Robert P. J. Day wrote:
>   OK, this exercise should be a bit trickier -- given a character MAC
> address, how can I break it into individual hex chars for writing to
> EEPROM? So the script takes the argument, say, "A0:B1:C2:D3:E4:F5",
> and I need to, one nibble at a time, get the value 0x0A, 0x0, 0x0B, 0x01
> and so on.

So would you like the bytes 0x0A, 0x00, etc., or the string "0x0A 0x00…"?

Cheers,

Alex Pilon