GoldenGateConnectionManager / com.fitbit.goldengate.bt.gatt.client.services / GattDatabaseValidator

GattDatabaseValidator

class GattDatabaseValidator

The class implements the Gatt database version validation

Constructors

<init>

GattDatabaseValidator(gattCharacteristicReaderProvider: (GattConnection) -> GattCharacteristicReader = { GattCharacteristicReader(it) }, gattCharacteristicWriterProvider: (GattConnection) -> GattCharacteristicWriter = { GattCharacteristicWriter(it) })

The class implements the Gatt database version validation

Functions

validate

fun validate(peer: BitGattPeer): Completable

To validate the GATT Database version, first read the payload of Ephemeral Pointer Characteristic from GattDatabaseConfirmationService The payload will contains the UUID of GATT Ephemeral Characteristic. Second, we write to Ephemeral GATT Characteristic UUID. If the write succeeds within timeout, tracker will not send us the service changed indication and complete the validation process.