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.
Dependencies: Socket lwip-sys lwip
Dependents: AbitUSBModem_HTTPTest AbitUSBModem_MQTTTest AbitUSBModem_WebsocketTest AbitUSBModem_SMSTest
Fork of VodafoneUSBModem by
Diff: AbitUSBModem.h
- Revision:
- 97:7d9cc95e2ea7
- Parent:
- 96:b50f5f795684
diff -r b50f5f795684 -r 7d9cc95e2ea7 AbitUSBModem.h
--- a/AbitUSBModem.h Wed Feb 18 09:40:07 2015 +0000
+++ b/AbitUSBModem.h Wed Feb 18 14:11:24 2015 +0000
@@ -1,5 +1,6 @@
-/* AbitUSBModem.h
- * modifyed by Suga
+/* AbitUSBModem.h */
+/* Modified by 2015 phsfan
+ * for ABIT SMA-01
*/
/* VodafoneUSBModem.h */
/* Copyright (C) 2012 mbed.org, MIT License
@@ -26,8 +27,10 @@
#include "core/fwk.h"
#include "USBHostPhs.h"
+#include "at/ATCommandsInterface.h"
#include "serial/usb/USBSerialStream.h"
#include "ip/PPPIPInterface.h"
+#include "sms/SMSInterface.h"
class AbitUSBModem {
public:
@@ -43,6 +46,21 @@
*/
int disconnect();
+ /** Send a SM
+ @param number The receiver's phone number
+ @param message The message to send
+ @return 0 on success, error code on failure
+ */
+ int sendSM(const char* number, const char* message);
+
+ /** Receive a SM
+ @param number Pointer to a buffer to store the sender's phone number (must be at least 17 characters-long, including the sapce for the null-terminating char)
+ @param message Pointer to a buffer to store the the incoming message
+ @param maxLength Maximum message length that can be stored in buffer (including null-terminating character)
+ @return 0 on success, error code on failure
+ */
+ int getSM(char* number, char* message, size_t maxLength);
+
/** Get the IP address of a connected device
@return A pointer to a string containing the IP address.
*/
@@ -58,10 +76,13 @@
ATCommandsInterface m_at; //< Interface to AT commands processing
+ SMSInterface m_sms; //< Interface to SMS manager (send/receive etc)
+
PPPIPInterface m_ppp; //< Interface to PPP conection manager (IP assignment etc)
bool m_dongleConnected; //< Is the dongle physically connected (does the USB stack respond)? true/false
bool m_ipInit; //< Has PPIPInterface object (m_ppp) been initialised? true/false
+ bool m_smsInit; //< Has SMSInterface object (m_sms) been initialised? true/false
bool m_atOpen; //< Is the interface to the ATCommandsInterface open? true/false
};
