Prototyping the Adaptable Emergency System on an C027 board.

Dependencies:   C027_Support mbed

Fork of c027_prototyping by Philémon Favrod

Files at this revision

API Documentation at this revision

Comitter:
philemonf
Date:
Tue Sep 30 18:24:06 2014 +0000
Parent:
11:5354c4819b25
Parent:
10:b9ca12e9bb34
Child:
14:d1f114749b3c
Commit message:
merge

Changed in this revision

--- a/sms_lib.cpp	Tue Sep 30 18:22:15 2014 +0000
+++ b/sms_lib.cpp	Tue Sep 30 18:24:06 2014 +0000
@@ -1,13 +1,12 @@
-#include "MDM.h"
-
 #include "sms_lib.h"
 
 DigitalOut myled(LED);
 
 static MDMSerial *mdm;
-int init_sms_features(void)
+
+int init_sms_features(MDMSerial *_mdm)
 {
-    mdm = new MDMSerial;
+    mdm = _mdm;
     
     static const char *SIMPIN = "5554";
     
@@ -24,13 +23,6 @@
     return mdmOk;
 }
 
-void close_sms_features(void)
-{
-    if (mdm) {
-        delete mdm;
-    }
-}
-
 int send_sms(struct sms_data_t *sms)
 {
     
--- a/sms_lib.h	Tue Sep 30 18:22:15 2014 +0000
+++ b/sms_lib.h	Tue Sep 30 18:24:06 2014 +0000
@@ -1,13 +1,14 @@
 #ifndef __SMS_LIB_H__
 #define __SMS_LIB_H__
 
+#include "MDM.h"
+
 struct sms_data_t {
     char *phone_num;
     char *msg_buf;
 };
 
-int init_sms_features(void);
-void close_sms_features(void);
+int init_sms_features(MDMSerial *_mdm);
 
 int send_sms(struct sms_data_t *sms);
 int read_sms(struct sms_data_t *sms);