this is using the mbed os version 5-13-1
Diff: source/ATCmdManager.h
- Revision:
- 74:f26e846adfe9
- Child:
- 75:08eff6258e1b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/source/ATCmdManager.h Sun Mar 10 09:46:06 2019 +0000
@@ -0,0 +1,44 @@
+#ifndef __ATCMD_MANAGER_H__
+#define __ATCMD_MANAGER_H__
+#include <mbed.h>
+#include "ATCmdParser.h"
+
+#define MAIN_LOOP_WAIT_TIME_MS 10 // milliseconds
+#ifndef UBLOX_ODIN_W2_MISC_TIMEOUT
+#define UBLOX_ODIN_W2_MISC_TIMEOUT 2000
+#endif
+
+
+class ATCmdManager {
+public:
+ ATCmdManager(PinName tx, PinName rx, bool debug = false);
+public:
+ void runMain();
+
+
+
+private:
+// UART settings
+ UARTSerial _serial;
+ Mutex _smutex; // Protect serial port access
+ Mutex _rmutex; // Reset protection
+
+ // AT Command Parser
+ ATCmdParser _parser;
+ // OOB processing
+ void _process_oob(uint32_t timeout, bool all);
+ // OOB message handlers
+ void _oob_startup_hdlr();
+ void _oob_bleRole_hdlr();
+ void _oob_wifiMode_err();
+ void _oob_conn_already();
+ void _oob_err();
+
+ /**
+ * Allows timeout to be changed between commands
+ *
+ * @param timeout_ms timeout of the connection
+ */
+ void set_timeout(uint32_t timeout_ms = UBLOX_ODIN_W2_MISC_TIMEOUT);
+};
+#endif // __ATCMD_MANAGER_H__
\ No newline at end of file