Our website is under construction. Please stay tuned!

dwm_mac_addr_get

Gets the MAC address list used by the device. The device uses either the address specified by the user or the default address. The default MAC address for each interface can be changed only once by calling dwm_mac_addr_set_once which is written to OTP memory and becomes a new default MAC address. The user can set a custom MAC address by calling dwm_mac_addr_set. The default MAC address can be recovered by factory reset (see dwm_factory_reset) after being modified by the user. The device uses fixed mapping of the MAC address in list to the particular interface as follows:

  1. UWB

  2. BLE

  3. Ethernet

  4. Wi-Fi

The BLE address can be a Random BLE address or a Public BLE address. If a particular interface is not supported, the corresponding MAC address in the list is empty.

void dwm_mac_addr_get(dwm_mac_addr_list_t *mac_addr_list)
Parameters
  • output – err_code, type_0, type_1, type_2, type_3, mac_addr_0, mac_addr_1, mac_addr_2, mac_addr_3

  • type_0 – ? 8-bit unsigned integer ? (type describing the MAC address at index 0 in the list)

  • mac_addr_0 – ? 48-bits value ? (little endian)

C code example

dwm_mac_addr_list_t mac_addr_list;
rv: dwm_mac_addr_get(&mac_addr_list);
if (rv == DWM_OK) {
printf("UWB MAC 0x%02x%02x%02x%02x%02x%02x status=x%02x\n",
mac_addr_list.mac[0][0],
mac_addr_list.mac[0][1],
mac_addr_list.mac[0][2],
mac_addr_list.mac[0][3],
mac_addr_list.mac[0][4],
mac_addr_list.mac[0][5],
mac_addr_list.type[0].status);
} else {
printf("can't get MAC address list, error %d\n", rv);
}

SPI/UART example

TLV request

type

length

0x83

0x00

Type 0x83 (131 dec) means command dwm_mac_addr_get

TLV response

type

Length

Value (see error codes)

type

** Length**

value

0x40

0x01

0x00

0xC1

0x18

(byte

0-4)

flags

of the MAC

address

list

in

little

endian

(byte
5-10)

MAC

address

0 in

little

endian

(byte

11-16)

MAC

address

1 in

little

endian

(byte

17-22)

AC

address

2 in

little

endian

(byte

23-28)

MAC

address

3 in

little

endian

Type 0x40 means err_code of the previous command
Type 0xC1(193 dec) means MAC address list

MAC address flags encoding

flags of the MAC address list

byte 0

byte 1

byte 2

byte 3

bits 2-7

bits 0-1

bits 11-15

bit 10

bits 8-9

bits 18-23

bits 16-17

bits 26-31

bits 24-25

R

S_0

R

P_1

S_1

R

S_2

R

S_3

T_0, T_1, T_2, T_3 describe the MAC address status.

0 - Empty MAC address
1 - Default MAC address from OTP memory.
2 - User specified MAC address
3 - Mutable default MAC address can be rewritten only once using dwm_mac_addr_set_once.

P_1 is set if the BLE address is the Public BLE address. The flag is cleared if the BLE MAC address is random. Refer to BLE specification for more information on BLE address types.