AP Bridge Software Overview

The AP Bridge software connects the Serial API of the AP Mote with the VManager through a TCP/IP connection. 

AP connection

The AP Bridge communicates with the AP Mote using the Serial API of AP Mote. The serial protocol is similar to the IP Mote Serial API, described in the SmartMesh IP Mote Serial API Guide, with commands sent to the AP Mote and notifications received from the AP Mote. The AP Bridge tells the AP Mote to join the SmartMesh IP network when the AP Bridge is connected with the VManager. The AP Bridge manages a time handshake with the AP Mote, which establishes the ASN to UTC mapping for the network. 

Once connected to the AP Mote, the AP Bridge periodically pings the AP Mote if there is no other traffic to verify that communication is still working. Similarly, the AP Mote expects to receive periodic input from the AP Bridge. Once connected to the network, if the AP Mote does not receive input from the AP Bridge over a 60 second interval, the AP Mote will disconnect from the network and reset. 

Manager connection

The AP Bridge communicates with the VManager using a TCP-based messaging protocol. Once the AP Bridge establishes a Serial API connection with the AP Mote, the AP Bridge tries to connect to the VManager. The AP Bridge and VManager rely on stunnel to provide secure communication. It is the responsibility of the system integrator to configure the appropriate stunnel certificates and algorithms. 

The AP Bridge handles flow control with the VManager. If the AP Mote can not handle the rate of input from the VManager, the AP Bridge will request that the VManager suspend its input. Similarly, if the VManager can not handle the rate of input from the AP Mote, the AP Bridge will NACK input from the AP Mote. 

The AP Bridge expects to have a reliable network connection to the VManager. The AP Bridge can recover from short disconnections (less than 30 seconds) from the VManager. While the AP Bridge and VManager are disconnected, the AP Bridge will NACK input from the AP Mote. When disconnected, the AP Bridge periodically tries to reconnect to the VManager and reestablish its existing session. If the AP Bridge cannot re-establish a connection to the VManager, it will disconnect the AP Mote from the network, allowing traffic to route to another AP Mote. 

AP Bridge state machine

At a high level, the operation of the AP Bridge can be described in the following state machine.