RkDevices class
A loaded rk_devices native library.
Nothing on this class waits, blocks, or touches a device. Every method is a pure function of its arguments: bytes in, bytes out. That is what makes И30 — "no device failure may block taking money" — structural rather than promised, because there is no wait here to be unbounded.
Constructors
- RkDevices.open({String? path})
-
Load the native library, or throw RkDevicesUnavailable.
factory
Properties
- bindingsForTesting → RkDevicesBindings
-
no setter
- drawerDefaultPulse → ({Duration off, Duration on})
-
The pulse this product has always sent: 64 ms on, 320 ms off.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- mdbBitTimeMicroseconds → int
-
One bit time at 9600 baud, in microseconds. Same caveat.
no setter
- mdbModeBit → int
-
The ninth-bit mask:
0x100in every word this package produces.no setter - mdbResponseWindow → Duration
-
The window a peripheral has to begin replying.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusCapacityForTesting → int
-
no setter
- version → String
-
The native crate's own version.
no setter
Methods
-
displayEncode(
{required DisplayModel model, required DisplayOp op, int line = 0, int column = 0, int brightness = 0, String text = ''}) → DisplayBytes - Build the bytes for one display operation.
-
displayGeometry(
DisplayModel model) → DisplayGeometry - Lines and columns, as fixed by the manufacturer.
-
drawerPulse(
{DrawerModel model = DrawerModel.escposKick, DrawerPin pin = DrawerPin.pin2, Duration? on, Duration? off}) → DrawerPulse - The kick pulse, as bytes. Never throws: the refusal is a value, because the caller of a drawer is usually mid-sale and has three things it might do rather than two.
-
drawerReporting(
DrawerModel model) → DrawerReporting - Whether anything can be learned about the drawer over the same wire.
-
mdbChecksum(
Uint8List data) → int - The eight-bit sum that closes an MDB block.
-
mdbCommandByte(
MdbAddress address, String command) → int - The command byte for a named command on a named peripheral.
-
mdbDecode(
Uint16List words) → MdbReply - Read one peripheral-to-master frame.
-
mdbEncode(
MdbAddress address, String command, [Uint8List? data]) → Uint16List - A master-to-peripheral frame as nine-bit words: bit 8 is the mode bit.
-
mdbEncodeRaw(
int command, [Uint8List? data]) → Uint16List - The same frame, from a command byte the caller supplies.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
provokePanicForTest(
) → String -
Deliberately panics inside the native library and returns the status
name it came back as. Always
'panic'. -
resolveWrite(
{required Wire wire, required int total, required int? accepted}) → WriteResume - Turn "the wire said this" into "you may do that".
-
scaleParse(
ScaleProtocol protocol, Uint8List data) → ScaleFrame - Read one line out of a scale's byte stream.
-
scaleTareRequest(
ScaleProtocol protocol) → Uint8List - The bytes that zero a scale's pan.
-
scaleWeightRequest(
ScaleProtocol protocol) → Uint8List - The bytes that ask a scale for its weight.
-
stabilizer(
{required Duration budget, int neededRepeats = 1}) → Stabilizer - Start a settling rule.
-
toString(
) → String -
A string representation of this object.
inherited
-
wireReportsPartialWrites(
Wire wire) → bool - Whether a transport can say how much of a buffer it accepted.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- lastLoadFailure → Object?
-
Why tryOpen returned
null, if it has.no setter
Static Methods
-
resetCache(
) → void - Forget a cached library or load failure. For tests.
-
tryOpen(
{String? path}) → RkDevices? -
The same, returning
nullinstead of throwing.
Constants
- supportedAbiVersion → const int
- The ABI generation this Dart binding was written against. A library reporting anything else is refused at load rather than called blind.