Contents

API Reference Guide for OTX HDLC EX Library

Odin TeleSystems Inc.
Doc. No. 1211-1-SMA-1014-1
Doc. Rev. 1.1.20.1
Doc. Date 03/22/07
Copyright \'a9 2004-2007 Odin TeleSystems Inc., All Rights Reserved

Function Reference

OtxHdlcEx API Functions - OtxHdlcExXXX()

Header File Reference

OtxHdlcEx.h

Functions


  • OtxHdlcExClose
  • OtxHdlcExCreate
  • OtxHdlcExDisable
  • OtxHdlcExEnable
  • OtxHdlcExGetFifoStats
  • OtxHdlcExProcessIO
  • OtxHdlcExProcessIOBulk
  • OtxHdlcExProcessIOBulkEx
  • OtxHdlcExProcessIOEx
  • OtxHdlcExReadData
  • OtxHdlcExReceiverInit
  • OtxHdlcExReset
  • OtxHdlcExSendData
  • OtxHdlcExSenderInit
  • OtxHdlcExSetCallback
  • OtxHdlcExSetCallbackEx
  • OtxHdlcExSetTimeSlotMask
  • OtxHdlcExSS7GetFilter
  • OtxHdlcExSS7GetReceiveStatus
  • OtxHdlcExSS7SendData
  • OtxHdlcExSS7SetFilter
  • OtxHdlcExStartRepeatData
  • OtxHdlcExStopRepeatData

  • OtxHdlcEx API Functions - OtxHdlcExXXX()

    The API functions for the host-based High-level Data Link Controller (HDLC) device

    OtxHdlcExXXX() Function Reference

  • OtxHdlcExClose
  • OtxHdlcExCreate
  • OtxHdlcExDisable
  • OtxHdlcExEnable
  • OtxHdlcExGetFifoStats
  • OtxHdlcExProcessIO
  • OtxHdlcExProcessIOBulk
  • OtxHdlcExProcessIOBulkEx
  • OtxHdlcExProcessIOEx
  • OtxHdlcExReadData
  • OtxHdlcExReceiverInit
  • OtxHdlcExReset
  • OtxHdlcExSendData
  • OtxHdlcExSenderInit
  • OtxHdlcExSetCallback
  • OtxHdlcExSetCallbackEx
  • OtxHdlcExSetTimeSlotMask
  • OtxHdlcExSS7GetFilter
  • OtxHdlcExSS7GetReceiveStatus
  • OtxHdlcExSS7SendData
  • OtxHdlcExSS7SetFilter
  • OtxHdlcExStartRepeatData
  • OtxHdlcExStopRepeatData

  • OtxHdlcEx.h


  • OtxHdlcExClose
  • OtxHdlcExCreate
  • OtxHdlcExDisable
  • OtxHdlcExEnable
  • OtxHdlcExGetFifoStats
  • OtxHdlcExProcessIO
  • OtxHdlcExProcessIOBulk
  • OtxHdlcExProcessIOBulkEx
  • OtxHdlcExProcessIOEx
  • OtxHdlcExReadData
  • OtxHdlcExReceiverInit
  • OtxHdlcExReset
  • OtxHdlcExSendData
  • OtxHdlcExSenderInit
  • OtxHdlcExSetCallback
  • OtxHdlcExSetCallbackEx
  • OtxHdlcExSetTimeSlotMask
  • OtxHdlcExSS7GetFilter
  • OtxHdlcExSS7GetReceiveStatus
  • OtxHdlcExSS7SendData
  • OtxHdlcExSS7SetFilter
  • OtxHdlcExStartRepeatData
  • OtxHdlcExStopRepeatData

  • OtxHdlcEx

    Filename: OtxHdlcEx.h

    Description

    Prototypes for the host-based HDLC Device (Sender/Receiver) Functions

    OtxHdlcExClose

    OTX_RESULT HDLCX_API OtxHdlcExClose(IN HDLCX_HANDLE hDevice)
    Destroy HDLC-device
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device

    OtxHdlcExCreate

    OTX_RESULT HDLCX_API OtxHdlcExCreate(IN OtxLogicalDeviceTypeE eDevType, IN OTX_HANDLE hEventQueue, IN OTX_INT32 nEventSourceId, OUT HDLCX_HANDLE * phLogicDevice)
    Creates software HDLC-device
    Defined in: OtxHdlcEx.h

    Parameters

    eDevType
    Class of device we are looking for, as known by the module in question. See also OtxLogicalDeviceTypeE
    hEventQueue
    Handle to separate event queue (0 creates device specific event queue)
    nEventSourceId
    User specified ID to be used by this device as the Source ID for the events generated by the device
    phLogicDevice
    Handle to the new logical device (if result code OTX_S_OK)

    OtxHdlcExDisable

    OTX_RESULT HDLCX_API OtxHdlcExDisable(IN HDLCX_HANDLE hDevice)
    Disable HDLC-device
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device

    Developer Notes

    Stops data processing for this device. You can continue to fill IO data to device, but they will be skipped

    OtxHdlcExEnable

    OTX_RESULT HDLCX_API OtxHdlcExEnable(IN HDLCX_HANDLE hDevice)
    Enable HDLC-device
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device

    Developer Notes

    Call this function after device have been created and configured

    OtxHdlcExGetFifoStats

    OTX_RESULT HDLCX_API OtxHdlcExGetFifoStats(IN HDLCX_HANDLE hHdlcDevice, OUT OTX_UINT32 * pcoFrameBuffer, OUT OTX_UINT32 * pcbOctetBuffer, OUT OTX_UINT32 * pcbOctetsInUse, OUT OTX_UINT32 * pcoFramesInUse, OUT OTX_UINT32 * pcbOctetsPeakUse, OUT OTX_UINT32 * pcoFramesPeakUse, OUT OTX_UINT32 * pcoFramesLost)
    Retrieve internal FIFO statistics from an HDLC device
    Defined in: OtxHdlcEx.h

    Parameters

    hHdlcDevice
    Handle to the HDLC Device
    pcoFrameBuffer
    Maximum number of frames that the FIFO can contain for this device (if not limited by maximum number of bytes)
    pcbOctetBuffer
    Maximum number of bytes that the FIFO can contain for this device (if not limited by the number of frames)
    pcbOctetsInUse
    Number of bytes that the FIFO is currently using
    pcoFramesInUse
    Number of frames that the FIFO currently contains
    pcbOctetsPeakUse
    Maximum number of octets that the FIFO has ever used
    pcoFramesPeakUse
    Maximum number of frames that the FIFO has ever contained
    pcoFramesLost
    Number of frames lost due to a full FIFO condition

    OtxHdlcExProcessIO

    OTX_RESULT HDLCX_API OtxHdlcExProcessIO(IN HDLCX_HANDLE hDevice, IN OTX_UINT8* pDataBuf, IN OTX_UINT32 nBufLen, OUT OTX_UINT32* nBufUsed)
    IO Process function
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HDLCEX device
    pDataBuf
    Data buffer
    nBufLen
    Amount/Size of data buffer
    nBufUsed
    Upon return, amount of buffer used or filled

    Comments

    Need to call it both for sender and receiver. Because of Soft devices works with data buffers only, not with HW-devices. Usually data is arriving from OTX Burst Device. This case you will need to specify correct Burst Timeslot Mask for different boards. I.e.: For Thor2-PCI-Plus or Slephnir-1-PCI: 32 timeslots (1 span) per burst highway. OTX_UINT8 Mask[32]; Mask[1] = 0xff; OtxHdlcExSetTimeSlotMask(hDev,sizeof(Mask),Mask);

    For Thor8-PCI-Plus, Gimle-16-PCI-Plus 128 timeslots (4 spans) per burst highway. OTX_UINT8 Mask[128]; Mask[1+nSpan*32] = 0xff; OtxHdlcExSetTimeSlotMask(hDev,sizeof(Mask),Mask);

    So in burst processing thread better to pass all data received from burst device and filter data using HdlcEx internal logics using OtxHdlcExSetTimeSlotMask

    See Also

    OtxHdlcExProcessIO
    OtxHdlcExSetTimeSlotMask

    OtxHdlcExProcessIOBulk

    OTX_RESULT HDLCX_API OtxHdlcExProcessIOBulk(IN HDLCX_HANDLE * phDevice, IN OTX_UINT32 phDeviceSize, IN OTX_UINT32 nBufFrameLen, IN OTX_UINT8* pDataBuf, IN OTX_UINT32 nBufLen, OUT OTX_UINT32* nBufUsed)
    Bulk IO Process function
    Defined in: OtxHdlcEx.h

    Parameters

    phDevice
    pointer to array of handles to HDLCEX devices
    phDeviceSize
    size of handle array
    nBufFrameLen
    Size of a single frame of the data buffer
    pDataBuf
    Data buffer
    nBufLen
    Amount/Size of data buffer (multiple of phDeviceSize)
    nBufUsed
    Upon return, amount of buffer used or filled

    Comments

    Given an array of device handles, a single bulk buffer is processed. This routine can be called in lieu of calling OtxHdlcExProcessIO() for each device handle that contains data within a single buffer (example: data buffer read from Burst Device will contain data for many devices).

    It is good idea to use this function if you have multiple HdlcEx devices hosted onthe same Burst Highway.

    See Also

    OtxHdlcExProcessIO
    OtxHdlcExSetTimeSlotMask

    OtxHdlcExProcessIOBulkEx

    OTX_RESULT HDLCX_API OtxHdlcExProcessIOBulkEx(IN HDLCX_HANDLE * phDevice, IN OTX_UINT32 phDeviceSize, IN OTX_UINT32 nBufFrameLen, IN OTX_UINT8* pDataBuf, IN OTX_UINT32 nBufLen, IN OTX_UINT64 nFrameRefId, IN OTX_DATETIME dtFrameRefClock, OUT OTX_UINT32* nBufUsed)
    Bulk IO Process Extended function
    Defined in: OtxHdlcEx.h

    Parameters

    phDevice
    pointer to array of handles to HDLCEX devices
    phDeviceSize
    size of handle array
    nBufFrameLen
    Size of a single frame of the data buffer
    pDataBuf
    Data buffer
    nBufLen
    Amount/Size of data buffer (multiple of nBufFrameLen)
    nFrameRefId
    Reference ID of first frame in the buffer
    dtFrameRefClock
    Reference Time of first frame in the buffer
    nBufUsed
    Upon return, amount of buffer used or filled

    Comments

    Given an array of device handles, a single bulk buffer is processed. This routine can be called in lieu of calling OtxHdlcExProcessIO() for each device handle that contains data within a single buffer (example: data buffer read from Burst Device will contain data for many devices).

    This routine accepts frame reference data.

    See Also

    OtxHdlcExProcessIO

    OtxHdlcExProcessIOEx

    OTX_RESULT HDLCX_API OtxHdlcExProcessIOEx(IN HDLCX_HANDLE hDevice, IN OTX_UINT8* pDataBuf, IN OTX_UINT32 nBufLen, IN OTX_UINT64 nFrameRefId, IN OTX_DATETIME dtFrameRefClock, OUT OTX_UINT32* nBufUsed)
    IO Process Extended function
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HDLCEX device
    pDataBuf
    Data buffer
    nBufLen
    Amount/Size of data buffer
    nFrameRefId
    Reference ID of first frame in the buffer
    dtFrameRefClock
    Reference Time of first frame in the buffer
    nBufUsed
    Upon return, amount of buffer used or filled

    Comments

    Same as OtxHdlcExProcessIO(), except additional parameters are given to be used.

    This routine accepts frame reference data.

    This function differs from original OtxHdlcExProcessIO only by correct timestamps added to the messages. So if you will need to measure data correct arrive time - use it.

    See Also

    OtxHdlcExProcessIO

    OtxHdlcExReadData

    OTX_RESULT HDLCX_API OtxHdlcExReadData(OUT OTX_UINT8 * pDataBuf, IN OTX_UINT32 nBufLen, OUT OTX_UINT32 * pnFrameLen, OUT OTX_UINT32 * pnFrameSeq, OUT OtxHdlcFrameEndCodeE * pnFrameEndCode, OUT OTX_DATETIME * pnTimeStamp)
    Read received HDLC data from HDLC-receiver
    Defined in: OtxHdlcEx.h

    Parameters

    pDataBuf
    Data buffer for the received data
    nBufLen
    Length of the user data buffer
    pnFrameLen
    Length of the received HDLC frame
    pnFrameSeq
    Sequence number of the received HDLC frame (matches the number in the event queue)
    pnFrameEndCode
    Frame Status Code
    pnTimeStamp
    Timestamp of the last received octet of the frame

    OtxHdlcExReceiverInit

    OTX_RESULT HDLCX_API OtxHdlcExReceiverInit(IN HDLCX_HANDLE hDevice, IN OtxHdlcFrameFillTypeE eFrameFillType, IN OTX_INT32 nInterFrameTimeFill, IN OtxHdlcCrcModeE eCrcMode, IN OTX_BOOL bBitInversion, IN OTX_BOOL bAppendTxCrc, IN OtxHdlcTxRateE eTxRate, IN OTX_BOOL bEveryEventFlag)
    Initializate the HDLC Receiver.
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device
    eFrameFillType
    Fill character(s) to be send between HDLC frames. See also OtxHdlcFrameFillTypeE
    nInterFrameTimeFill
    Minimum No of interframe time characters between 2 HDLC frames (1=shared flags, 2=non-shared) Min value is 1. Max is 1024.
    eCrcMode
    Cyclic Redundancy Check (CRC) mode: 16-bit, 32-bit, or none. See also OtxHdlcCrcModeE
    bBitInversion
    If OTX_TRUE then all bits are inverted when transmitted and before received
    bAppendTxCrc
    If OTX_TRUE the HDLC device will append the CRC to the frame to be transmitted. If OTX_FALSE, the CRC is generated with software
    eTxRate
    HDLC Transmission Rate for V.110 and X.30 modes. See also OtxHdlcTxRateE
    bEveryEventFlag
    Use one event for one frame, otherwise sgenerate only first

    Comments

    Start HDLC operation with by calling the function OtxDrvEnable and stop it by calling the function OtxDrvDisable

    Example


    // initialize the HDLC Receiver
    result = OtxHdlcExReceiverInit(
    		  g_sqHdlcReceiver[i].hHandle,
    		  OTX_HDLC_FFT_FLAGS,
    		  2,
    		  OTX_HDLC_CRC16,
    		  OTX_FALSE,
    		  OTX_TRUE,
    		  OTX_HDLC_TR_NA,
    		  OTX_FALSE);
    

    See Also


    OtxExHdlcSenderInit
    OTX_LDEVICE_HDLC_SENDER
    OtxHdlcFrameFillTypeE
    OtxHdlcCrcModeE
    OtxHdlcTxRateE

    OtxHdlcExReset

    OTX_RESULT HDLCX_API OtxHdlcExReset(IN HDLCX_HANDLE hDevice)
    Reset HDLC-device
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device

    Developer Notes

    Resets all internal data counters and variables to the initial state. Usefull for clear buffers.

    OtxHdlcExSendData

    OTX_RESULT HDLCX_API OtxHdlcExSendData(IN HDLCX_HANDLE hDevice, IN OTX_UINT8 * sqData, IN OTX_UINT32 nDataLen, IN OTX_TASK_REF nTaskRef, IN OTX_TIME nWaitMaxMs)
    Sends HDLC data via HDLC-sender device
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device
    sqData
    Data to be sent
    nDataLen
    Length of the data to be send
    nTaskRef
    See OTX_TASK_REF
    nWaitMaxMs
    See OTX_TIME

    Example


    for (i = 0; i < 10; i++) {
      arMsg[i] = (OTX_UINT8) i;
    }
    
    // send one HDLC Frame
    result = OtxHdlcExSendData(
    	    g_hLogicDevs.hHdlcSender,
    	    arMsg,
    	    10,
    	    DEMO_TASK_REF,
    	    OTX_TIME_INFINITY);
    

    OtxHdlcExSenderInit

    OTX_RESULT HDLCX_API OtxHdlcExSenderInit(IN HDLCX_HANDLE hDevice, IN OtxHdlcFrameFillTypeE eFrameFillType, IN OTX_INT32 nInterFrameTimeFill, IN OtxHdlcCrcModeE eCrcMode, IN OTX_BOOL bBitInversion, IN OTX_BOOL bAppendTxCrc, IN OtxHdlcTxRateE eTxRate)
    Initializate the HDLC Sender.
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device
    eFrameFillType
    Fill character(s) to be send between HDLC frames. See also OtxHdlcFrameFillTypeE
    nInterFrameTimeFill
    Minimum No of interframe time characters between 2 HDLC frames (1=shared flags, 2=non-shared) Min value is 1. Max is 1024.
    eCrcMode
    Cyclic Redundancy Check (CRC) mode: 16-bit, 32-bit, or none. See also OtxHdlcCrcModeE
    bBitInversion
    If OTX_TRUE then all bits are inverted when transmitted and before received
    bAppendTxCrc
    If OTX_TRUE the HDLC device will append the CRC to the frame to be transmitted. If OTX_FALSE, the CRC is generated with software
    eTxRate
    HDLC Transmission Rate for V.110 and X.30 modes. See also OtxHdlcTxRateE

    Comments

    Start HDLC operation with by calling the function OtxDrvEnable and stop it by calling the function OtxDrvDisable.

    Example


    result = OtxHdlcExSenderInit(
    		  g_hLogicDevs.hHdlcSender,
    		  OTX_HDLC_FFT_FLAGS,
    		  2,
    		  OTX_HDLC_CRC16,
    		  OTX_FALSE,
    		  OTX_TRUE,
    		  OTX_HDLC_TR_NA);
    

    See Also


    OtxHdlcExReceiverInit
    OtxHdlcFrameFillTypeE
    OtxHdlcCrcModeE
    OtxHdlcTxRateE

    OtxHdlcExSetCallback

    OTX_RESULT HDLCX_API OtxHdlcExSetCallback(IN HDLCX_HANDLE hDevice, IN pHdlcExCallback pCallback)
    Use a callback routine in lieu of using an event queue for HDLCEX notifications.
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device
    pCallback
    Pointer to callback function. See pHdlcExCallback

    Comments

    Use it instead of specifying an hEventQueue when calling OtxHdlcExCreate
    This enhances performance in high load situations. The callback is called whenever an HDLC frame is ready.

    Example


    ...
    result = OtxHdlcExSetCallback(g_sqHdlcReceiver[i].hHandle, MyCallback);
    ...
    
    pHdlcExCallback MyCallback(OtxEventDataS *pEventData)
    {
      OTX_RESULT            result;
      OTX_UINT8             buf[0x3000];
      OTX_UINT32            nFrameLen;
      OTX_UINT32            nFrameSeq;
      OtxHdlcFrameEndCodeE  nFrameEndCode;
      OTX_DATETIME          nTimeStamp;
    
      otxRc = OtxHdlcExReadData(pEventData->m_hDevice, buf, sizeof(buf), &nFrameLen, &nFrameSeq, &nFrameEndCode, &nTimeStamp);
    }
    

    See Also


    pHdlcExCallback

    OtxHdlcExSetCallbackEx

    OTX_RESULT HDLCX_API OtxHdlcExSetCallbackEx(IN HDLCX_HANDLE hDevice, IN pHdlcExCallbackEx pCallbackEx, IN void * pContext)
    Use a callback routine in lieu of using an event queue for HDLCEX notifications. This routine allows for an additional context to be passed back to the callback.
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device
    pCallbackEx
    Pointer to callback function. See pHdlcExCallbackEx
    pContext
    Context to be passed to the callback

    Comments

    Use it instead of specifying an hEventQueue when calling OtxHdlcExCreate
    This enhances performance in high load situations. The callback is called whenever an HDLC frame is ready.

    typedef void (*pHdlcExCallbackEx)(OtxEventDataS *, void *);

    Example


    void ReceiverCallbackEx(OtxEventDataS *pEventData, void *pContext);
    
    class MyReceiver: public:
    
    private
       friend void ReceiverCallbackEx(OtxEventDataS *pEventData, void *pContext);
    
    protected:
       void MyCallback(OtxEventDataS *pEventData);
    
       HDLCX_HANDLE hHandle;
    };
    
    
    void _cdecl ReceiverCallbackEx(OtxEventDataS *pEventData, void *pContext)
    {
       MyReceiver *pMyReceiver = (MyReceiver *) pContext;
       pMyReceiver->MyCallback(pEventData);
    }
    
    
    void MyReceiver::Init()
    {
       OTX_RESULT result;
    
       result = OtxHdlcExCreate(OTX_LDEVICE_HDLC_RECEIVER, OTX_INVALID_HANDLE_VALUE, 0, &hHandle);
       result = OtxHdlcExSetCallbackEx(hHandle, ReceiverCallbackEx, (void *) this);
    }
    
    
    void MyReceiver::MyCallback(OtxEventDataS *pEventData)
    {
      OTX_RESULT            result;
      OTX_UINT8             buf[0x3000];
      OTX_UINT32            nFrameLen;
      OTX_UINT32            nFrameSeq;
      OtxHdlcFrameEndCodeE  nFrameEndCode;
      OTX_DATETIME          nTimeStamp;
    
      assert(pEventData->m_hDevice == hDevice);
      otxRc = OtxHdlcExReadData(pEventData->m_hDevice, buf, sizeof(buf), &nFrameLen, &nFrameSeq, &nFrameEndCode, &nTimeStamp);
    }
    

    See Also


    OtxHdlcExSetCallback
    pHdlcExCallbackEx

    OtxHdlcExSetTimeSlotMask

    OTX_RESULT HDLCX_API OtxHdlcExSetTimeSlotMask(IN HDLCX_HANDLE hDevice)
    Filters particular timeslots in data IO buffer used by OtxHdlcExProcessIO
    Defined in: OtxHdlcEx.h

    Parameters

    hDevice
    Handle to the HdlcEx device

    Comments

    Use it instead of OtxDrvConnectPipe in HW OTX API.

    Example


    OTX_UINT8 TimeSlotMask[32];
    
    memset(TimeSlotMask,0,sizeof(TimeSlotMask);
    TimeSlotMask[0] = 0xff;
    
    result = OtxHdlcExSetTimeSlotMask(
    	   g_sqHdlcReceiver[i].hHandle,
    	   sizeof(TimeSlotMask),
    	   &TimeSlotMask[0]);
    

    Developer Notes

    For solid IO buffers i.e. contained only one timeslot data call it with parameters: coTimeSlotMask=1 and TimeSlotMask[0]=0xff

    OtxHdlcExSS7GetFilter

    OTX_RESULT HDLCX_API OtxHdlcExSS7GetFilter(IN HDLCX_HANDLE hHdlcDevice, OUT OTX_UINT32 * pFilterMask)
    Returns the currently active filter mask for filtering out FISUs, LSSUs and/or MSUs
    Defined in: OtxHdlcEx.h

    Parameters

    hHdlcDevice
    Handle to the HDLC Device
    pFilterMask
    Currently active Filter Mask (see HDLC_SS7_FILTER_XXXX Macros)

    Example


    OTX_HANDLE hHandle;
    OTX_UINT32 filterMask;
    
    hHandle = g_sqDspHdlcReceiver.hHandle;
    
    // toggle OTX_HDLC_SS7_FILTER_FISU_ALL filter mask on/off
    result = OtxHdlcExSS7GetFilter(
    	    hHandle,
    	    &filterMask);
    
    if (filterMask & OTX_HDLC_SS7_FILTER_FISU_ALL) {
      filterMask &= ~OTX_HDLC_SS7_FILTER_FISU_ALL;
    } else {
      filterMask |= OTX_HDLC_SS7_FILTER_FISU_ALL;
    }
    
    // reset the filter mask
    result = OtxHdlcSS7SetFilter(
    	    hHandle,
    	    filterMask);
    

    See Also

    OtxHdlcExSS7SetFilter

    OtxHdlcExSS7GetReceiveStatus

    OTX_RESULT HDLCX_API OtxHdlcExSS7GetReceiveStatus(IN HDLCX_HANDLE hHdlcDevice, OUT OTX_UINT32 * pnFisuCount, OUT OTX_UINT32 * pnLssuCount, OUT OTX_UINT32 * pnMsuCount, OUT OtxHdlcSS7FisuS * pFisu)
    Get the status and statistics of the incoming SS7 link on a specified pipe
    Defined in: OtxHdlcEx.h

    Parameters

    hHdlcDevice
    Handle to the HDLC Device
    pnFisuCount
    Number of FISUs received
    pnLssuCount
    Number of LSSUs received
    pnMsuCount
    Number of MSUs received
    pFisu
    The last received FISU on the pipe. See also OtxHdlcSS7FisuS

    Example


    OTX_UINT32  nFisuCount;   // Number of FISUs received
    OTX_UINT32  nLssuCount;   // Number of LSSUs received
    OTX_UINT32  nMsuCount;    // Number of MSUs received
    OtxHdlcSS7FisuS fisu;     // The last received FISU on the pipe.
    
    result = OtxHdlcExSS7GetReceiveStatus(
    	    hHandle,
    	    &nFisuCount,
    	    &nLssuCount,
    	    &nMsuCount,
    	    &fisu);
    
    // print out status
    if (OTX_SUCCESS(result)) {
      DemoLogf("FISUs received: %lu\\n", nFisuCount);
      DemoLogf("LSSUs received: %lu\\n", nLssuCount);
      DemoLogf("MSUs  received: %lu\\n", nMsuCount);
      DemoLogf("Last FISU received: bsn = %d, bib = %d, fsn = %d, fib = %d,
    	    li = %d\\n", fisu.bsn, fisu.bib, fisu.fsn, fisu.fib, fisu.li);
    }
    

    See Also

    OtxHdlcExSS7SetFilter
    OtxHdlcExSS7GetFilter
    OtxHdlcExSS7FisuS

    OtxHdlcExSS7SendData

    OTX_RESULT HDLCX_API OtxHdlcExSS7SendData(IN HDLCX_HANDLE hHdlcDevice, IN OTX_UINT8 * psqData, IN OTX_UINT32 nDataLen, OtxHdlcSS7FisuS * pFisu, IN OTX_TASK_REF nTaskRef, IN OTX_TIME nWaitMaxMs)
    Send a message (LSSU, MSU, or arbitrary data) on a SS7 pipe. After the sending of the message has been completed, continues sending the new FISU provided as a parameter to the function.
    Defined in: OtxHdlcEx.h

    Parameters

    hHdlcDevice
    Handle to the Logical HDLC Device
    psqData
    Data (MSU, LSSU, or other arbitrary frame) to be sent
    nDataLen
    Length of the data to be sent
    pFisu
    Next FISU to be sent after the data
    nTaskRef
    See OTX_TASK_REF
    nWaitMaxMs
    See OTX_TIME

    Example


    OtxHdlcSS7FisuS msu;
    OtxHdlcSS7FisuS *pFisu;
    OTX_UINT8 sqHdlcFrame[300];
    
    memcpy(&msu, pFisu, OTX_HDLC_SS7_CB_FISU);        // Build the first 3 bytes of the MSU
    msu.li = 10 - OTX_HDLC_SS7_CB_FISU;               // Set the Length Indicator
    memcpy(sqHdlcFrame, &msu, OTX_HDLC_SS7_CB_FISU);  // Put the first 3 bytes of the MSU in the HDLC frame buffer
    for (i = OTX_HDLC_SS7_CB_FISU; i < 10; i++) {     // Add the payload the HDLC frame buffer
      sqHdlcFrame[i + OTX_HDLC_SS7_CB_FISU] = (OTX_UINT8) i;
    }
    
    // Send MSU Frame with length of 10
    result = OtxHdlcExSS7SendData(
    	    g_sqDspHdlcSender.hHandle,
    	    sqHdlcFrame,
    	    10,
    	    pFisu,
    	    DEMO_TASK_REF,
    	    OTX_TIME_INFINITY);
    

    See Also

    OtxHdlcExSendData

    OtxHdlcExSS7SetFilter

    OTX_RESULT HDLCX_API OtxHdlcExSS7SetFilter(IN HDLCX_HANDLE hHdlcDevice, IN OTX_UINT32 filterMask)
    Set the filter mask for the filtering out FISUs, LSSUs, and/or MSUs
    Defined in: OtxHdlcEx.h

    Parameters

    hHdlcDevice
    Handle to the HDLC Pipe
    filterMask
    Filter Mask (see HDLC_SS7_FILTER_XXXX Macros)

    Comments

    It should be used after HDLC receiver device is initialized

    Example


    // set filter mask on 2 DSP
    
      // Initialize the Hdlc Receiver
      result = OtxHdlcExReceiverInit(
    	      hReceiver,
    	      OTX_HDLC_FFT_FLAGS,
    	      1,
    	      OTX_HDLC_CRC16,
    	      OTX_FALSE,
    	      OTX_FALSE,
    	      OTX_HDLC_TR_NA,
    	      OTX_TRUE
        );
    
      result = OtxHdlcExSS7SetFilter(
    	      hReceiver,
    	      OTX_HDLC_SS7_FILTER_FISU | OTX_HDLC_SS7_FILTER_SHORT_LSSU | OTX_HDLC_SS7_FILTER_LONG_LSSU);
    

    See Also

    OtxHdlcExSS7GetFilter

    OtxHdlcExStartRepeatData

    OTX_RESULT HDLCX_API OtxHdlcExStartRepeatData(IN HDLCX_HANDLE hHdlcDevice, IN OTX_UINT8 * psqData, IN OTX_UINT32 nDataLen, IN OTX_TASK_REF nTaskRef, IN OTX_TIME nWaitMaxMs)
    Load an HDLC frame to be repeated for the HDLC pipe and begin transmission. The Repeat Data is an HDLC frame which will be sent continuosly when there is no other user data frames to be sent. User data can be sent with OtxHdlcExSendData function on which case the user data frame in interleaved between two consecutive Repeat Data frames. After the sending of user data frame has been completed, the HDLC controller will resume the sending of the Repeat Data frame.

    This function can be used to continously send SS7 FISUs or LSSUs.
    Defined in: OtxHdlcEx.h

    Parameters

    hHdlcDevice
    Handle to the HDLC Device
    psqData
    Repeat Data frame to be sent
    nDataLen
    Length of the data frame to be sent
    nTaskRef
    See OTX_TASK_REF
    nWaitMaxMs
    See OTX_TIME

    Example


    OTX_UINT8 *pRepeatFrame = (OTX_UINT8 *)"\\x10\\x11\\x12\\x13\\x14";
    OTX_HANDLE hHandle;
    
    hHandle = g_sqDspHdlcSender.hHandle;
    
    // start Repeat Data Frames with length of 5 from HDLC Sender
    result = OtxHdlcExStartRepeatData(
    	    hHandle,
    	    pRepeatFrame,
    	    5,
    	    DEMO_TASK_REF,
    	    OTX_TIME_INFINITY);
    

    See Also

    OtxHdlcExStopRepeatData

    OtxHdlcExStopRepeatData

    OTX_RESULT HDLCX_API OtxHdlcExStopRepeatData(IN HDLCX_HANDLE hHdlcDevice)
    Stop sending of Repeat Data frames on a specified HDLC pipe.
    Defined in: OtxHdlcEx.h

    Parameters

    hHdlcDevice
    Handle to the HDLC Device

    Example


    OTX_HANDLE hHandle;
    
    hHandle = g_sqDspHdlcSender.hHandle;
    
    // stop Repeat Data Frames from HDLC Sender
    result = OtxHdlcExStopRepeatData(hHandle);
    

    See Also

    OtxHdlcExStartRepeatData

    pHdlcExCallback

    Callback function pointer for HDLCEX
    Defined in: OtxHdlcEx.h

    pHdlcExCallbackEx

    Extended callback function pointer for HDLCEX
    Defined in: OtxHdlcEx.h