btPower (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-200, NX-400, NX-900

Firmware version:

1.10.00

 


 

This function turns the Bluetooth adapter on and off.

 

 

 

Input:

power : BOOL (default ON)

If the power should be turned on or off

 

 

Returns: INT

1

-

_BT_OK


Success

0

-

_BT_ERR_NOT_SUPPORTED


The API is not supported.

-5

-

_BT_ERR_NO_ADAP


Could not find adapter.

-13

-

_BT_ERR_STATE


The adapter cannot be started.

 

 

Declaration:

FUNCTION btPower : INT;
VAR_INPUT
  power  : BOOL := ON;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
  // Turn on power
  btPower();
 
BEGIN
 ...
END;
 
END_PROGRAM;