diff --git a/CHANGELOG.md b/CHANGELOG.md index f541e6f..968cf6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.0 + +* Upgrade to Dart 2.17, Flutter 3.0, libserialport 0.3 + ## 0.2.3 * Fix linux builds for newer kernels (thanks @sitic) diff --git a/android/.gitignore b/android/.gitignore index c6cbe56..2665975 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -5,4 +5,4 @@ /.idea/libraries .DS_Store /build -/captures +/captures \ No newline at end of file diff --git a/android/libserialport/config.h b/android/libserialport/config.h index 06fca48..bfa7b2d 100644 --- a/android/libserialport/config.h +++ b/android/libserialport/config.h @@ -54,7 +54,7 @@ /* #undef HAVE_STRUCT_TERMIOS_C_OSPEED */ /* Define to 1 if the system has the type `struct termiox'. */ -#define HAVE_STRUCT_TERMIOX 1 +#undef HAVE_STRUCT_TERMIOX /* sys/file.h is available. */ #define HAVE_SYS_FILE_H 1 diff --git a/example/.gitignore b/example/.gitignore index 9aa4928..7546425 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -42,4 +42,4 @@ lib/generated_plugin_registrant.dart app.*.symbols # Obfuscation related -app.*.map.json +app.*.map.json \ No newline at end of file diff --git a/example/.metadata b/example/.metadata index 11d0b7e..3585464 100644 --- a/example/.metadata +++ b/example/.metadata @@ -7,4 +7,4 @@ version: revision: 707aa49e42db746a8f4528e4700fb9017c5969d8 channel: master -project_type: app +project_type: app \ No newline at end of file diff --git a/example/android/.gitignore b/example/android/.gitignore index 0a741cb..cf8155c 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -8,4 +8,4 @@ GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties +key.properties \ No newline at end of file diff --git a/example/linux/.gitignore b/example/linux/.gitignore index d3896c9..c9f4e6e 100644 --- a/example/linux/.gitignore +++ b/example/linux/.gitignore @@ -1 +1 @@ -flutter/ephemeral +flutter/ephemeral \ No newline at end of file diff --git a/example/macos/.gitignore b/example/macos/.gitignore index d2fd377..fc5516e 100644 --- a/example/macos/.gitignore +++ b/example/macos/.gitignore @@ -3,4 +3,4 @@ **/Pods/ # Xcode-related -**/xcuserdata/ +**/xcuserdata/ \ No newline at end of file diff --git a/example/macos/Podfile b/example/macos/Podfile index dade8df..049abe2 100644 --- a/example/macos/Podfile +++ b/example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index e2e92d8..054efd0 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -203,7 +203,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = "The Flutter Authors"; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -256,6 +256,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -407,7 +408,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -490,7 +491,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -537,7 +538,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 62019c5..7503908 100644 --- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ =2.12.0 <3.0.0' - flutter: '>=1.20.0' + sdk: ">=2.17.0 <4.0.0" + flutter: ">=3.0.0" dependencies: flutter: sdk: flutter - libserialport: ^0.2.0+3 + libserialport: ^0.3.0 dev_dependencies: flutter_test: diff --git a/third_party/libserialport/README b/third_party/libserialport/README index b076d0c..817dff7 100644 --- a/third_party/libserialport/README +++ b/third_party/libserialport/README @@ -83,7 +83,7 @@ Mailing list IRC === -You can find the developers in the #sigrok IRC channel on Freenode. +You can find the developers in the #sigrok IRC channel on Libera.Chat. Website ======= diff --git a/third_party/libserialport/configure.ac b/third_party/libserialport/configure.ac index b1af16f..a26b851 100644 --- a/third_party/libserialport/configure.ac +++ b/third_party/libserialport/configure.ac @@ -112,7 +112,7 @@ AC_SYS_LARGEFILE AC_TYPE_SIZE_T # Check for specific termios structures. -AC_CHECK_TYPES([struct termios2, struct termiox],,, +AC_CHECK_TYPES([struct termios2],,, [[#include ]]) AC_CHECK_MEMBERS([struct termios.c_ispeed, struct termios.c_ospeed, struct termios2.c_ispeed, struct termios2.c_ospeed],,, diff --git a/third_party/libserialport/libserialport_internal.h b/third_party/libserialport/libserialport_internal.h index ecf8fe9..f1d0d85 100644 --- a/third_party/libserialport/libserialport_internal.h +++ b/third_party/libserialport/libserialport_internal.h @@ -93,6 +93,9 @@ #include #include #include +#if MAC_OS_X_VERSION_MAX_ALLOWED < 120000 /* Before macOS 12 */ +#define kIOMainPortDefault kIOMasterPortDefault +#endif #endif #ifdef __linux__ #include diff --git a/third_party/libserialport/macosx.c b/third_party/libserialport/macosx.c index a0df84e..0d22bb6 100644 --- a/third_party/libserialport/macosx.c +++ b/third_party/libserialport/macosx.c @@ -42,7 +42,7 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port) if (!(classes = IOServiceMatching(kIOSerialBSDServiceValue))) RETURN_FAIL("IOServiceMatching() failed"); - if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes, + if (IOServiceGetMatchingServices(kIOMainPortDefault, classes, &iter) != KERN_SUCCESS) RETURN_FAIL("IOServiceGetMatchingServices() failed"); @@ -210,7 +210,7 @@ SP_PRIV enum sp_return list_ports(struct sp_port ***list) } DEBUG("Getting matching services"); - if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes, + if (IOServiceGetMatchingServices(kIOMainPortDefault, classes, &iter) != KERN_SUCCESS) { SET_FAIL(ret, "IOServiceGetMatchingServices() failed"); goto out_done; diff --git a/third_party/libserialport/serialport.c b/third_party/libserialport/serialport.c index 1daba1c..1b5a95e 100644 --- a/third_party/libserialport/serialport.c +++ b/third_party/libserialport/serialport.c @@ -590,6 +590,15 @@ SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags) RETURN_CODEVAL(ret); } + /* + * Assume a default baudrate if the OS does not provide one. + * Cannot assign -1 here since Windows holds the baudrate in + * the DCB and does not configure the rate individually. + */ + if (config.baudrate == 0) { + config.baudrate = 9600; + } + /* Set sane port settings. */ #ifdef _WIN32 data.dcb.fBinary = TRUE; @@ -633,7 +642,8 @@ SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags) data.term.c_cc[VTIME] = 0; /* Ignore modem status lines; enable receiver; leave control lines alone on close. */ - data.term.c_cflag |= (CLOCAL | CREAD | HUPCL); + data.term.c_cflag |= (CLOCAL | CREAD); + data.term.c_cflag &= ~(HUPCL); #endif #ifdef _WIN32 @@ -876,7 +886,7 @@ SP_API enum sp_return sp_blocking_write(struct sp_port *port, const void *buf, unsigned char *ptr = (unsigned char *) buf; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms); @@ -1081,7 +1091,7 @@ SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf, unsigned char *ptr = (unsigned char *) buf; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms); @@ -1204,7 +1214,7 @@ SP_API enum sp_return sp_blocking_read_next(struct sp_port *port, void *buf, size_t bytes_read = 0; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms); diff --git a/windows/.gitignore b/windows/.gitignore index b3eb2be..29d8921 100644 --- a/windows/.gitignore +++ b/windows/.gitignore @@ -14,4 +14,4 @@ x86/ # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ +!*.[Cc]ache/ \ No newline at end of file