From 5188021b870a996a7fa7bd5ea8799fdf5fa9c455 Mon Sep 17 00:00:00 2001 From: Mark Wilkerson Date: Fri, 9 Jun 2023 17:48:14 -0700 Subject: [PATCH 1/2] update serial port example --- examples/serial_port_example.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/serial_port_example.cc b/examples/serial_port_example.cc index 350e38c..5527c2e 100644 --- a/examples/serial_port_example.cc +++ b/examples/serial_port_example.cc @@ -30,14 +30,14 @@ DEFINE_string(polaris_api_key, "", "The service API key. Contact account administrator or " "sales@pointonenav.com if unknown."); -DEFINE_string(polaris_unique_id, "device12345", +DEFINE_string(polaris_unique_id, "", "The unique ID to assign to this Polaris connection."); // Serial port forwarding options. -DEFINE_string(receiver_serial_port, "/dev/ttyACM0", +DEFINE_string(receiver_serial_port, "/dev/ttyUSB0", "The path to the serial port for which to forward corrections."); -DEFINE_int32(receiver_serial_baud, 115200, "The baud rate of the serial port."); +DEFINE_int32(receiver_serial_baud, 460800, "The baud rate of the serial port."); namespace { // Max size of string buffer to hold before clearing NMEA data. Should be larger @@ -61,11 +61,12 @@ double ConvertGGADegreesToDecimalDegrees(double gga_degrees) { void OnNmea(const std::string& nmea_str, PolarisClient* polaris_client) { // Some receivers put out INGGA messages as opposed to GPGGA. if (!(boost::istarts_with(nmea_str, "$GPGGA") || + boost::istarts_with(nmea_str, "$GNGGA") || boost::istarts_with(nmea_str, "$INGGA"))) { - LOG(INFO) << nmea_str; + VLOG(2) << nmea_str; return; } - VLOG(4) << "Got GGA: " << nmea_str; + LOG(INFO) << "Got GGA: " << nmea_str; std::stringstream ss(nmea_str); std::vector result; @@ -82,7 +83,7 @@ void OnNmea(const std::string& nmea_str, PolarisClient* polaris_client) { (result[3] == "N" ? 1 : -1); double lon = ConvertGGADegreesToDecimalDegrees(std::stod(result[4], &sz)) * (result[5] == "E" ? 1 : -1); - double alt = std::stod(result[8], &sz); + double alt = std::stod(result[9], &sz); VLOG(3) << "Setting position: lat: " << lat << " lon: " << lon << " alt: " << alt; polaris_client->SendLLAPosition(lat, lon, alt); @@ -108,6 +109,7 @@ void OnSerialData(const void* data, size_t length, if (nmea_sentence_buffer.size() > MAX_NMEA_SENTENCE_LENGTH) { LOG(WARNING) << "Clearing NMEA buffer. Are you sending NMEA ascii data?"; + nmea_sentence_buffer.clear(); } } From 63ecd83a95c40a2b7ac1e7118c00ed560c69dd9a Mon Sep 17 00:00:00 2001 From: Aaron Nathan Date: Sun, 11 Jun 2023 11:32:52 -0700 Subject: [PATCH 2/2] disables error on warning for some boringssl stuff more boring ssl patch more boring ssl patch more boring ssl patch also patch the copts also do this for the c lib --- bazel/repositories.bzl | 5 +++++ c/bazel/repositories.bzl | 5 +++++ c/external/boringssl.patch | 12 ++++++++++++ external/boringssl.patch | 12 ++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 c/external/boringssl.patch create mode 100644 external/boringssl.patch diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 04a7265..7fcc468 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -56,6 +56,11 @@ def dependencies(): git_repository, name = "boringssl", commit = "87f3087d6343b89142d1191388a5885d74459df2", + # Patch out -Werror to avoid error on GCC 11. The new warning that is + # triggering an error is a conversion between `const uint8_t s[32]` and + # `const uint8_t *s` in curve25519.c (-Werror=array-parameter=). + patch_args = ["-p1"], + patches = ["boringssl.patch"], # 2020/4/7 remote = "https://boringssl.googlesource.com/boringssl", shallow_since = "1586306564 +0000", diff --git a/c/bazel/repositories.bzl b/c/bazel/repositories.bzl index 72f8616..d969032 100644 --- a/c/bazel/repositories.bzl +++ b/c/bazel/repositories.bzl @@ -24,6 +24,11 @@ def dependencies(): git_repository, name = "boringssl", commit = "87f3087d6343b89142d1191388a5885d74459df2", + # Patch out -Werror to avoid error on GCC 11. The new warning that is + # triggering an error is a conversion between `const uint8_t s[32]` and + # `const uint8_t *s` in curve25519.c (-Werror=array-parameter=). + patch_args = ["-p1"], + patches = ["boringssl.patch"], # 2020/4/7 remote = "https://boringssl.googlesource.com/boringssl", shallow_since = "1586306564 +0000", diff --git a/c/external/boringssl.patch b/c/external/boringssl.patch new file mode 100644 index 0000000..d9377b0 --- /dev/null +++ b/c/external/boringssl.patch @@ -0,0 +1,12 @@ +diff --git a/BUILD b/BUILD +index 5e62b44..ab64262 100644 +--- a/BUILD ++++ b/BUILD +@@ -68,7 +68,6 @@ posix_copts = [ + + # This list of warnings should match those in the top-level CMakeLists.txt. + "-Wall", +- "-Werror", + "-Wformat=2", + "-Wsign-compare", + "-Wmissing-field-initializers", \ No newline at end of file diff --git a/external/boringssl.patch b/external/boringssl.patch new file mode 100644 index 0000000..d9377b0 --- /dev/null +++ b/external/boringssl.patch @@ -0,0 +1,12 @@ +diff --git a/BUILD b/BUILD +index 5e62b44..ab64262 100644 +--- a/BUILD ++++ b/BUILD +@@ -68,7 +68,6 @@ posix_copts = [ + + # This list of warnings should match those in the top-level CMakeLists.txt. + "-Wall", +- "-Werror", + "-Wformat=2", + "-Wsign-compare", + "-Wmissing-field-initializers", \ No newline at end of file