mtrust_urp_core 9.1.0-dev.20 copy "mtrust_urp_core: ^9.1.0-dev.20" to clipboard
mtrust_urp_core: ^9.1.0-dev.20 copied to clipboard

Core of the M-Trust URP SDK: connection strategy abstraction, command framing, device commands and firmware transfer for M-Trust readers.

example/README.md

URP core example #

Discover and connect to a reader over any transport.

import 'package:mtrust_urp_core/mtrust_urp_core.dart';
import 'package:mtrust_urp_usb_strategy/mtrust_urp_usb_strategy.dart';
import 'package:mtrust_urp_ble_strategy/mtrust_urp_ble_strategy.dart';

Future<void> main() async {
  // Scan USB and Bluetooth at once; connect over whichever finds the reader.
  final strategy = CompositeConnectionStrategy([
    UrpUsbStrategy(),
    UrpBleStrategy(),
  ]);

  await for (final device in strategy.findDevices({UrpDeviceType.urpImz})) {
    print('${device.name} over ${device.transportName}');
  }

  final connected = await strategy.findAndConnectDevice(
    readerTypes: {UrpDeviceType.urpImz},
  );

  if (connected) {
    // isWired distinguishes a cabled reader, which is unambiguously the one
    // the user plugged in, from a wireless one that could be any nearby unit.
    print('connected over ${strategy.activeTransportName}, wired=${strategy.isWired}');
    await strategy.disconnectDevice();
  }
}
0
likes
140
points
319
downloads

Documentation

Documentation
API reference

Publisher

verified publishermtrust.io

Weekly Downloads

Core of the M-Trust URP SDK: connection strategy abstraction, command framing, device commands and firmware transfer for M-Trust readers.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

basic_utils, crypto, flutter, http, logger, mtrust_urp_types

More

Packages that depend on mtrust_urp_core