onEvent method
Called when an event is received by the FSM
Implementation
@override
Future<bool> onEvent(
{required FsmEvent event, required FsmOwner owner}) async {
BleDeviceOwner deviceOwner = owner as BleDeviceOwner;
debugPrintSynchronously("OnEvent: BleDeviceReconnectingState ${deviceOwner.device.getId()}- Event $event");
if (event is BleDeviceConnectionStateChangedEvent) {
if (event.newState == BleConnectionState.connected) {
// Transition to the discovery state.
//await owner
owner
.getFsm()
?.changeState(nextState: BleDiscoverServicesState());
}
return true;
}
return false;
}