A library for talking to Multi-Tech's Cellular SocketModem Devices.
Dependents: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
Revision 108:554585370b4a, committed 2013-12-31
- Comitter:
- jengbrecht
- Date:
- Tue Dec 31 17:30:45 2013 +0000
- Parent:
- 106:358972176b89
- Child:
- 109:08d39ce849a3
- Commit message:
- Made setDeviceIP more robust in Wifi
Changed in this revision
--- a/cellular/Cellular.h Tue Dec 31 16:34:22 2013 +0000 +++ b/cellular/Cellular.h Tue Dec 31 17:30:45 2013 +0000 @@ -19,7 +19,7 @@ * SMS messages while having an open data connection at the same time. The concurrent * capability may be added in a future release. This class also inherits from IPStack * providing a common set of commands for communication devices that have an onboard -* IP Stack. It is also integrated with the standard Mbed Sockets package and can therefore +* IP Stack. It is also integrated with the standard mbed Sockets package and can therefore * be used seamlessly with clients and services built on top of this interface already within * the mbed library. *
--- a/wifi/Wifi.cpp Tue Dec 31 16:34:22 2013 +0000 +++ b/wifi/Wifi.cpp Tue Dec 31 17:30:45 2013 +0000 @@ -411,6 +411,12 @@ Code Wifi::setDeviceIP(std::string address) { + //Check for command mode + if(!setCmdMode(true)) { + printf("[ERROR] Failed to set IP due to mode issue\r\n"); + return FAILURE; + } + //Set to DHCP mode if(address.compare("DHCP") == 0) { return sendBasicCommand("set ip dhcp 1", 1000);
--- a/wifi/Wifi.h Tue Dec 31 16:34:22 2013 +0000 +++ b/wifi/Wifi.h Tue Dec 31 17:30:45 2013 +0000 @@ -8,6 +8,23 @@ using namespace mts; +/** This is a class for communicating with a Roving Networks RN-171 Wifi module. This +* module comes in a variety of form factors including the Multi-Tech SocketShield. +* This class supports two main types of WiFi module interactions including: +* configuration and status command processing and TCP/UDP Socket +* data connections. It should be noted that while a data connection is open the module +* must be put in command mode before commands can be sent. This is handled within the class +* automatically for all native commands. This class also inherits from IPStack +* providing a common set of commands for communication devices that have an onboard +* IP Stack. It is also integrated with the standard mbed Sockets package and can therefore +* be used seamlessly with clients and services built on top of this interface already within +* the mbed library. +* +* All of the following examples use the Pin Names for the Freedom KL46Z board coupled with +* the SocketModem Shield Arduino compatible board. Please chage Pin Names accordingly to +* match your hardware configuration. The default baud rate for the WiFi module is 9600 bps. +* +*/ class Wifi : public IPStack { public: