Initial commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
Extension Discovery Cache
|
||||||
|
=========================
|
||||||
|
|
||||||
|
This folder is used by `package:extension_discovery` to cache lists of
|
||||||
|
packages that contains extensions for other packages.
|
||||||
|
|
||||||
|
DO NOT USE THIS FOLDER
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
* Do not read (or rely) the contents of this folder.
|
||||||
|
* Do write to this folder.
|
||||||
|
|
||||||
|
If you're interested in the lists of extensions stored in this folder use the
|
||||||
|
API offered by package `extension_discovery` to get this information.
|
||||||
|
|
||||||
|
If this package doesn't work for your use-case, then don't try to read the
|
||||||
|
contents of this folder. It may change, and will not remain stable.
|
||||||
|
|
||||||
|
Use package `extension_discovery`
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
If you want to access information from this folder.
|
||||||
|
|
||||||
|
Feel free to delete this folder
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
Files in this folder act as a cache, and the cache is discarded if the files
|
||||||
|
are older than the modification time of `.dart_tool/package_config.json`.
|
||||||
|
|
||||||
|
Hence, it should never be necessary to clear this cache manually, if you find a
|
||||||
|
need to do please file a bug.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"version":2,"entries":[{"package":"knx_stack","rootUri":"../../knx_stack/","packageUri":"lib/"},{"package":"knx_stack_tpuart","rootUri":"../","packageUri":"lib/"}]}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
{
|
||||||
|
"configVersion": 2,
|
||||||
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "async",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/async-2.13.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "boolean_selector",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "characters",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/characters-1.4.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "clock",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/clock-1.1.2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "collection",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/collection-1.19.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dylib",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/dylib-0.3.3",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "2.12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fake_async",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/fake_async-1.3.3",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ffi",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/ffi-2.2.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter",
|
||||||
|
"rootUri": "file:///Users/tonylu/git/flutter/packages/flutter",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter_libserialport",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/flutter_libserialport-0.6.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "2.17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter_lints",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/flutter_lints-5.0.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter_test",
|
||||||
|
"rootUri": "file:///Users/tonylu/git/flutter/packages/flutter_test",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "knx_stack",
|
||||||
|
"rootUri": "../../knx_stack",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.9"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "leak_tracker",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/leak_tracker-11.0.2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "leak_tracker_flutter_testing",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.10",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "leak_tracker_testing",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "libserialport",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/libserialport-0.3.0+1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "2.17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lints",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/lints-5.1.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "matcher",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/matcher-0.12.17",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "material_color_utilities",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "2.17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "meta",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/meta-1.16.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "2.12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/path-1.9.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "platform",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/platform-3.1.6",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sky_engine",
|
||||||
|
"rootUri": "file:///Users/tonylu/git/flutter/bin/cache/pkg/sky_engine",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "source_span",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/source_span-1.10.2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stack_trace",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stream_channel",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string_scanner",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "term_glyph",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test_api",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/test_api-0.7.6",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vector_math",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/vector_math-2.2.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vm_service",
|
||||||
|
"rootUri": "file:///Users/tonylu/.pub-cache/hosted/pub.dev/vm_service-15.1.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "knx_stack_tpuart",
|
||||||
|
"rootUri": "../",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.9"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"generator": "pub",
|
||||||
|
"generatorVersion": "3.9.2",
|
||||||
|
"flutterRoot": "file:///Users/tonylu/git/flutter",
|
||||||
|
"flutterVersion": "3.35.4",
|
||||||
|
"pubCache": "file:///Users/tonylu/.pub-cache"
|
||||||
|
}
|
||||||
@@ -0,0 +1,266 @@
|
|||||||
|
{
|
||||||
|
"roots": [
|
||||||
|
"knx_stack_tpuart"
|
||||||
|
],
|
||||||
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "knx_stack_tpuart",
|
||||||
|
"version": "0.1.0-dev.1",
|
||||||
|
"dependencies": [
|
||||||
|
"flutter",
|
||||||
|
"flutter_libserialport",
|
||||||
|
"knx_stack"
|
||||||
|
],
|
||||||
|
"devDependencies": [
|
||||||
|
"flutter_lints",
|
||||||
|
"flutter_test"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "knx_stack",
|
||||||
|
"version": "0.1.0-dev.1",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter_test",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"dependencies": [
|
||||||
|
"clock",
|
||||||
|
"collection",
|
||||||
|
"fake_async",
|
||||||
|
"flutter",
|
||||||
|
"leak_tracker_flutter_testing",
|
||||||
|
"matcher",
|
||||||
|
"meta",
|
||||||
|
"path",
|
||||||
|
"stack_trace",
|
||||||
|
"stream_channel",
|
||||||
|
"test_api",
|
||||||
|
"vector_math"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter_lints",
|
||||||
|
"version": "5.0.0",
|
||||||
|
"dependencies": [
|
||||||
|
"lints"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter_libserialport",
|
||||||
|
"version": "0.6.0",
|
||||||
|
"dependencies": [
|
||||||
|
"flutter",
|
||||||
|
"libserialport"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"dependencies": [
|
||||||
|
"characters",
|
||||||
|
"collection",
|
||||||
|
"material_color_utilities",
|
||||||
|
"meta",
|
||||||
|
"sky_engine",
|
||||||
|
"vector_math"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stream_channel",
|
||||||
|
"version": "2.1.4",
|
||||||
|
"dependencies": [
|
||||||
|
"async"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "meta",
|
||||||
|
"version": "1.16.0",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "collection",
|
||||||
|
"version": "1.19.1",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "leak_tracker_flutter_testing",
|
||||||
|
"version": "3.0.10",
|
||||||
|
"dependencies": [
|
||||||
|
"flutter",
|
||||||
|
"leak_tracker",
|
||||||
|
"leak_tracker_testing",
|
||||||
|
"matcher",
|
||||||
|
"meta"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vector_math",
|
||||||
|
"version": "2.2.0",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stack_trace",
|
||||||
|
"version": "1.12.1",
|
||||||
|
"dependencies": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "clock",
|
||||||
|
"version": "1.1.2",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fake_async",
|
||||||
|
"version": "1.3.3",
|
||||||
|
"dependencies": [
|
||||||
|
"clock",
|
||||||
|
"collection"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"version": "1.9.1",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "matcher",
|
||||||
|
"version": "0.12.17",
|
||||||
|
"dependencies": [
|
||||||
|
"async",
|
||||||
|
"meta",
|
||||||
|
"stack_trace",
|
||||||
|
"term_glyph",
|
||||||
|
"test_api"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test_api",
|
||||||
|
"version": "0.7.6",
|
||||||
|
"dependencies": [
|
||||||
|
"async",
|
||||||
|
"boolean_selector",
|
||||||
|
"collection",
|
||||||
|
"meta",
|
||||||
|
"source_span",
|
||||||
|
"stack_trace",
|
||||||
|
"stream_channel",
|
||||||
|
"string_scanner",
|
||||||
|
"term_glyph"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lints",
|
||||||
|
"version": "5.1.1",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "libserialport",
|
||||||
|
"version": "0.3.0+1",
|
||||||
|
"dependencies": [
|
||||||
|
"dylib",
|
||||||
|
"ffi"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sky_engine",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "material_color_utilities",
|
||||||
|
"version": "0.11.1",
|
||||||
|
"dependencies": [
|
||||||
|
"collection"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "characters",
|
||||||
|
"version": "1.4.0",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "async",
|
||||||
|
"version": "2.13.1",
|
||||||
|
"dependencies": [
|
||||||
|
"collection",
|
||||||
|
"meta"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "leak_tracker_testing",
|
||||||
|
"version": "3.0.2",
|
||||||
|
"dependencies": [
|
||||||
|
"leak_tracker",
|
||||||
|
"matcher",
|
||||||
|
"meta"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "leak_tracker",
|
||||||
|
"version": "11.0.2",
|
||||||
|
"dependencies": [
|
||||||
|
"clock",
|
||||||
|
"collection",
|
||||||
|
"meta",
|
||||||
|
"path",
|
||||||
|
"vm_service"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "term_glyph",
|
||||||
|
"version": "1.2.2",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string_scanner",
|
||||||
|
"version": "1.4.1",
|
||||||
|
"dependencies": [
|
||||||
|
"source_span"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "source_span",
|
||||||
|
"version": "1.10.2",
|
||||||
|
"dependencies": [
|
||||||
|
"collection",
|
||||||
|
"path",
|
||||||
|
"term_glyph"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "boolean_selector",
|
||||||
|
"version": "2.1.2",
|
||||||
|
"dependencies": [
|
||||||
|
"source_span",
|
||||||
|
"string_scanner"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ffi",
|
||||||
|
"version": "2.2.0",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dylib",
|
||||||
|
"version": "0.3.3",
|
||||||
|
"dependencies": [
|
||||||
|
"meta",
|
||||||
|
"path",
|
||||||
|
"platform"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vm_service",
|
||||||
|
"version": "15.1.0",
|
||||||
|
"dependencies": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "platform",
|
||||||
|
"version": "3.1.6",
|
||||||
|
"dependencies": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configVersion": 1
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
3.35.4
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[],"android":[{"name":"flutter_libserialport","path":"/Users/tonylu/.pub-cache/hosted/pub.dev/flutter_libserialport-0.6.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"flutter_libserialport","path":"/Users/tonylu/.pub-cache/hosted/pub.dev/flutter_libserialport-0.6.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"flutter_libserialport","path":"/Users/tonylu/.pub-cache/hosted/pub.dev/flutter_libserialport-0.6.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"flutter_libserialport","path":"/Users/tonylu/.pub-cache/hosted/pub.dev/flutter_libserialport-0.6.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"flutter_libserialport","dependencies":[]}],"date_created":"2026-04-23 15:46:15.584788","version":"3.35.4","swift_package_manager_enabled":{"ios":false,"macos":false}}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 0.1.0-dev.1
|
||||||
|
|
||||||
|
- Create the initial TPUART adapter package skeleton.
|
||||||
|
- Add runtime compatibility reporting for TPUART transport usage.
|
||||||
|
- Add a raw serial transport implementation backed by `flutter_libserialport` on `dart:io` runtimes.
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# knx_stack_tpuart
|
||||||
|
|
||||||
|
`knx_stack_tpuart` is the Flutter adapter that bridges `knx_stack` to TPUART serial hardware.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
This is the initial implementation slice. The package already exposes runtime compatibility reporting and a raw serial-byte transport. The TPUART state machine, reset flow, ACK handling, and cEMI adaptation will be layered on top of this transport in later slices.
|
||||||
|
|
||||||
|
## Platform compatibility
|
||||||
|
|
||||||
|
- macOS: supported.
|
||||||
|
- Linux: supported.
|
||||||
|
- Windows: supported.
|
||||||
|
- Android: conditional. The adapter package is present, but Android-specific validation still needs real-device coverage.
|
||||||
|
- iOS: unsupported.
|
||||||
|
- Web: unsupported.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```dart
|
||||||
|
import 'package:knx_stack_tpuart/knx_stack_tpuart.dart';
|
||||||
|
|
||||||
|
Future<void> main() async {
|
||||||
|
final support = KnxTpUartSupport.current();
|
||||||
|
final serialSupport = support.supportFor(KnxFeature.tpuartTransport);
|
||||||
|
|
||||||
|
if (!serialSupport.isSupported) {
|
||||||
|
throw UnsupportedError(serialSupport.summary);
|
||||||
|
}
|
||||||
|
|
||||||
|
final transport = KnxTpUartTransport(portName: '/dev/ttyUSB0');
|
||||||
|
await transport.connect();
|
||||||
|
await transport.disconnect();
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
include: package:flutter_lints/flutter.yaml
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export 'src/knx_tpuart_support.dart';
|
||||||
|
export 'src/knx_tpuart_transport.dart';
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import 'package:knx_stack/knx_stack.dart';
|
||||||
|
|
||||||
|
final class KnxTpUartSupport {
|
||||||
|
const KnxTpUartSupport._();
|
||||||
|
|
||||||
|
static KnxRuntimeSupport current({KnxPlatform? platform}) {
|
||||||
|
final resolvedPlatform = platform ?? currentKnxPlatform();
|
||||||
|
|
||||||
|
final transportSupport = switch (resolvedPlatform) {
|
||||||
|
KnxPlatform.macos ||
|
||||||
|
KnxPlatform.linux ||
|
||||||
|
KnxPlatform.windows => KnxFeatureSupport.supported(
|
||||||
|
feature: KnxFeature.tpuartTransport,
|
||||||
|
platform: resolvedPlatform,
|
||||||
|
reason: 'The TPUART adapter uses flutter_libserialport on this platform.',
|
||||||
|
),
|
||||||
|
KnxPlatform.android => KnxFeatureSupport.conditional(
|
||||||
|
feature: KnxFeature.tpuartTransport,
|
||||||
|
platform: resolvedPlatform,
|
||||||
|
reason: 'Android support needs real-device validation for serial permissions and lifecycle edge cases.',
|
||||||
|
),
|
||||||
|
KnxPlatform.ios => KnxFeatureSupport.unsupported(
|
||||||
|
feature: KnxFeature.tpuartTransport,
|
||||||
|
platform: resolvedPlatform,
|
||||||
|
reason: 'No TPUART serial implementation is available on iOS.',
|
||||||
|
),
|
||||||
|
KnxPlatform.web => KnxFeatureSupport.unsupported(
|
||||||
|
feature: KnxFeature.tpuartTransport,
|
||||||
|
platform: resolvedPlatform,
|
||||||
|
reason: 'Web runtimes do not expose dart:io serial APIs to this adapter.',
|
||||||
|
),
|
||||||
|
KnxPlatform.fuchsia ||
|
||||||
|
KnxPlatform.unknown => KnxFeatureSupport.unsupported(
|
||||||
|
feature: KnxFeature.tpuartTransport,
|
||||||
|
platform: resolvedPlatform,
|
||||||
|
reason: 'No TPUART adapter is implemented for this runtime.',
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
return KnxRuntimeSupport.base(platform: resolvedPlatform).merge(
|
||||||
|
KnxRuntimeSupport(platform: resolvedPlatform, features: [transportSupport]),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export 'knx_tpuart_transport_stub.dart'
|
||||||
|
if (dart.library.io) 'knx_tpuart_transport_io.dart';
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:flutter_libserialport/flutter_libserialport.dart';
|
||||||
|
import 'package:knx_stack/knx_stack.dart';
|
||||||
|
|
||||||
|
import 'knx_tpuart_support.dart';
|
||||||
|
|
||||||
|
final class KnxTpUartTransport implements KnxTransport {
|
||||||
|
KnxTpUartTransport({required this.portName, this.baudRate = 19200, this.readTimeout = const Duration(milliseconds: 50)});
|
||||||
|
|
||||||
|
final String portName;
|
||||||
|
final int baudRate;
|
||||||
|
final Duration readTimeout;
|
||||||
|
|
||||||
|
final StreamController<Uint8List> _frames = StreamController<Uint8List>.broadcast();
|
||||||
|
|
||||||
|
SerialPort? _port;
|
||||||
|
StreamSubscription<Uint8List>? _subscription;
|
||||||
|
bool _isConnected = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get transportId => 'knx_tpuart';
|
||||||
|
|
||||||
|
@override
|
||||||
|
KnxFeature get feature => KnxFeature.tpuartTransport;
|
||||||
|
|
||||||
|
@override
|
||||||
|
KnxFeatureSupport get support => KnxTpUartSupport.current().supportFor(feature);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get isConnected => _isConnected;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Stream<Uint8List> get inboundFrames => _frames.stream;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> connect() async {
|
||||||
|
support.requireSupported('connect');
|
||||||
|
if (_isConnected) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final serialPort = SerialPort(portName);
|
||||||
|
if (!serialPort.openReadWrite()) {
|
||||||
|
throw StateError(
|
||||||
|
'Failed to open serial port $portName: ${SerialPort.lastError?.message ?? 'unknown error'}.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final config = SerialPortConfig()
|
||||||
|
..baudRate = baudRate
|
||||||
|
..bits = 8
|
||||||
|
..parity = SerialPortParity.none
|
||||||
|
..stopBits = 1
|
||||||
|
..setFlowControl(SerialPortFlowControl.none);
|
||||||
|
serialPort.config = config;
|
||||||
|
|
||||||
|
final reader = SerialPortReader(serialPort, timeout: readTimeout.inMilliseconds);
|
||||||
|
_subscription = reader.stream.listen((chunk) {
|
||||||
|
_frames.add(Uint8List.fromList(chunk));
|
||||||
|
});
|
||||||
|
_port = serialPort;
|
||||||
|
_isConnected = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> disconnect() async {
|
||||||
|
await _subscription?.cancel();
|
||||||
|
_subscription = null;
|
||||||
|
_isConnected = false;
|
||||||
|
|
||||||
|
final port = _port;
|
||||||
|
_port = null;
|
||||||
|
if (port != null && port.isOpen) {
|
||||||
|
port.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> send(Uint8List frame) async {
|
||||||
|
support.requireSupported('send');
|
||||||
|
final port = _port;
|
||||||
|
if (port == null || !port.isOpen) {
|
||||||
|
throw StateError('Transport is not connected.');
|
||||||
|
}
|
||||||
|
|
||||||
|
final bytesWritten = port.write(frame);
|
||||||
|
if (bytesWritten != frame.length) {
|
||||||
|
throw StateError('Short serial write: expected ${frame.length}, wrote $bytesWritten.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:knx_stack/knx_stack.dart';
|
||||||
|
|
||||||
|
import 'knx_tpuart_support.dart';
|
||||||
|
|
||||||
|
final class KnxTpUartTransport implements KnxTransport {
|
||||||
|
KnxTpUartTransport({required this.portName, this.baudRate = 19200});
|
||||||
|
|
||||||
|
final String portName;
|
||||||
|
final int baudRate;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get transportId => 'knx_tpuart';
|
||||||
|
|
||||||
|
@override
|
||||||
|
KnxFeature get feature => KnxFeature.tpuartTransport;
|
||||||
|
|
||||||
|
@override
|
||||||
|
KnxFeatureSupport get support => KnxTpUartSupport.current().supportFor(feature);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get isConnected => false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Stream<Uint8List> get inboundFrames => const Stream.empty();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> connect() async => support.requireSupported('connect');
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> disconnect() async {}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> send(Uint8List frame) async => support.requireSupported('send');
|
||||||
|
}
|
||||||
+252
@@ -0,0 +1,252 @@
|
|||||||
|
# Generated by pub
|
||||||
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
|
packages:
|
||||||
|
async:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: async
|
||||||
|
sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.13.1"
|
||||||
|
boolean_selector:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: boolean_selector
|
||||||
|
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
|
characters:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: characters
|
||||||
|
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.4.0"
|
||||||
|
clock:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: clock
|
||||||
|
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.2"
|
||||||
|
collection:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: collection
|
||||||
|
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.19.1"
|
||||||
|
dylib:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: dylib
|
||||||
|
sha256: bf609b3eb6492a3309b3d1dbe8f83a4031de5535dd7686be33487051cc760bb0
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.3"
|
||||||
|
fake_async:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fake_async
|
||||||
|
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.3"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
|
flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
flutter_libserialport:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_libserialport
|
||||||
|
sha256: f24b5fe6f1821d1c1b3bf2be737ca53f6b0ae78657032a790aa00abb810c8759
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.6.0"
|
||||||
|
flutter_lints:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: flutter_lints
|
||||||
|
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.0.0"
|
||||||
|
flutter_test:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
knx_stack:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
path: "../knx_stack"
|
||||||
|
relative: true
|
||||||
|
source: path
|
||||||
|
version: "0.1.0-dev.1"
|
||||||
|
leak_tracker:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker
|
||||||
|
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "11.0.2"
|
||||||
|
leak_tracker_flutter_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_flutter_testing
|
||||||
|
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.10"
|
||||||
|
leak_tracker_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_testing
|
||||||
|
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.2"
|
||||||
|
libserialport:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: libserialport
|
||||||
|
sha256: "392e1592def65282429832ec66fa25e9e163d3b37716b97691482e2406720727"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.0+1"
|
||||||
|
lints:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: lints
|
||||||
|
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.1.1"
|
||||||
|
matcher:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: matcher
|
||||||
|
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.12.17"
|
||||||
|
material_color_utilities:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: material_color_utilities
|
||||||
|
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.11.1"
|
||||||
|
meta:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: meta
|
||||||
|
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.16.0"
|
||||||
|
path:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path
|
||||||
|
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.9.1"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.6"
|
||||||
|
sky_engine:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
source_span:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: source_span
|
||||||
|
sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.10.2"
|
||||||
|
stack_trace:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stack_trace
|
||||||
|
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.12.1"
|
||||||
|
stream_channel:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stream_channel
|
||||||
|
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.4"
|
||||||
|
string_scanner:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: string_scanner
|
||||||
|
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.4.1"
|
||||||
|
term_glyph:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: term_glyph
|
||||||
|
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.2"
|
||||||
|
test_api:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: test_api
|
||||||
|
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.7.6"
|
||||||
|
vector_math:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_math
|
||||||
|
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
|
vm_service:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vm_service
|
||||||
|
sha256: "046d3928e16fa4dc46e8350415661755ab759d9fc97fc21b5ab295f71e4f0499"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "15.1.0"
|
||||||
|
sdks:
|
||||||
|
dart: ">=3.9.2 <4.0.0"
|
||||||
|
flutter: ">=3.18.0-18.0.pre.54"
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
name: knx_stack_tpuart
|
||||||
|
description: "Flutter adapter that connects knx_stack to TPUART serial hardware through flutter_libserialport."
|
||||||
|
version: 0.1.0-dev.1
|
||||||
|
homepage: https://github.com/tonylu00/DALI-Toolkit
|
||||||
|
repository: https://github.com/tonylu00/DALI-Toolkit
|
||||||
|
issue_tracker: https://github.com/tonylu00/DALI-Toolkit/issues
|
||||||
|
topics:
|
||||||
|
- knx
|
||||||
|
- serial
|
||||||
|
- tpuart
|
||||||
|
|
||||||
|
environment:
|
||||||
|
sdk: ^3.9.2
|
||||||
|
flutter: '>=3.3.0'
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
flutter:
|
||||||
|
sdk: flutter
|
||||||
|
flutter_libserialport: ^0.6.0
|
||||||
|
knx_stack:
|
||||||
|
^0.1.0-dev.1
|
||||||
|
|
||||||
|
dependency_overrides:
|
||||||
|
knx_stack:
|
||||||
|
path: ../knx_stack
|
||||||
|
|
||||||
|
dev_dependencies:
|
||||||
|
flutter_lints: ^5.0.0
|
||||||
|
flutter_test:
|
||||||
|
sdk: flutter
|
||||||
Reference in New Issue
Block a user