How To Configure a WPAN Gateway to work with a Wireless Serial Gateway
PAD refers to Packet Assembly and Disassembly and is the protocol by which serial data is packetized to be sent over the wireless link. The receiving side disassembles these packets and outputs raw serial data.
There are two modes of operation of the Wireless Serial Gateway (WSG) and WPAN Gateway: transparent mode and multi-point/multi device. In transparent PAD mode (WSG client and WPAN Gateway (PAD=2 mode)), serial data is buffered until a condition is met for sending it over the wireless link. The condition can be one of the following:
- Maximum data length reached (PADFWDL)
- Maximum packetization timeout expired (PADFWDT)
In Multi-point/multi device mode, WPAN Gateway data is formatted into sentences in the form:
$PWPAN,ID,HeaderPayload*hh<CR><LF>
Where:
ID = 64-bit hex address of the device that sent the message
HeaderPayload = 3-byte header and variable length payload formatted as hex digits.
Messages to the WSG or client are in the form of:
$PPQ,WPAN,ID,HeaderPayload*hh<CR><LF>
Where:
ID = 64-bit hex address of the endpoint device
HeaderPayload = 3-byte header and variable length payload formatted as hex digits.


| AT^PAD=n | n=0 => PAD disabled (default) n=1 => PAD client enabled (transparent client mode) n=2 => PAD server enabled (transparent server mode) |
| AT^PAD? | Queries the command setting |
Note: If a transparent connection is required, the Wireless Serial Gateway (client) is configured as PAD=1 and the WPAN Gateway (server) as PAD=2.
If point to multi point communication is required, the Wireless Serial Gateway (WSG)(client) is configured as PAD=1 and the Gateway (server) must be configured as PAD=0.
| AT^PADFWDL=n | n is forwarding data length in characters (1-64). Default=20. |
| AT^PADFWDL? | Queries the command setting |
| AT^PADFWDT=n | n is the forwarding data time in 50ms increments. n=0 => disabled n=20 => 1s (default) n=255 => maximum value |
| AT^PADFWDT? | Queries the command setting |
| AT^PADECHO=n | Controls pad echo. n=0 => echo disabled n=1 => echo enabled (default) |
| AT^PADFWDT? | Queries the command setting |
ATO command is required to reconnect after the escape sequence.
Once a client connection is established, a CONNECT message is displayed. Note that this can be disabled with ATQ1. When in transparent mode, the server side also displays a “connect” message with the ID of the client device.
The server can be in transparent mode as well (PAD=2). In this mode, the 2 devices, one Wireless Serial Gateway and one WPAN Gateway act as a wireless serial link. No other device types are supported in this mode and only 1 client is allowed.
In PAD=0 mode, the server WPAN Gateway outputs data using the PWPAN/PPQ, message structure. In this mode, the server WPAN Gateway can simultaneously talk to multiple devices (Man-Down Pendant, etc) and also multiple PAD client devices.
The configuration is done using the following command:
| AT^PADDEVTYPE=n | n=10-20 (default = 10) |
| AT^PADDEVTYPE? | Queries the command setting |
Examples:
In the below examples, the client refers to the Wireless Serial Gateway connected to the remote serial device and the server refers to the WPAN Gateway connected to the DCE device.
Transparent Mode Configurations:
Client settings (Wireless Serial Gateway / WSG):
AT^PADECHO=0
AT^PAD=1
AT&W
Server settings (WPAN Gateway):
AT^PADECHO=0
AT^PAD=2
AT^ZBEEADDDEV=0013A200........
AT&W
Multi-point Mode Configurations:
AT^PAD=1
Server settings (WPAN Gateway):
AT^PAD=0
AT^ZBEEADDDEV=0013A200........
AT^ZBEEADDDEV=0013A200........
AT^ZBEEADDDEV=0013A200........
The client side is required to register to the server. In order to save battery power, this registration period is configurable. This is done using the following command:
AT^PADREGT=p,i
Where:
p is the registration period in seconds.
p=0 => try registering with no delay
p=10 => 10seconds (default)
p=255 => maximum value
i is the registration period increment
i=1 => minimum value
i=10 => 10s (default)
i=255 => maximum value
After power up or lost connection, the client will try registering immediately. If it fails, it will wait for a period that increments by i every failed attempt until it reaches the value of p, where it will continue to attempt to register until a valid connection is made.
Example: p=60, i=10
| Attempt | Delay (seconds) |
| 1 | 0 |
| 2 | 10 |
| 3 | 20 |
| 4 | 30 |
| 5 | 40 |
| 6 | 50 |
| 7 | 60 |
| 8 | 60 |
| 9 | 60 |
| .. | .. |
| … | … |
| …. | ….. |