Hardware Reference
In-Depth Information
These functions are presented in Chapter 9.
To become a server, that is to say a device that will listen to incoming con-
nections, use the GSMServer class:
GSMServer server(port);
The port parameter is an int ; it tells the server which port to listen on for
connections.
One difference between the GSM library and the Ethernet library is the
nature of the connection. GSM connections are sometimes unstable; network
coverage may not be available in some locations (for example, inside a building
or under a bridge). To know if a command were successfully executed, use the
ready() function:
result = client.ready();
This function does not take any parameters and returns an int ; 1 if the previ-
ous operation has completed, and 0 if it has not (yet) completed.
Many network providers do not allow incoming connections on their network,
making it impossible to run servers with the GSM shield. Check with your
provider to see if there are any such limitations with your network.
Modem
The modem class is used primarily to perform diagnostic operations on the
modem component. To use it, you must use the GSMModem class:
GSMModem modem;
To initialize the modem subsystem, you must i rst use begin() :
result = modem.begin();
This function returns true if the modem subsystem was initialized or false
if there was a problem with the initialization. (For example, the shield has not
been correctly installed.)
To retrieve the IMEI number, the International Mobile Equipment Identii er,
a unique number identifying the shield's modem, use getIMEI() :
result = modem.getIMEI();
This function does not take any parameters and returns a String , the IMEI
number of the GSM modem.
 
Search WWH ::




Custom Search