Linux HDLC API

    1. Introduction
    2. Installation
    3. Configuration
      -> HDLC Mode
      -> Transparent (Bitstreaming) Mode
    4. Start Up Verification
    5. API Utilization
    6. Package Contents

     


     

    Introduction

    The Sangoma AFT API is common DATA (non-voice) api for all Sangoma Hardware. 

    1. AFT A101/2/4/8 (T1/E1)
    2. AFT A14X (V35 RS232 Serial)


    The Sangoma AFT API supports following operation modes:

    1. HDLC Mode
      The sample application runs on top of a hdlc interface and receives
      HDLC formated frames.  HDLC framing is done in AFT hardware.

    2. 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 ).

    1. Download the appropriate WANPIPE® Release based on the Sangoma Hardware. Refer to Wanpipe Drivers section.
    2. Untar wanpipe release in arbitrary directory (/usr/src/) .
      #>tar xvfz wanpipe-<version>
      After untarring WANPIPE®, the wanpipe/ directory will be created.
    3. Run ./Setup install

      Proceed with installation Select "Y" for each option.

      Under compilation mode:  Select "WAN Protocol Support" (Option #1).

    4. Proceed with Defaults for the rest of the compilation.
      If any errors are encountered during the compilation of the utilities, click here for assistance.

    5. To verify driver installation
      #> wanrouter hwprobe  
      -> confirm that you see the list of installed wanpipe hardware.

     

     


    Configuration  HDLC Mode

    1. Run Wancfg  configurator
      #> wancfg

    2. Select - "Create a new Configuration File" then "Select from detected cards list"
    3. Configure the protocol to HDLC Streaming
    4. Go into "Interface Setup" and change the operation mode to "API"
    5. Exit and Save changes
    6. Start the wanpipe drivers
      #> wanrouter start

      For errors and driver logs check: /var/log/messages
      #> tail -f /var/log/messages

     


     Configuration Transparent (Bitstreaming) Mode

     

    1. Run Wancfg  configurator
      #> wancfg

    2. Select - "Create a new Configuration File" then "Select from detected cards list"

    3. Configure the protocol to HDLC Streaming

    4. Go into "Interface Setup" and change the operation mode to "API"

    5. Disable HDLC Engine

    6. Exit and Save changes

    7. Start the wanpipe drivers
      #> wanrouter start

     


    Start up Verification

    1. wanrouter hwprobe   # confirm you see the installed hardware
    2. ifconfig                      #confirm you see all wanpipe interfaces
    3. wanrouter status       #confirm wanpipe devices are connected
    4. For errors and driver logs check: /var/log/messages
      #> tail -f /var/log/messages

     


    Using the API 


    1. For 3.4 Releases
      #> cd /etc/wanpipe/api/aft/
      #> make clean
      #> make
      #> make install
      ---
    2. For 3.4 Releases
      #> cd /etc/wanpipe/api/legacy/aft/
      #> make clean
      #> make
      #> make install
      ---
    3. 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

     

    1. w1g1 : is a network interface specified in
      wanpipe config file. /etc/wanpipe/wanpipe1.conf
      (Change to reflect your configuration)

    2. wanpipe1: is the sangoma adapter card specified
      in wanpipe config file. /etc/wanpipe/wanpipe1.conf
      (Change to reflect your configuration)