this is a direct fork of example-ublox-cellular-interface that adds support for USBSerial, and leverages the geneva-cellular-driver library.
Dependencies: ublox-at-cellular-interface ublox-cellular-base
Revision 42:33504aa2fe69, committed 2019-09-04
- Comitter:
- rlanders73
- Date:
- Wed Sep 04 02:25:09 2019 +0000
- Parent:
- 41:b41f25e66336
- Commit message:
- using the geneva cellular meta driver
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/geneva-cellular-driver.lib Wed Sep 04 02:25:09 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/PointLabs/code/geneva-cellular-driver/#79552a59d793
--- a/main.cpp Tue Aug 27 19:11:55 2019 +0500
+++ b/main.cpp Wed Sep 04 02:25:09 2019 +0000
@@ -15,8 +15,14 @@
*/
#include "mbed.h"
#include "UbloxATCellularInterface.h"
-#include "UbloxATCellularInterfaceN2xx.h"
+#include "USBSerial.h"
+/******************** Comms *********************/
+USBSerial pc(true);
+FileHandle* mbed::mbed_override_console(int)
+{
+ return &pc;
+}
// You must select the correct interface library for your board, by
// uncommenting the correct line below. Supported combinations are
// indicated with a "Y" in the table below.
@@ -34,7 +40,6 @@
// 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 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.
@@ -47,15 +52,15 @@
// 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 "hologram"
#define USERNAME NULL
#define PASSWORD NULL
#define TCP_SERVER "os.mbed.com"
// LEDs
-DigitalOut ledRed(LED1, 1);
-DigitalOut ledGreen(LED2, 1);
-DigitalOut ledBlue(LED3, 1);
+DigitalOut ledRed(LED_RED, 1);
+DigitalOut ledGreen(LED_GREEN, 1);
+DigitalOut ledBlue(LED_BLUE, 1);
// The user button
volatile bool buttonPressed = false;
@@ -130,14 +135,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,
+ 115200,
+ true);
#ifndef TARGET_UBLOX_C030_N211
TCPSocket sockTcp;
#endif
@@ -151,7 +156,7 @@
// No user button on C027
InterruptIn userButton(NC);
#else
- InterruptIn userButton(SW0);
+ InterruptIn userButton(USR_BTN);
#endif
// Attach a function to the user button
--- a/mbed_app.json Tue Aug 27 19:11:55 2019 +0500
+++ b/mbed_app.json Wed Sep 04 02:25:09 2019 +0000
@@ -1,9 +1,24 @@
{
+ "config": {
+ "trace-level": {
+ "help": "Options are TRACE_LEVEL_ERROR,TRACE_LEVEL_WARN,TRACE_LEVEL_INFO,TRACE_LEVEL_DEBUG",
+ "macro_name": "MBED_TRACE_MAX_LEVEL",
+ "value": "TRACE_LEVEL_DEBUG"
+ }
+ },
"target_overrides": {
"*": {
- "lwip.ppp-enabled": true,
- "platform.stdio-convert-newlines": true
+ "target.features_add": ["COMMON_PAL"],
+ "target.macros_add": ["USB_STM_HAL"],
+ "target.device_has_add": ["USBDEVICE"],
+ "platform.stdio-baud-rate": 115200,
+ "platform.stdio-convert-newlines": true,
+ "platform.default-serial-baud-rate": 115200,
+ "platform.stdio-buffered-serial": true,
+ "mbed-trace.enable": true,
+ "target.network-default-interface-type" : "CELLULAR",
+ "target.macros_add":["TARGET_DISCO_L476VG","USR_BTN=PA_1","LED_RED=PB_15","LED_GREEN=PC_7","LED_BLUE=PB_12"],
+ "target.macros_add":["TARGET_UBLOX_C030_U201","MODEM_ON_BOARD=1","MDMTXD=PC_4","MDMRXD=PC_5","MDMCTS=PB_13","MDMRTS=PB_14","MDMDTR=PB_15","MDMPWRON=PB_2","MDMVCC=PC_9","MDMRST=PA_8"]
}
}
-}
-
+}
\ No newline at end of file
--- a/ublox-at-cellular-interface-n2xx.lib Tue Aug 27 19:11:55 2019 +0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://developer.mbed.org/teams/ublox/code/ublox-at-cellular-interface-n2xx/#7fb0bbdc4242
--- a/ublox-cellular-base-n2xx.lib Tue Aug 27 19:11:55 2019 +0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://developer.mbed.org/teams/ublox/code/ublox-cellular-base-n2xx/#1afe5ed24f0c
--- a/ublox-cellular-base.lib Tue Aug 27 19:11:55 2019 +0500 +++ b/ublox-cellular-base.lib Wed Sep 04 02:25:09 2019 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#38230504a646 +https://os.mbed.com/teams/ublox/code/ublox-cellular-base/#b0a6a610d114