btAdapterAddressGet (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-200, NX-400, NX-900

Firmware version:

1.10.00

 


 

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;
 
// Turn on Bluetooth module
btPower();
 
BEGIN
  ...
  rc:=btAdapterAddressGet(address:=address);
  DebugFmt(message:="btGetAdapterAddress: \1, " + address, v1:=rc);
  ...
END;
 
END_PROGRAM;