From f94e751dd004b58718f0f8507b20f9e70b8f0d57 Mon Sep 17 00:00:00 2001 From: Phil Jensen Date: Thu, 24 Sep 2020 13:43:36 +0100 Subject: [PATCH] Add support for ultra high-speed baud rates. --- src/modem_core.c | 8 ++++++++ src/modem_core.h | 2 ++ src/serial.c | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/src/modem_core.c b/src/modem_core.c index 222f58e..9608318 100644 --- a/src/modem_core.c +++ b/src/modem_core.c @@ -32,6 +32,8 @@ int mdm_init() mdm_responses[MDM_RESP_CONNECT_57600] = "CONNECT 57600"; mdm_responses[MDM_RESP_CONNECT_115200] = "CONNECT 115200"; mdm_responses[MDM_RESP_CONNECT_230400] = "CONNECT 230400"; + mdm_responses[MDM_RESP_CONNECT_460800] = "CONNECT 460800"; + mdm_responses[MDM_RESP_CONNECT_921600] = "CONNECT 921600"; return 0; } @@ -41,6 +43,12 @@ int get_connect_response(int speed, int level) return MDM_RESP_CONNECT; } switch (speed) { + case 921600: + return MDM_RESP_CONNECT_921600; + case 460800: + return MDM_RESP_CONNECT_460800; + case 230400: + return MDM_RESP_CONNECT_230400; case 115200: return MDM_RESP_CONNECT_115200; case 57600: diff --git a/src/modem_core.h b/src/modem_core.h index 6063424..6f32ccb 100644 --- a/src/modem_core.h +++ b/src/modem_core.h @@ -22,6 +22,8 @@ #define MDM_RESP_CONNECT_57600 18 #define MDM_RESP_CONNECT_115200 19 #define MDM_RESP_CONNECT_230400 20 +#define MDM_RESP_CONNECT_460800 21 +#define MDM_RESP_CONNECT_921600 22 #define MDM_CL_DSR_LOW 0 #define MDM_CL_DSR_HIGH 1 diff --git a/src/serial.c b/src/serial.c index 5025d32..42a0b83 100644 --- a/src/serial.c +++ b/src/serial.c @@ -16,6 +16,12 @@ int ser_get_bps_const(int speed) LOG(LOG_DEBUG, "Checking speed: %d", speed); switch (speed) { + case 921600: + bps_rate = B921600; + break; + case 460800: + bps_rate = B460800; + break; case 230400: bps_rate = B230400; break;