This function turns the Bluetooth interface on and off.
Input:
power : BOOL (default ON)
If the power should be turned on or off
Returns: INT
1
|
-
|
_BLE_OK
|
|
Success
|
0
|
-
|
_BLE_ERR_NOT_SUPPORTED
|
|
The API is not supported.
|
-2
|
|
_BLE_ERR_ALREADY_OPEN
|
|
The interface is already on.
|
-4
|
|
_BLE_ERR_NOT_OPEN
|
|
The interface is already off.
|
-5
|
-
|
_BLE_ERR_NO_ADAP
|
|
Could not find interface.
|
Declaration:
FUNCTION blePower : INT;
VAR_INPUT
power : BOOL := ON;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
blePower();
BEGIN
...
END;
END_PROGRAM;
|