openmodbus_dart 0.1.1
openmodbus_dart: ^0.1.1 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 {
List<String> jsonFileNameList = ["ascii-safe-system-example.json", "rtu-lights-example.json", "tcp-air-condition-example.json"];
String currentWorkingDirectory = Directory.current.path;
jsonFileNameList.forEach((jsonFileName) async {
print("FILE_NAME: $jsonFileName");
String jsonPath = "$currentWorkingDirectory/example/json/$jsonFileName";
OpenModbusLoader openModbusLoader = OpenModbusLoader();
OpenModbus openModbus = await openModbusLoader.loadFromFile(jsonPath);
print("title: ${openModbus.info.title}");
});
}