btPairClear (Function)

Top  Previous  Next

Architecture:

X32 / NX32

Device support:

MX2 pro, DX4 pro, AX9 pro, MX2 turbo/encore/warp, AX9 turbo

Firmware version:

1.08


This function is used to remove a specific device pairing.

For more information about pairing, please see btConnect or btListen.

 

Input:

address : STRING

The device address.

 

Return: INT

0

- Success.

-1

- Bluetooth library is not open.

-13

- Invalid address.

 

Declaration:

FUNCTION btPairClear : INT;
VAR_INPUT
  address : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
btCon : btConnection;
 btID : SINT;
END_VAR;
 
BEGIN
 
...
 
btCon();
IF btCon.changed THEN
  DebugMsg(message:="Connection info changed:");
  DebugFmt(message:="    Connected=\1",v1:=INT(btCon.connected));
  DebugMsg(message:="    Address="+btCon.Address);
  DebugFmt(message:="    Error=\1", v1:=btCon.Errorcode);
  IF btGetDeviceName(id:=btID) <> "LIO-PDA1" THEN
    btPairClear(address:=btCon.Address);
  END_IF;
END_IF;
 
...
 
END;
END_PROGRAM;