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: C027_Support C12832 LM75B MMA7660 PubNub mbed-rtos mbed picojson
Fork of Cellular_PubNubDemo by
Diff: PubNubDemo.cpp
- Revision:
- 5:6cf75d71d7b9
- Parent:
- 4:84e8940cf7ef
- Child:
- 8:ad3a3cffc336
diff -r 84e8940cf7ef -r 6cf75d71d7b9 PubNubDemo.cpp
--- a/PubNubDemo.cpp Tue May 13 09:34:02 2014 +0000
+++ b/PubNubDemo.cpp Tue May 20 14:37:42 2014 +0000
@@ -8,30 +8,22 @@
#include "picojson.h"
#include "PubNub.h"
-#include "C027.h"
+//------------------------------------------------------------------------------------
+// You need to configure these cellular modem / SIM parameters.
+// These parameters are ignored for LISA-C200 variants and can be left NULL.
+//------------------------------------------------------------------------------------
#include "MDM.h"
-
-//----------------------------------------------------------------------
-// You may need to configure these parameters
-
-/** Set your secret SIM pin here "1234"
-*/
+//! Set your secret SIM pin here (e.g. "1234"). Check your SIM manual.
#define SIMPIN NULL
-
-/** The APN of your network operator, sometimes it is "internet"
- check your contract with the network operator
-*/
+/*! The APN of your network operator SIM, sometimes it is "internet" check your
+ contract with the network operator. You can also try to look-up your settings in
+ google: https://www.google.de/search?q=APN+list */
#define APN "gprs.swisscom.ch"
-
-/** Set the user name for your APN, or NULL if not needed
-*/
+//! Set the user name for your APN, or NULL if not needed
#define USERNAME NULL
-
-/** Set the password for your APN, or NULL if not needed
-*/
+//! Set the password for your APN, or NULL if not needed
#define PASSWORD NULL
-
-C027 c027;
+//------------------------------------------------------------------------------------
/* Demo of PubNub + the mbed application board. */
@@ -155,11 +147,9 @@
if (!MMA.testConnection())
lcd.printf("MMA error \n");
- // turn on the supplies of the Modem
- c027.mdmPower(true);
- printf("Modem Initialize\r\n");
MDMSerial mdm;
- if (!mdm.connect(SIMPIN, APN,USERNAME,PASSWORD, true))
+ //mdm.setDebug(4); // enable this for debugging issues
+ if (!mdm.connect(SIMPIN, APN,USERNAME,PASSWORD))
return -1;
status_msg(pn);
@@ -187,5 +177,4 @@
mdm.disconnect();
mdm.powerOff();
- c027.mdmPower(false);
}
\ No newline at end of file
