PeripheralSpecEventHandler
This is the interface of a peripheral event handler.
The implementation should respond to various events occurring on the mock peripheral, such as connection requests, read/write requests, etc.
For example, a mock Blinky device can handle requests to turn on an LED or send notifications when a button was clicked.
Each callback receives the MockPeripheral the event is for, so that the handler can simulate the behavior of the peripheral, e.g. call MockPeripheral.simulateDisconnection when it rejects a bonding request, without keeping a reference to the peripheral.
Functions
Called when a client requests bonding with the mock peripheral.
Called when the connection is lost.
Called when a connection request is made to the mock peripheral.
Emulates an Execute Write request to the characteristic.
Emulates a prepared write to a characteristic.
Emulates a prepared write to a characteristic descriptor.
A callback called when the client sends Read request to a characteristic.
A callback called when the client sends Read request to a characteristic descriptor.
Called when the peripheral is reset.
Called when a service discovery request is made to the mock peripheral.
A callback called when the client sends a Write Command (write without response) to a characteristic.
A callback called when the client sends a Write Request (write with response) to a characteristic.
A callback called when the client sends a Write Request (write with response) to a characteristic descriptor.