PHS module APM-002 library. see: https://developer.mbed.org/users/phsfan/notebook/abitusbmodem/

Dependencies:   Socket lwip-sys lwip

Fork of AbitUSBModem by phs fan

Files at this revision

API Documentation at this revision

Comitter:
phsfan
Date:
Wed Jul 01 01:00:31 2015 +0000
Parent:
101:b330179423c8
Commit message:
fix flow control

Changed in this revision

AbitModemInterface.cpp Show annotated file Show diff for this revision Revisions of this file
AbitModemInterface.h Show annotated file Show diff for this revision Revisions of this file
--- a/AbitModemInterface.cpp	Thu May 28 08:45:20 2015 +0000
+++ b/AbitModemInterface.cpp	Wed Jul 01 01:00:31 2015 +0000
@@ -53,7 +53,15 @@
     m_reset = 0;
     m_module.baud(baud);
 #if DEVICE_SERIAL_FC
-    m_module.set_flow_control(Serial::RTSCTS, rts, cts);
+    if (rts != NC && cts != NC) {
+        m_module.set_flow_control(Serial::RTSCTS, rts, cts);
+    } else
+    if (rts != NC && cts == NC) {
+        m_module.set_flow_control(Serial::RTS, rts);
+    } else
+    if (rts == NC && cts != NC) {
+        m_module.set_flow_control(Serial::CTS, cts);
+    }
 #else
     m_rts = 0;
     m_cts.mode(PullUp);
--- a/AbitModemInterface.h	Thu May 28 08:45:20 2015 +0000
+++ b/AbitModemInterface.h	Wed Jul 01 01:00:31 2015 +0000
@@ -32,7 +32,7 @@
 #include "ip/PPPIPInterface.h"
 #include "sms/SMSInterface.h"
 
-#undef DEVICE_SERIAL_FC
+#define DEVICE_SERIAL_FC 1
 
 class AbitModemInterface {
 public: