ublox-cellular-psm-mnofix
Dependencies: ublox-at-cellular-interface ublox-cellular-base ublox-cellular-base-n2xx ublox-at-cellular-interface-n2xx
Revision 2:500c4fe5b9a4, committed 2019-06-24
- Comitter:
- wajahat.abbas@u-blox.com
- Date:
- Mon Jun 24 15:12:21 2019 +0500
- Parent:
- 1:cae5c9c56a2f
- Child:
- 3:6debe6b322c4
- Commit message:
- Updated example to be aligned with example-ublox-cellular-interface
Changed in this revision
--- a/main.cpp Fri May 03 15:53:33 2019 +0500
+++ b/main.cpp Mon Jun 24 15:12:21 2019 +0500
@@ -13,33 +13,27 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#include "mbed.h"
#include "UbloxATCellularInterface.h"
-#include "OnboardCellularInterface.h"
#include "UbloxATCellularInterfaceN2xx.h"
// 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.
//
-// C030_U201 C030_N211 C027
-// UbloxATCellularInterface Y - Y
-// OnboardCellularInterface Y - Y
-// UbloxATCellularInterfaceN2xx - Y -
+// C030_U201 C030_N211 C027 C030_R41XM
+// UbloxATCellularInterface Y - Y Y
+// UbloxATCellularInterfaceN2xx - Y - -
// Note: the N211 module supports only UDP, not TCP
-// OnboardCellularInterface uses LWIP and the PPP cellular interface
-// on the mbed MCU, while using UbloxATCellularInterface and
-// UbloxATCellularInterfaceN2xx uses an IP stack on the cellular
-// module and hence uses less RAM (significant on C027). This also
-// allows other AT command operations (e.g. sending an SMS) to happen
+// UbloxATCellularInterface and UbloxATCellularInterfaceN2xx
+// uses an IP stack on the cellular module and hence uses less RAM (significant on C027).
+// This also allows other AT command operations (e.g. sending an SMS) to happen
// during a data transfer (for which you should replace the
// 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 OnboardCellularInterface
//#define INTERFACE_CLASS UbloxATCellularInterfaceN2xx
// The credentials of the SIM in the board. If PIN checking is enabled
@@ -56,11 +50,11 @@
#define APN NULL
#define USERNAME NULL
#define PASSWORD NULL
-
+#define TCP_SERVER "os.mbed.com"
// Uncomment the following line to enable Icellular Current measurement.
// Current drawn by modem is printed on serial every 2 seconds.
-//#define CURRENT_MEASUREMENT
+#define CURRENT_MEASUREMENT
// LEDs
DigitalOut ledRed(LED1, 1);
@@ -132,7 +126,6 @@
static void cbButton()
{
buttonPressed = true;
- //pulseEvent();
}
void init_modem(INTERFACE_CLASS *interface) {
@@ -183,10 +176,10 @@
#endif
/* This example program for the u-blox C030-R410M board instantiates
- * the UbloxATCellularInterface or OnboardCellularInterface and uses it
- * to make a simple sockets connection to a server, using 2.pool.ntp.org
- * for UDP and developer.mbed.org for TCP. It also showcases the 3GPP PSM
- * feature. For a more comprehensive example, where higher layer protocols
+ * the UbloxATCellularInterface and uses it to make a simple sockets
+ * connection to a server, using 2.pool.ntp.org for UDP and
+ * developer.mbed.org for TCP. It also showcases the 3GPP PSM feature.
+ * For a more comprehensive example, where higher layer protocols
* make use of the same sockets interface, see example-ublox-mbed-client.
* Progress may be monitored with a serial terminal running at 9600 baud.
* The LED on the C030 board will turn green when this program is
@@ -274,14 +267,14 @@
}
#endif
- printf("Getting the IP address of \"developer.mbed.org\" and \"2.pool.ntp.org\"...\n");
+ printf("\nGetting the IP address of \"" TCP_SERVER "\" and \"2.pool.ntp.org\"...\n");
if ((interface->gethostbyname("2.pool.ntp.org", &udpServer) == 0) &&
- (interface->gethostbyname("developer.mbed.org", &tcpServer) == 0)) {
+ (interface->gethostbyname(TCP_SERVER, &tcpServer) == 0)) {
pulseEvent();
udpServer.set_port(123);
printf("\"2.pool.ntp.org\" address: %s on port %d.\n", udpServer.get_ip_address(), udpServer.get_port());
- printf("\"developer.mbed.org\" address: %s on port %d.\n", tcpServer.get_ip_address(), tcpServer.get_port());
+ printf("\"" TCP_SERVER "\" address: %s on port %d.\n", tcpServer.get_ip_address(), tcpServer.get_port());
tcpServer.set_port(80);
printf("Performing socket operations in a loop (until the user button is pressed on C030 or forever on C027)...\n");
--- a/mbed-os.lib Fri May 03 15:53:33 2019 +0500 +++ b/mbed-os.lib Mon Jun 24 15:12:21 2019 +0500 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#57d8915a899a59999d7e2a9695e20a8a18cb54bd +https://github.com/ARMmbed/mbed-os/#73f096399b4cda1f780b140c87afad9446047432 \ No newline at end of file
--- a/ublox-at-cellular-interface.lib Fri May 03 15:53:33 2019 +0500 +++ b/ublox-at-cellular-interface.lib Mon Jun 24 15:12:21 2019 +0500 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/ublox/code/ublox-at-cellular-interface \ No newline at end of file +https://developer.mbed.org/teams/ublox/code/ublox-at-cellular-interface/#3d709ee8c3e1
--- a/ublox-cellular-base.lib Fri May 03 15:53:33 2019 +0500 +++ b/ublox-cellular-base.lib Mon Jun 24 15:12:21 2019 +0500 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#eaab8e812a5d +https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#e67d3d9d2e7e