This function will retrieve the MAC address of the Bluetooth adapter.
Input:
None.
Output:
address : STRING
The address of the adapter.
Returns: INT
1
|
-
|
_BT_OK
|
|
Success
|
0
|
-
|
_BT_ERR_NOT_SUPPORTED
|
|
The API is not supported.
|
-1
|
-
|
_BT_ERR_NOT_OPEN
|
|
The adapter is not powered(see btPower).
|
-5
|
-
|
_BT_ERR_NO_ADAP
|
|
Could not find adapter.
|
Declaration:
FUNCTION btAdapterAddressGet : INT;
VAR_INPUT
address : ACCESS STRING;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
rc : INT;
address : STRING;
END_VAR;
btPower();
BEGIN
...
rc:=btAdapterAddressGet(address:=address);
DebugFmt(message:="btGetAdapterAddress: \1, " + address, v1:=rc);
...
END;
END_PROGRAM;
|