-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module to read and write from serial port #4
Open
m6keller
wants to merge
10
commits into
main
Choose a base branch
from
read-write-serial
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e1c7a3f
added dart_mavlink as submodule
m6keller 0428689
default flutter build changes for running on mac
m6keller 1afa666
keys added to DebugProfile.entitlements and Release.entitlements to a…
m6keller cd0ffcd
reading and writing to the same port works
m6keller 50817d2
removed unnecessary print lines
m6keller 1250bc4
removed dart_mavlink library
m6keller f2b0cf9
tab removed
m6keller b2fd953
removed unnecessary linux and mac files
m6keller c8e2e04
removed unnecessary file changes
m6keller a543e7c
reverted platform specific files back to main
m6keller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "flutter_app/dart_mavlink"] | ||
path = flutter_app/dart_mavlink | ||
url = [email protected]:nus/dart_mavlink.git |
Binary file not shown.
Binary file added
BIN
+17 Bytes
flutter_app/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added
BIN
+17 Bytes
flutter_app/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
flutter_app/android/.gradle/buildOutputCleanup/cache.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#Sun Jul 16 13:37:01 EDT 2023 | ||
gradle.version=7.4.2 |
Binary file not shown.
Empty file.
24 changes: 24 additions & 0 deletions
24
flutter_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.flutter.plugins; | ||
|
||
import androidx.annotation.Keep; | ||
import androidx.annotation.NonNull; | ||
import io.flutter.Log; | ||
|
||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
/** | ||
* Generated file. Do not edit. | ||
* This file is generated by the Flutter tool based on the | ||
* plugins that support the Android platform. | ||
*/ | ||
@Keep | ||
public final class GeneratedPluginRegistrant { | ||
private static final String TAG = "GeneratedPluginRegistrant"; | ||
public static void registerWith(@NonNull FlutterEngine flutterEngine) { | ||
try { | ||
flutterEngine.getPlugins().add(new org.sigrok.flutter_libserialport.FlutterLibserialportPlugin()); | ||
} catch(Exception e) { | ||
Log.e(TAG, "Error registering plugin flutter_libserialport, org.sigrok.flutter_libserialport.FlutterLibserialportPlugin", e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flutter.sdk=/opt/homebrew/Caskroom/flutter/3.10.2/flutter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This is a generated file; do not edit or check into version control. | ||
FLUTTER_ROOT=/opt/homebrew/Caskroom/flutter/3.10.2/flutter | ||
FLUTTER_APPLICATION_PATH=/Users/matthewkeller/WARG/IMACS-2/flutter_app | ||
COCOAPODS_PARALLEL_CODE_SIGN=true | ||
FLUTTER_TARGET=lib/main.dart | ||
FLUTTER_BUILD_DIR=build | ||
FLUTTER_BUILD_NAME=1.0.0 | ||
FLUTTER_BUILD_NUMBER=1 | ||
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 | ||
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7 | ||
DART_OBFUSCATION=false | ||
TRACK_WIDGET_CREATION=true | ||
TREE_SHAKE_ICONS=false | ||
PACKAGE_CONFIG=.dart_tool/package_config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
# This is a generated file; do not edit or check into version control. | ||
export "FLUTTER_ROOT=/opt/homebrew/Caskroom/flutter/3.10.2/flutter" | ||
export "FLUTTER_APPLICATION_PATH=/Users/matthewkeller/WARG/IMACS-2/flutter_app" | ||
export "COCOAPODS_PARALLEL_CODE_SIGN=true" | ||
export "FLUTTER_TARGET=lib/main.dart" | ||
export "FLUTTER_BUILD_DIR=build" | ||
export "FLUTTER_BUILD_NAME=1.0.0" | ||
export "FLUTTER_BUILD_NUMBER=1" | ||
export "DART_OBFUSCATION=false" | ||
export "TRACK_WIDGET_CREATION=true" | ||
export "TREE_SHAKE_ICONS=false" | ||
export "PACKAGE_CONFIG=.dart_tool/package_config.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// Generated file. Do not edit. | ||
// | ||
|
||
// clang-format off | ||
|
||
#ifndef GeneratedPluginRegistrant_h | ||
#define GeneratedPluginRegistrant_h | ||
|
||
#import <Flutter/Flutter.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface GeneratedPluginRegistrant : NSObject | ||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END | ||
#endif /* GeneratedPluginRegistrant_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Generated file. Do not edit. | ||
// | ||
|
||
// clang-format off | ||
|
||
#import "GeneratedPluginRegistrant.h" | ||
|
||
@implementation GeneratedPluginRegistrant | ||
|
||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry { | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import 'dart:typed_data'; | ||
import 'dart:async'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_libserialport/flutter_libserialport.dart'; | ||
|
||
class SerialComms { | ||
final SerialPortReader _reader; | ||
final SerialPort _port; | ||
StreamController<Uint8List> _dataStreamController = StreamController<Uint8List>(); | ||
Stream<Uint8List> get onData => _dataStreamController.stream; | ||
|
||
SerialComms(SerialPort port, {int? timeout}) | ||
: _port = port, | ||
_reader = SerialPortReader(port, timeout: timeout) { | ||
port.openReadWrite(); | ||
_reader.stream.listen((Uint8List data) { | ||
_dataStreamController.add(data); | ||
}, onError: (error) { | ||
// TODO | ||
}, onDone: () { | ||
_dataStreamController.close(); | ||
}); | ||
} | ||
|
||
void listen() { | ||
onData.listen((Uint8List data) { | ||
print('Received data: ${data}'); | ||
}); | ||
} | ||
|
||
void write(Uint8List data) { | ||
_port.write(data); | ||
} | ||
|
||
void close() { | ||
_reader.close(); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
flutter_app/linux/flutter/ephemeral/.plugin_symlinks/flutter_libserialport
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/Users/matthewkeller/.pub-cache/hosted/pub.dev/flutter_libserialport-0.3.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flutter_app.app |
1 change: 1 addition & 0 deletions
1
flutter_app/macos/Flutter/ephemeral/.symlinks/plugins/flutter_libserialport
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/Users/matthewkeller/.pub-cache/hosted/pub.dev/flutter_libserialport-0.3.0/ |
13 changes: 13 additions & 0 deletions
13
flutter_app/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This is a generated file; do not edit or check into version control. | ||
FLUTTER_ROOT=/opt/homebrew/Caskroom/flutter/3.10.2/flutter | ||
FLUTTER_APPLICATION_PATH=/Users/matthewkeller/WARG/IMACS-2/flutter_app | ||
COCOAPODS_PARALLEL_CODE_SIGN=true | ||
FLUTTER_TARGET=/Users/matthewkeller/WARG/IMACS-2/flutter_app/lib/main.dart | ||
FLUTTER_BUILD_DIR=build | ||
FLUTTER_BUILD_NAME=1.0.0 | ||
FLUTTER_BUILD_NUMBER=1 | ||
DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9jZGJlZGE3ODhhMjkzZmEyOTY2NWRjM2ZhM2Q2ZTYzYmQyMjFjYjBkLw== | ||
DART_OBFUSCATION=false | ||
TRACK_WIDGET_CREATION=true | ||
TREE_SHAKE_ICONS=false | ||
PACKAGE_CONFIG=/Users/matthewkeller/WARG/IMACS-2/flutter_app/.dart_tool/package_config.json |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Callback will call
parser.parse(data);
whereparser = MavlinkParser(dialect);
.