Merge pull request #19 from omgdevops/master

Add support for ultra high-speed baud rates.
This commit is contained in:
FozzTexx 2020-09-24 06:41:35 -07:00 committed by GitHub
commit 647cc1cb10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -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:

View File

@ -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

View File

@ -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;