Get ID, MAC Address
Antwort
28.05.18 06:22
I want to get the number of the WLAN, Bluetooth, FCC ID, IC ID, serial # etc on the back of the XDK through the source code.

I have already obtained the serial number, but it is a hardware number rather than the number on the back of the XDK.
0 (0 Stimmen)
RE: Get ID, MAC Address
Antwort
28.05.18 13:59 als Antwort auf jang.
Hello jang,

the FCC ID, the IC ID and the serial number can not be retrieved using the XDK.

The FCC ID and the IC ID are provided by the United State’s Federal Communication Commission and Industry Canada respectively. They are responsible for authorizing wireless devices in USA and Canada. They are the same for every XDK. As such, creating a macro for this would suffice.

The serial number on the other hand just identifies the XDK from a production point of view. It is issued by the manufacturer (i.e. Bosch XDK), but there is no API to retrieve that, since it is not stored anywhere on the XDK.

As such, the only serial number you could retrieve is the serial number of the MCU in the XDK, which is most likely what you already found.

Regarding the WLAN mac address, you can retrieve that using the following code:

 
WlanConnect_Init(); _u8 macAddressVal[SL_MAC_ADDR_LEN]; _u8 macAddressLen = SL_MAC_ADDR_LEN; sl_NetCfgGet(SL_MAC_ADDRESS_GET,NULL,&macAddressLen,(_u8 *)macAddressVal); // The 6 bytes of the Mac address are now stored in the array macAddressVal 


For this code, you need to include the header-files simplelink.h and BCDS_WlanConnect.h . The call of WlanConnect_Init() is required to connect the Simplelink Chip with the MCU and to activate the chip in general.

As for the Bluetooth Mac address, this address is set dynamically during the initialization of the BLE module and can therefore not be retrieved by API.

To set a Mac address, use the function BlePeripheral_SetMacAddress() before the initialization of the BLE module. As such, you could also define the BLE address as a macro or use the WiFi mac address.

Please tell me if this was helpful, and do not hesitate to ask further questions.

Kind regards,
Alex
0 (0 Stimmen)
RE: Get ID, MAC Address
Antwort
29.05.18 12:12 als Antwort auf Alexander Sawtschuk.

I used the code to get the mac address. It prints to the console window preferentially using printf and tries to put the values into an array.

But for output to the console window
printf ("MAC Address WLAN:% c \ n", (_ u8 *) macAddressVal);

I used the code above, but I did not get any values.
How can I print?

And I want to put it in an array of type int32_t.
I wonder what type conversion is required.

0 (0 Stimmen)
RE: Get ID, MAC Address
Antwort
29.05.18 13:34 als Antwort auf jang.
Hello Jang,

%c in printf() will display only one character in the console, whereas you are passing an array of bytes into it containing the Wi-Fi mac address.

To get the correct result, your printf() content should look as follows: printf(" MAC Address WLAN: %x-%x-%x-%x-%x-%x\n\r", macAddressVal[0], macAddressVal[1], macAddressVal[2], macAddressVal[3], macAddressVal[4], macAddressVal[5]);

This code will display every element in the corresponding array macAddressVal .

Please let me know if that was helpful and feel free to ask if you have any further questions or concerns.

Kind regards,
Alex
0 (0 Stimmen)