bleServiceCacheUpdate (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

LX2

Firmware version:

2.25.00


This function tries to update the service cache for a connected device.

 

The service cache is used to cache all the services and characteristics of the device, so it is not necessary to read them all every time the device is connected. This makes it possible to quickly connect to a device, read or write a value and disconnect again.

 

This cache is persistent across runtime resets and is deleted on system resets( boardReset(level := 1) ).

 

To manually delete the cache for a single device or for all devices, see bleDeviceCacheDelete.

 

Input:

dev: SYSHANDLE

Handle to the device to update the cache for.

 

 

Returns: INT

1

-

_BLE_OK


Success

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.

-13

 

_BLE_ERR_STATE


Not allowed to update cache at this time.

-17

 

_BLE_ERR_TIMEOUT


Cache update timed out.

-19

 

_BLE_ERR_NOT_CONNECTED


Device is not connected.

-20

-

_BLE_ERR_INVAL_HANDLE


Invalid handle.

 

 

Declaration:

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

 

Example:

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