mtrust_urp_types 6.3.0-3
mtrust_urp_types: ^6.3.0-3 copied to clipboard
Protobuf type definitions for the M-Trust URP protocol, shared by the M-Trust reader SDKs, device firmware and backend services.
example/README.md
mtrust_urp_types example #
Generated protobuf types for the M-Trust URP protocol. They are normally used
through a reader SDK such as mtrust_urp_core
rather than directly.
import 'package:mtrust_urp_types/wrapper.pb.dart';
import 'package:mtrust_urp_types/sec.pb.dart';
void main() {
// Address a command at an IMZ reader from a mobile host.
final target = UrpDeviceIdentifier(
deviceClass: UrpDeviceClass.urpReader,
deviceType: UrpDeviceType.urpImz,
);
// Build a device command and serialise it for the wire.
final command = UrpSecCommandWrapper(
deviceCommand: UrpSecDeviceCommand(command: UrpSecCommand.urpSecPrime),
);
final bytes = command.writeToBuffer();
// Parse a response coming back from the device.
final measurement = UrpSecSecureMeasurement.fromBuffer(bytes);
print(measurement.measurement.readerSn);
print(target.deviceType);
}