Multi-Hackers / SocketModem

Dependents:   M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more

cellular/Cellular.h

Committer:
jengbrecht
Date:
2013-12-09
Revision:
0:563b70517320
Child:
4:6561c9128c6f

File content as of revision 0:563b70517320:

#ifndef CELLULAR_H
#define CELLULAR_H

#include "mbed.h"
#include "MTSBufferedIO.h"
#include <string>

class Cellular
{
public:
    enum Code {
        OK, ERROR, NO_RESPONSE, FAILURE
    };

    enum ESC_CHAR {
        CR, CTRL_Z
    };

    enum Registration {
        NOT_REGISTERED, REGISTERED, SEARCHING, DENIED, UNKNOWN, ROAMING
    };

    Cellular(MTSBufferedIO* io);
    ~Cellular();

    string sendCommand(string command, int timeoutMillis, ESC_CHAR esc = CR);
    Code sendBasicCommand(string command, int timeoutMillis, ESC_CHAR esc = CR);

    Code ATTest();
    Code echoOff(bool state);
    int getSignalStrength();
    Registration getRegistration();    
    Code sendSMS(string phoneNumber, string message);
    int connect(string host, int port);    
    
private:
    MTSBufferedIO* io;
};

#endif /* CELLULAR_H */