rev1 ā Dec 2013 www.digitalcomtech.com 13
At this point the unit will try to register on GSM and on GPRS (you can see this status live
on SyrusDesk).
Although PIN and APN parameters take effect immediately the unit may take up some time
on registering to the network if previous erroneous information was used. You can wait for
the unit to register or you can speed up the process by resetting the communications
module with the>SXAGP1< command.
Using the XANS command it is possible to query the current GSM and GPRS registration
status. Please refer to the LEDs section and to the XANS command, for an more information
on the unit's current registration status.
Creating a Destination Point (DP)
Now that we have the unit working on the GSM/GPRS network the unit is ready to send and
receive communications from IP servers and phone numbers. For our example we need to
create a Destination Point (DP) which holds our remote server IP number or address and
the serving port that it is using for listening to TCP connections or UDP datagrams.
Refer to the section below for building your own TCP/UDP listener
For this example we will use a server located on the address avl.server.com , which
listens for TCP connections on the port 2145. Since it is a TCP server we must choose an
index from 00 to 03. In this example the index 00 will be used for no particular reason:
>SXADP0000avl.server.com;2145<
An IP address could also be specified. Supposing we wanted to use the IP number
192.168.0.1 we would have to send:
>SXADP0000192.168.0.1;2145<
Having set the DP, the unit will automatically start opening a TCP connection with the
server (as long as GPRS is ready) even if it has no messages to send to it. This is a
programmed feature of the unit that makes it reopen the TCP connection whenever the
network is available after being down or whenever the connection gets closed.
Use the XANS command to consult the state of the current DP:
>QXANS<
The unit might reply like this:
>RXANS1,internet.carrier-
name.com,1234,,;1,1,null,1,22,1,1,18.18.9.8,1;socket://avl.serve
r.com:2145,0, -1,,-
1,,,,0,0,0,,,,0,,,,25\;0,0,0,0,,,17;28,3,101,0,0,,5,42,
socket://avl.server.com:2145;<