The EVVA Flutter Plugin is a collection of tools to work with electronical EVVA access components. It allows for scanning and connecting via BLE.
- BLE Scanner for EVVA components in range
- Localize EVVA components encountered by a scan
- Disengage EVVA components encountered by a scan
- Read / Write data via BLE
- Flutter >=3.3.0
- Java 17+ (Android)
- Android SDK (Android)
- Android 10+ (API level 29) (Android)
- Xcode 15.4 (iOS)
- iOS 15.0+ (iOS)
flutter pub add abrevva
Execute pod install
inside of your projects ios/ folder.
Perform a gradle sync.
To start off first import the abrevva
Package
import 'package:abrevva/abrevva.dart';
async function scanForBleDevices(androidNeverForLocation: Boolean = true, timeout: Number) {
await AbrevvaBle.initialize(androidNeverForLocation);
AbrevvaBle.startScan(
(scanResult: ScanResult) => {
print("Discovered Device: ${scanResult.bleDevice.deviceId}");
},
(success: bool) => {
print("onScanStart status=${success}");
},
(success: bool) => {
print("onScanStop status=${success}");
},
null, // macFilter
false, // allowDuplicates
10_000 // timeout
);
}
Get the EVVA advertisement data from a scanned EVVA component.
final ad = device.advertisementData;
print(ad?.rssi);
print(ad?.isConnectable);
final md = ad?.manufacturerData;
print(md.batteryStatus);
print(md.isOnline);
print(md.officeModeEnabled);
print(md.officeModeActive);
// ...
There are several properties that can be accessed from the advertisement.
class BleDeviceAdvertisementData {
int? rssi;
bool? isConnectable;
BleDeviceManufacturerData? manufacturerData;
Map<String, dynamic>? rawData;
}
class BleDeviceManufacturerData {
int? companyIdentifier;
int? version;
ComponentType? componentType;
int? mainFirmwareVersionMajor;
int? mainFirmwareVersionMinor;
int? mainFirmwareVersionPatch;
int? componentHAL;
BatteryStatus? batteryStatus;
bool? mainConstructionMode;
bool? subConstructionMode;
bool? isOnline;
bool? officeModeEnabled;
bool? twoFactorRequired;
bool? officeModeActive;
String? identifier;
int? subFirmwareVersionMajor;
int? subFirmwareVersionMinor;
int? subFirmwareVersionPatch;
String? subComponentIdentifier;
}
With the signalize method you can localize EVVA components. On a successful signalization the component will emit a melody indicating its location.
final success = await AbrevvaBle.signalize('deviceId');
For the component disengage you have to provide access credentials to the EVVA component. Those are generally acquired in the form of access media metadata from the Xesar software.
final status = await AbrevvaBle.disengage(
'deviceId',
'mobileId',
'mobileDeviceKey',
'mobileGroupId',
'mobileAccessData',
false,
);
There are several access status types upon attempting the component disengage.
enum DisengageStatusType {
/// Component
authorized,
authorizedPermanentDisengage,
authorizedPermanentEngage,
authorizedBatteryLow,
authorizedOffline,
unauthorized,
unauthorizedOffline,
signalLocalization,
mediumDefectOnline,
mediumBlacklisted,
error,
/// Interface
unableToConnect,
unableToSetNotifications,
unableToReadChallenge,
unableToWriteMDF,
accessCipherError,
bleAdapterDisabled,
unknownDevice,
unknownStatusCode,
timeout,
}