Simple example for SARA modem.
Dependencies: ublox-at-cellular-interface-n2xx ublox-at-cellular-interface ublox-cellular-base-n2xx ublox-cellular-base
Fork of example-ublox-cellular-interface by
Diff: main.cpp
- Revision:
- 35:2ff8cc36982f
- Parent:
- 33:48101a4c3f14
--- a/main.cpp Wed Feb 28 15:13:03 2018 +0000
+++ b/main.cpp Fri Oct 05 15:59:12 2018 +0000
@@ -38,13 +38,13 @@
// UbloxATCellularInterface library with the UbloxATCellularInterfaceExt
// library). However, it is slower than using the LWIP/PPP on the mbed
// MCU interface since more string parsing is required.
-#define INTERFACE_CLASS UbloxATCellularInterface
+//#define INTERFACE_CLASS UbloxATCellularInterface
//#define INTERFACE_CLASS OnboardCellularInterface
-//#define INTERFACE_CLASS UbloxATCellularInterfaceN2xx
+#define INTERFACE_CLASS UbloxATCellularInterfaceN2xx
// The credentials of the SIM in the board. If PIN checking is enabled
// for your SIM card you must set this to the required PIN.
-#define PIN "0000"
+#define PIN NULL
// Network credentials. You should set this according to your
// network/SIM card. For C030 non-N2xx boards, leave the parameters as NULL
@@ -53,7 +53,7 @@
// username and password NULL), or you may leave all three as NULL and then
// a lookup will be attempted for a small number of known networks
// (see APN_db.h in mbed-os/features/netsocket/cellular/utils).
-#define APN NULL
+#define APN "nb.inetd.gdsp"
#define USERNAME NULL
#define PASSWORD NULL
@@ -62,6 +62,8 @@
DigitalOut ledGreen(LED2, 1);
DigitalOut ledBlue(LED3, 1);
+DigitalIn testInput(PD_5);
+
// The user button
volatile bool buttonPressed = false;
@@ -137,14 +139,14 @@
int main()
{
- INTERFACE_CLASS *interface = new INTERFACE_CLASS();
+ //INTERFACE_CLASS *interface = new INTERFACE_CLASS();
// If you need to debug the cellular interface, comment out the
// instantiation above and uncomment the one below.
// For the N2xx interface, change xxx to MBED_CONF_UBLOX_CELL_BAUD_RATE,
// while for the non-N2xx interface change it to MBED_CONF_UBLOX_CELL_N2XX_BAUD_RATE.
-// INTERFACE_CLASS *interface = new INTERFACE_CLASS(MDMTXD, MDMRXD,
-// xxx,
-// true);
+ INTERFACE_CLASS *interface = new INTERFACE_CLASS(MDMTXD, MDMRXD,
+ MBED_CONF_UBLOX_CELL_N2XX_BAUD_RATE,
+ true);
#ifndef TARGET_UBLOX_C030_N211
TCPSocket sockTcp;
#endif
