this is using the mbed os version 5-13-1

Dependencies:   mbed-http

source/ATCmdManager.h

Committer:
ocomeni
Date:
2019-03-10
Revision:
74:f26e846adfe9
Child:
75:08eff6258e1b

File content as of revision 74:f26e846adfe9:

#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__