tiny_frame 1.0.1 copy "tiny_frame: ^1.0.1" to clipboard
tiny_frame: ^1.0.1 copied to clipboard

TinyFrame library port

example/example.dart

import 'dart:typed_data';

import 'package:tiny_frame/tiny_frame.dart';

void main() {
  const typeID = 1;
  // create a TinyFrame instance with a write function
  // TF_WriteImpl in C Library
  final tf = TinyFrame((Uint8List data) => print('write: $data'));
  // some optional settings
  tf.cksumType = 'xor';
  // generate a listener for the id 1
  tf.addTypeListener(typeID, (_, TF_Msg msg) => print('main: $msg'));
  // if no listener is found for the id, this listener will be called
  tf.addFallbackListener((_, TF_Msg msg) => print('fallback: $msg'));
  // send to slave on id 1
  tf.send(typeID, Uint8List.fromList('abcde'.codeUnits));
}
3
likes
125
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

TinyFrame library port

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

crclib

More

Packages that depend on tiny_frame