openmodbus_dart 0.2.0 copy "openmodbus_dart: ^0.2.0" to clipboard
openmodbus_dart: ^0.2.0 copied to clipboard

An OpenModbus JSON Spec Parser, fromJson and toJson

example/openmodbus_dart_example.dart

import 'package:openmodbus_dart/openmodbus_dart.dart';

import 'dart:io';

void main() async {
  String folder = "${Directory.current.path}${Platform.pathSeparator}example${Platform.pathSeparator}json";
  List<String> jsonFileNameList = ["ascii-safe-system-example.json", "rtu-lights-example.json", "tcp-air-condition-example.json"];

  jsonFileNameList.forEach((jsonFileName) async {
    print("FILE_NAME: $jsonFileName");
    String jsonPath = "$folder${Platform.pathSeparator}$jsonFileName";
    OpenModbusLoader openModbusLoader = OpenModbusLoader();
    OpenModbus openModbus = await openModbusLoader.loadFromFile(jsonPath);
    print("title: ${openModbus.info.title}");
  });
}
1
likes
130
points
61
downloads

Publisher

verified publisherlitevar.com

Weekly Downloads

An OpenModbus JSON Spec Parser, fromJson and toJson

Documentation

API reference

License

MIT (license)

Dependencies

json_annotation

More

Packages that depend on openmodbus_dart