btDeviceRemove (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-200, NX-400, NX-900

Firmware version:

1.10.00

 


 

This function is used to remove remote devices, e.g. to remove the pairing.

When a device has been removed, it is necessary to run a scan(btStartScan) to find it again.

 

Input:

dev : STRING

The address of the device to remove. If empty all devices will be removed.

 

 

Returns: INT

1

-

_BT_OK


Pairing was successful

0

-

_BT_ERR_NOT_SUPPORTED


The API is not supported.

-1

-

_BT_ERR_NOT_OPEN


The adapter is not powered(see btPower).

-4

-

_BT_ERR_NOT_FOUND


Could not find device.

 

 

 

Declaration:

FUNCTION btDeviceRemove : INT;
VAR_INPUT
  dev      : STRING := "";
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc      : INT;
END_VAR;
 
// Turn on the Bluetooth library
btPower();
 
// Remove all devices
rc := btDeviceRemove();
DebugFmt(message:="btDeviceRemove: \1 ", v1:=rc);
...
 
BEGIN
  ...
END;
 
END_PROGRAM;