A library for talking to Multi-Tech's Cellular SocketModem Devices.
Dependents: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
Diff: cellular/Cellular.h
- Revision:
- 17:2d7c4ea7491b
- Parent:
- 13:0af863114629
- Child:
- 19:38794784e009
--- a/cellular/Cellular.h Fri Dec 13 23:02:50 2013 +0000 +++ b/cellular/Cellular.h Mon Dec 16 20:00:20 2013 +0000 @@ -40,7 +40,7 @@ virtual bool bind(unsigned int port); virtual bool open(const std::string& address, unsigned int port, Mode mode); virtual bool isOpen(); - virtual void close(); + virtual bool close(); virtual int read(char* data, int max, int timeout = -1); virtual int write(char* data, int length, int timeout = -1); virtual unsigned int readable(); @@ -60,6 +60,7 @@ Registration getRegistration(); Code setApn(const std::string& apn); Code setDns(const std::string& apn); + Code setSocketCloseable(bool enabled = true); //ETX closes socket (ETX and DLE in payload are escaped with DLE) //SMS Code sendSMS(const std::string& phoneNumber, const std::string& message); @@ -77,6 +78,7 @@ Mode mode; bool socketOpened; + bool socketCloseable; unsigned int local_port; std::string local_address; unsigned int host_port;