Okundu Omeni
/
wifi-https-ble-sm-uart-atcmd-5-13-1
this is using the mbed os version 5-13-1
Diff: source/ATCmdManager.cpp
- Revision:
- 74:f26e846adfe9
- Child:
- 75:08eff6258e1b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/source/ATCmdManager.cpp Sun Mar 10 09:46:06 2019 +0000 @@ -0,0 +1,63 @@ +#include "ATCmdManager.h" +#include "common_config.h" + +ATCmdManager::ATCmdManager(PinName tx, PinName rx, bool debug) + : + _serial(tx, rx, DEFAULT_BAUD_RATE), + _parser(&_serial) + +{ +// constructor + _serial.set_baud(DEFAULT_BAUD_RATE); + _parser.debug_on(debug); + _parser.set_delimiter("\r\n"); + _parser.oob("ATE0", callback(this, &ATCmdManager::_oob_startup_hdlr)); + printf("\n --- ATCmdManager constructor completed ---\n"); + // AT+UBTLE +} + + +void ATCmdManager::runMain(){ + while(true){ + _process_oob(UBLOX_ODIN_W2_RECV_TIMEOUT, true); + wait_ms(MAIN_LOOP_WAIT_TIME_MS); // allow BTLE to be + } + +} + + +// OOB processing +void ATCmdManager::_process_oob(uint32_t timeout, bool all){ + set_timeout(timeout); + // Poll for inbound packets + while (_parser.process_oob() && all) { + } + set_timeout(); +} + + +// OOB message handlers +void ATCmdManager::_oob_startup_hdlr(){ +} + + +void ATCmdManager::_oob_bleRole_hdlr(){ +} + + +void ATCmdManager::_oob_wifiMode_err(){ +} + + +void ATCmdManager::_oob_conn_already(){ +} + + +void ATCmdManager::_oob_err(){ +} + +void ATCmdManager::set_timeout(uint32_t timeout_ms) +{ + _parser.set_timeout(timeout_ms); +} +