The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



GetMacAddress


Unit: SDL_filesys
Class: none
Declaration: function GetMacAddress (Adapter: integer; var MacAddress: string): integer;

The function GetMacAddress retrieves the MAC address of the network adapter(s). The parameter Adapter speficies the type of the adapter; a value of 1 retrieves the MAC address of the ethernet adapter (cable bound), a value of 2 retrieves the MAC address of the WiFi adapater. The MAC address is returned in the variable parameter MacAddress using the following format: nn-nn-nn-nn-nn-nn, with nn being hexadecimal numbers.

The function returns the following error codes:

 0 ... everthing is OK
-1 ... Adapter is invalid
-2 ... memory allocation error
-3 ... no MAC data available

Hint: The function GetMacAddress is only available for the compilers Rad Studio 10.2 Tokyo, or higher.



Last Update: 2020-Aug-20