Value Event

Fired when a characteristic or descriptor value is received from the server.

Syntax

ANSI (Cross Platform)
virtual int FireValue(BLEClientValueEventParams *e);
typedef struct {
const char *ServiceId;
const char *CharacteristicId;
const char *DescriptorId;
const char *Uuid;
const char *Description;
const char *Value; int lenValue; int reserved; } BLEClientValueEventParams; Unicode (Windows) virtual INT FireValue(BLEClientValueEventParams *e);
typedef struct {
LPCWSTR ServiceId;
LPCWSTR CharacteristicId;
LPCWSTR DescriptorId;
LPCWSTR Uuid;
LPCWSTR Description;
LPCSTR Value; INT lenValue; INT reserved; } BLEClientValueEventParams;
#define EID_BLECLIENT_VALUE 12

virtual INT IPWORKSBLE_CALL FireValue(LPSTR &lpszServiceId, LPSTR &lpszCharacteristicId, LPSTR &lpszDescriptorId, LPSTR &lpszUuid, LPSTR &lpszDescription, LPSTR &lpValue, INT &lenValue);

Remarks

This event is fired to signify that a value has been received for a characteristic or descriptor. The DescriptorId parameter will be empty string if the value is for a characteristic.

Uuid and Description are the UUID and Bluetooth SIG user-friendly name (if one is defined) of the characteristic or descriptor.

There are three scenarios which can cause this event to fire:

  • The server has responded to a read request for a characteristic.
  • The server has responded to a read request for a descriptor.
  • The server has sent an updated value for a subscribed characteristic.

Whenever a value is received for a characteristic or descriptor, the value that the platform has cached for it is updated as well. You can read the cached value for a characteristic using CharacteristicCachedValue, or for a descriptor using DescriptorCachedValue.

Refer to the ReadValue and/or Subscribe methods for more information.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks BLE 2020 C++ Edition - Version 20.0 [Build 8158]