Skip to content

Commit f5ebeab

Browse files
committed
Merge remote-tracking branch 'upstream/main'
# Conflicts: # CHANGELOG.md # pubspec.yaml
2 parents 5e0a8d0 + d9f326d commit f5ebeab

File tree

10 files changed

+38
-19
lines changed

10 files changed

+38
-19
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.4.0
2+
3+
* Upgrade libserialport sources to 0.1.1
4+
* Fix TERMIOX definition
5+
16
## 0.3.0
27

38
* Upgrade to Dart 2.17, Flutter 3.0, libserialport 0.3
@@ -17,7 +22,7 @@
1722
## 0.2.0
1823

1924
* Rename from flutter_serial_port to flutter_libserialport
20-
https://github.com/jpnurmi/flutter_libserialport/issues/1
25+
<https://github.com/jpnurmi/flutter_libserialport/issues/1>
2126

2227
## 0.1.1
2328

example/macos/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :osx, '10.11'
1+
platform :osx, '10.14'
22

33
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
44
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
@@ -203,7 +203,7 @@
203203
isa = PBXProject;
204204
attributes = {
205205
LastSwiftUpdateCheck = 0920;
206-
LastUpgradeCheck = 0930;
206+
LastUpgradeCheck = 1430;
207207
ORGANIZATIONNAME = "The Flutter Authors";
208208
TargetAttributes = {
209209
33CC10EC2044A3C60003C045 = {
@@ -256,6 +256,7 @@
256256
/* Begin PBXShellScriptBuildPhase section */
257257
3399D490228B24CF009A79C7 /* ShellScript */ = {
258258
isa = PBXShellScriptBuildPhase;
259+
alwaysOutOfDate = 1;
259260
buildActionMask = 2147483647;
260261
files = (
261262
);
@@ -407,7 +408,7 @@
407408
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
408409
GCC_WARN_UNUSED_FUNCTION = YES;
409410
GCC_WARN_UNUSED_VARIABLE = YES;
410-
MACOSX_DEPLOYMENT_TARGET = 10.11;
411+
MACOSX_DEPLOYMENT_TARGET = 10.14;
411412
MTL_ENABLE_DEBUG_INFO = NO;
412413
SDKROOT = macosx;
413414
SWIFT_COMPILATION_MODE = wholemodule;
@@ -490,7 +491,7 @@
490491
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
491492
GCC_WARN_UNUSED_FUNCTION = YES;
492493
GCC_WARN_UNUSED_VARIABLE = YES;
493-
MACOSX_DEPLOYMENT_TARGET = 10.11;
494+
MACOSX_DEPLOYMENT_TARGET = 10.14;
494495
MTL_ENABLE_DEBUG_INFO = YES;
495496
ONLY_ACTIVE_ARCH = YES;
496497
SDKROOT = macosx;
@@ -537,7 +538,7 @@
537538
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
538539
GCC_WARN_UNUSED_FUNCTION = YES;
539540
GCC_WARN_UNUSED_VARIABLE = YES;
540-
MACOSX_DEPLOYMENT_TARGET = 10.11;
541+
MACOSX_DEPLOYMENT_TARGET = 10.14;
541542
MTL_ENABLE_DEBUG_INFO = NO;
542543
SDKROOT = macosx;
543544
SWIFT_COMPILATION_MODE = wholemodule;

example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1000"
3+
LastUpgradeVersion = "1430"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: flutter_libserialport
22
description: A simple wrapper around libserialport utilizing Flutter's
33
build system to build and deploy the C-library for the target platform.
4-
version: 0.3.1
4+
version: 0.4.0
55
homepage: https://github.com/jpnurmi/flutter_libserialport
66
repository: https://github.com/jpnurmi/flutter_libserialport
77
issue_tracker: https://github.com/jpnurmi/flutter_libserialport/issues
88

99
environment:
10-
sdk: '>=2.17.0 <3.0.0'
11-
flutter: '>=3.0.0'
10+
sdk: ">=2.17.0 <4.0.0"
11+
flutter: ">=3.0.0"
1212

1313
dependencies:
1414
flutter:

third_party/libserialport/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Mailing list
8383
IRC
8484
===
8585

86-
You can find the developers in the #sigrok IRC channel on Freenode.
86+
You can find the developers in the #sigrok IRC channel on Libera.Chat.
8787

8888
Website
8989
=======

third_party/libserialport/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ AC_SYS_LARGEFILE
112112
AC_TYPE_SIZE_T
113113

114114
# Check for specific termios structures.
115-
AC_CHECK_TYPES([struct termios2, struct termiox],,,
115+
AC_CHECK_TYPES([struct termios2],,,
116116
[[#include <linux/termios.h>]])
117117
AC_CHECK_MEMBERS([struct termios.c_ispeed, struct termios.c_ospeed,
118118
struct termios2.c_ispeed, struct termios2.c_ospeed],,,

third_party/libserialport/libserialport_internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@
9393
#include <IOKit/serial/ioss.h>
9494
#include <sys/syslimits.h>
9595
#include <mach/mach_time.h>
96+
#if MAC_OS_X_VERSION_MAX_ALLOWED < 120000 /* Before macOS 12 */
97+
#define kIOMainPortDefault kIOMasterPortDefault
98+
#endif
9699
#endif
97100
#ifdef __linux__
98101
#include <dirent.h>

third_party/libserialport/macosx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port)
4242
if (!(classes = IOServiceMatching(kIOSerialBSDServiceValue)))
4343
RETURN_FAIL("IOServiceMatching() failed");
4444

45-
if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes,
45+
if (IOServiceGetMatchingServices(kIOMainPortDefault, classes,
4646
&iter) != KERN_SUCCESS)
4747
RETURN_FAIL("IOServiceGetMatchingServices() failed");
4848

@@ -210,7 +210,7 @@ SP_PRIV enum sp_return list_ports(struct sp_port ***list)
210210
}
211211

212212
DEBUG("Getting matching services");
213-
if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes,
213+
if (IOServiceGetMatchingServices(kIOMainPortDefault, classes,
214214
&iter) != KERN_SUCCESS) {
215215
SET_FAIL(ret, "IOServiceGetMatchingServices() failed");
216216
goto out_done;

third_party/libserialport/serialport.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,15 @@ SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags)
590590
RETURN_CODEVAL(ret);
591591
}
592592

593+
/*
594+
* Assume a default baudrate if the OS does not provide one.
595+
* Cannot assign -1 here since Windows holds the baudrate in
596+
* the DCB and does not configure the rate individually.
597+
*/
598+
if (config.baudrate == 0) {
599+
config.baudrate = 9600;
600+
}
601+
593602
/* Set sane port settings. */
594603
#ifdef _WIN32
595604
data.dcb.fBinary = TRUE;
@@ -633,7 +642,8 @@ SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags)
633642
data.term.c_cc[VTIME] = 0;
634643

635644
/* Ignore modem status lines; enable receiver; leave control lines alone on close. */
636-
data.term.c_cflag |= (CLOCAL | CREAD | HUPCL);
645+
data.term.c_cflag |= (CLOCAL | CREAD);
646+
data.term.c_cflag &= ~(HUPCL);
637647
#endif
638648

639649
#ifdef _WIN32
@@ -876,7 +886,7 @@ SP_API enum sp_return sp_blocking_write(struct sp_port *port, const void *buf,
876886
unsigned char *ptr = (unsigned char *) buf;
877887
struct timeout timeout;
878888
fd_set fds;
879-
int result;
889+
ssize_t result;
880890

881891
timeout_start(&timeout, timeout_ms);
882892

@@ -1081,7 +1091,7 @@ SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf,
10811091
unsigned char *ptr = (unsigned char *) buf;
10821092
struct timeout timeout;
10831093
fd_set fds;
1084-
int result;
1094+
ssize_t result;
10851095

10861096
timeout_start(&timeout, timeout_ms);
10871097

@@ -1204,7 +1214,7 @@ SP_API enum sp_return sp_blocking_read_next(struct sp_port *port, void *buf,
12041214
size_t bytes_read = 0;
12051215
struct timeout timeout;
12061216
fd_set fds;
1207-
int result;
1217+
ssize_t result;
12081218

12091219
timeout_start(&timeout, timeout_ms);
12101220

0 commit comments

Comments
 (0)