Discovered Event

Fired when the class discovers a service, characteristic, or descriptor.

Syntax

ANSI (Cross Platform)
virtual int FireDiscovered(BLEClientDiscoveredEventParams *e);
typedef struct {
int GattType;
const char *ServiceId;
const char *CharacteristicId;
const char *DescriptorId;
const char *Uuid;
const char *Description; int reserved; } BLEClientDiscoveredEventParams; Unicode (Windows) virtual INT FireDiscovered(BLEClientDiscoveredEventParams *e);
typedef struct {
INT GattType;
LPCWSTR ServiceId;
LPCWSTR CharacteristicId;
LPCWSTR DescriptorId;
LPCWSTR Uuid;
LPCWSTR Description; INT reserved; } BLEClientDiscoveredEventParams;
#define EID_BLECLIENT_DISCOVERED 4

virtual INT IPWORKSBLE_CALL FireDiscovered(INT &iGattType, LPSTR &lpszServiceId, LPSTR &lpszCharacteristicId, LPSTR &lpszDescriptorId, LPSTR &lpszUuid, LPSTR &lpszDescription);

Remarks

This event is fired during any discovery process to indicate that the class has discovered a service, characteristic, or descriptor. Discovery processes take place whenever Discover, DiscoverServices, DiscoverCharacteristics, or DiscoverDescriptors is called.

GattType indicates what type of GATT object was discovered:

  • 0 - Service
  • 1 - Characteristic
  • 2 - Descriptor

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

When a service is discovered:

  • ServiceId is the Id of the newly discovered service.
  • CharacteristicId is empty.
  • DescriptorId is empty.

When a characteristic is discovered:

  • ServiceId is the Id of the previously discovered service which owns the newly discovered characteristic.
  • CharacteristicId is the Id of the newly discovered characteristic.
  • DescriptorId is empty.

When a descriptor is discovered:

  • ServiceId is the Id of the previously discovered service which owns the previously discovered characteristic.
  • CharacteristicId is the Id of the previously discovered characteristic which owns the newly discovered descriptor.
  • DescriptorId is the Id of the newly discovered descriptor.

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