Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
cellular/Cellular.h
- Committer:
- sgodinez
- Date:
- 2013-12-11
- Revision:
- 4:6561c9128c6f
- Parent:
- 0:563b70517320
- Child:
- 5:93e889a5abc6
File content as of revision 4:6561c9128c6f:
#ifndef CELLULAR_H
#define CELLULAR_H
#include "mbed.h"
#include "MTSBufferedIO.h"
#include <string>
#include <vector>
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
};
struct Sms {
std::string phoneNumber;
std::string message;
std::string timestamp;
};
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();
//SMS
Code sendSMS(const std::string& phoneNumber, const std::string& message);
Code sendSMS(const Sms& sms);
std::vector<Cellular::Sms> getReceivedSms();
Code deleteAllReceivedSms();
Code deleteOnlyReceivedReadSms();
int connect(string host, int port);
private:
MTSBufferedIO& io;
};
#endif /* CELLULAR_H */
uIP Socket Modem Shield (Outdated - see below)