bleDeviceStatus (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

2.25.00


 

This function returns the connection status of the device.

If the device is connected, the return code also tells the status of the service cache, see bleServiceCacheUpdate.

 

 

Input:

dev: SYSHANDLE

Handle to the device to get the status of.

 

 

 

Returns: INT

22

 

-


Connection is ready for use, using cache from this connection.

21

 

-


Connection is ready for use, using cache from previous connection.

20

 

-


Connection is ready for use, no cache loaded. Use bleServiceCacheUpdate to create the cache.

10

 

-


Connected, waiting to configure connection.

5

 

-


Trying to establish connection

2

 

-


Connection lost. Call bleDisconnect to clean up the connection.

1

 

-


Not connected.

0

 

_BLE_ERR_NOT_SUPPORTED


The API is not supported.

-1

 

_BLE_ERR_NOT_OPEN


The interface is not powered(see blePower).

-4

 

_BLE_ERR_NOT_FOUND


Failed to find device.

-20

 

_BLE_ERR_INVAL_HANDLE


Invalid handle.

 

 

Declaration:

FUNCTION bleDeviceStatus : INT;
VAR_INPUT
   dev   : SYSHANDLE;
END_VAR;

 

Example:

...
   rc := bleDeviceStatus(dev := dev);
   DebugFmt(message:="bleDeviceStatus: \1", v1:=rc);
...