Wanpipe Linux HDLC API
The Sangoma AFT API is common DATA (non-voice) api for all Sangoma Hardware.
- AFT A101/2/4/8 (T1/E1)
- AFT A14X (V35 RS232 Serial)
The Sangoma AFT API supports following operation modes:
- HDLC Mode
The sample application runs on top of a hdlc interface and receives
HDLC formated frames. HDLC framing is done in AFT hardware. - Transparent (Bitstreaming) Mode
The sample application runs on top of a raw transparent interface and receives
all bits on the line in configurable block size. HDLC framing is turned off in hardware.
Sangoma AFT API has been developed based on network programming model.
All Sangoma devices can be polled via select() or poll() and can be polled for read,write,oob.
Important API Compatibility Info
The standard AFT API has been is supported on Linux Only.
From 3.5 release the AFT API has changed from 16 byte header to 64 byte header, therefore its not binary compatible.
Linux Driver Intallation
Make sure you have all required packages prior to installation (requirements ).
- Download the appropriate WANPIPE® Release based on the Sangoma Hardware. Refer to Wanpipe Drivers section.
- Untar wanpipe release in arbitrary directory (/usr/src/) .
#>tar xvfz wanpipe-<version>
After untarring WANPIPE®, the wanpipe/ directory will be created.
- Run ./Setup install
Proceed with installation Select "Y" for each option.
Under compilation mode: Select "WAN Protocol Support" (Option #1).
- Proceed with Defaults for the rest of the compilation.
If any errors are encountered during the compilation of the utilities, click here for assistance. - To verify driver installation
#> wanrouter hwprobe
-> confirm that you see the list of installed wanpipe hardware.
Configuration HDLC Mode
- Run Wancfg configurator
#> wancfg - Select - "Create a new Configuration File" then "Select from detected cards list"
- Configure the protocol to HDLC Streaming
- Go into "Interface Setup" and change the operation mode to "API"
- Exit and Save changes
- Start the wanpipe drivers
#> wanrouter start
For errors and driver logs check: /var/log/messages
#> tail -f /var/log/messages
Configuration Transparent (Bitstreaming) Mode
- Run Wancfg configurator
#> wancfg - Select - "Create a new Configuration File" then "Select from detected cards list"
- Configure the protocol to HDLC Streaming
- Go into "Interface Setup" and change the operation mode to "API"
- Disable HDLC Engine
- Exit and Save changes
- Start the wanpipe drivers
#> wanrouter start
Start up Verification
- wanrouter hwprobe # confirm you see the installed hardware
- ifconfig #confirm you see all wanpipe interfaces
- wanrouter status #confirm wanpipe devices are connected
- For errors and driver logs check: /var/log/messages
#> tail -f /var/log/messages
Using the API
- For 3.4 Releases
#> cd /etc/wanpipe/api/aft/
#> make clean
#> make
#> make install
--- - For 3.4 Releases
#> cd /etc/wanpipe/api/legacy/aft/
#> make clean
#> make
#> make install
--- - The default sample application is called
#> ./aft_api <optoins>
This application will open a configured sangoma/wanpipe network interface and will
attempt to read and write data to it based on the input arguments passed to the device.
All Sangoma devices can be polled via select() or poll() and can be polled for read,write,oob.
Sangoma AFT API has been developed based on network programming model.
Contents of the API Package
aft_api.c : Client application that sends and receives data.
Eg: Enable Rx and Tx: Tx 10 frames 100 bytes
aft_api -i w1g1 -c wanpipe1 -r -w -txsize 100 -txcnt 10 -verbose
Eg: Rx Only
aft_api -i w1g1 -c wanpipe1 -r -verbose
Legend
- w1g1 : is a network interface specified in
wanpipe config file. /etc/wanpipe/wanpipe1.conf
(Change to reflect your configuration) - wanpipe1: is the sangoma adapter card specified
in wanpipe config file. /etc/wanpipe/wanpipe1.conf
(Change to reflect your configuration)







