Table of Contents Index NMS Glossary Previous Page Next Page (Page 8 of 32 in this chapter) Version


NMS_GR303PhSendData

Description

Sends an LAPD frame to a specified HDLC channel.

Prototype

NMS_GR303_RESULT_T NMS_GR303PhSendData
(NMS_GR303_INTERFACE_ID_T interfaceId,
NMS_GR303_CHANNEL_LOCATION_T channel_loc,
DWORD number_bytes,
void *lapd_data)

interfaceId Interface ID of a provisioned interface.

channel_loc HDLC channel location to which the NMS GR3030 library sends the data.

            typedef union _NMS_GR303_CHANNEL_LOCATION_T
        {
        struct {
        DWORD  boardNb;
        DWORD  trunkNb;
        DWORD  timeslotNb;          
        } CG;        
}NMS_GR303_CHANNEL_LOCATION_T
number_bytes Size of the LAPD frame in bytes. The maximum number of bytes is 260.

lapd_data Pointer to an application buffer containing the LAPD frame to send.

Return Values

Events

Details

This function is asynchronous and returns without waiting for the board to report the send operation result. The specified interface must be started when the application calls NMS_GR303PhSendData.

The information in the NMS_GR303_CHANNEL_LOCATION_T structure includes the following:
Parameter

Description

boardNb

Logical board number where an HDLC instance is located.

trunkNb

Logical trunk number associated with the HDLC instance.

timeslotNb

Physical timeslot number associated with the HDLC instance.

The result of the send operation is reported later through the following application-defined callback structure:

      typedef void(*NMS_GR303_CHANNEL_CALLBACK_T)
(NMS_GR303_INTERFACE_ID_T interfaceId,
NMS_GR303_CHANNEL_LOCATION_T channel_loc, NMS_GR303_CHANNEL_EVENT_T channel_event, void *databuffer, DWORD datasize);
The NMS GR303 library invokes the callback with the channel_event parameter set to a transmission result value. The transmission result is passed to the application, but the result does not indicate the send request with which it is associated.

Transmission results reported to the application can include any of the following defined values:
Event Name

Board Event

NMSGR303_EVENT_TX_SUCCESS

Not supported.

NMSGR303_EVENT_TX_ERROR

Internal HDLC transmit error occurred.
No buffer is attached to this error.

NMSGR303_EVENT_TX_FIFO_
UNDERRUN

HDLC transmit FIFO underrun. No buffer is attached to this error.

NMSGR303_EVENT_TX_FIFO_
OVERRUN

HDLC transmit FIFO overrun. No buffer is attached to this error.

NMSGR303_EVENT_TX_QUEUE_
FULL

The error indicates that the internal send queue is full and indicates an abnormal send rate. No buffer is attached to this error.

See Also

NMS_GR303StartInterface

Example

void SendData(BYTE  *FrameBuffer, DWORD NumberBytes )
{
 NMS_GR303_RESULT_T     NmsResult;
 DWORD                  InterfaceId;    
 NMS_GR303_CHANNEL_LOCATION_T   ChannelLocation;   

    printf("SendData:\n");    

     /* Get parameters */
     promptdw_nodft("Enter interfaceId", &InterfaceId);

    printf("Enter channel location:\n");
     GetChannelLocationNMS( &ChannelLocation );     
    
 NmsResult = NMS_GR303PhSendData( InterfaceId,
             ChannelLocation,
             NumberBytes,
             FrameBuffer );

  printf ("PhSendData: Result=%s\n",PRINT_RESULT(NmsResult));
}




Table of Contents Index NMS Glossary Previous Page Next Page (Page 8 of 32 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, NMS Communications Corporation. All rights reserved.