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


NMS_V5PhSendData

Description

Sends an LAPV frame to a specified HDLC channel.

Prototype

NMS_V5_RESULT_T NMS_V5PhSendData
(NMS_GR303_INTERFACE_ID_T interfaceId,
NMS_V5_CHANNEL_LOCATION_T channel_loc,
DWORD number_bytes,
void *lapv_data)

interfaceId Interface ID of a provisioned interface.

channel_loc HDLC channel location to which to send data.

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

lapv_data Pointer to an application buffer containing the LAPV frame to send.

Return Values

Events

None.

Details

This function is asynchronous and returns without waiting for the board to report the result of the send operation. The application must start the interface before it calls NMS_V5PhSendData.

If an error occurs during the transmission, the error is reported to the application by the following application-defined callback:

       typedef void( *NMS_V5_CHANNEL_CALLBACK_T )
            ( NMS_V5_INTERFACE_ID_T interfaceId,
              NMS_V5_CHANNEL_LOCATION_T channel_loc, 
              NMS_V5_CHANNEL_EVENT_T channel_event,
              void *databuffer, 
              DWORD datasize);               
To return error information, the NMS V5 library invokes an application-defined callback (channel_callback) and specifies the type of transmit error in the channel_event field. When the NMS V5 library returns a transmission error, it does not indicate the send request with which the error is associated.

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

Description

NMSV5_EVENT_TX_SUCCESS

Not supported.

NMSV5_EVENT_TX_ERROR

Internal HDLC transmit error occurred
(no buffer is returned). Returned by a
NMS_V5PhSendData call.

NMSV5_EVENT_TX_FIFO_
UNDERRUN

HDLC transmit FIFO underrun (no buffer is returned).

NMSV5_EVENT_TX_FIFO_
OVERRUN

HDLC transmit FIFO overrun (no buffer is returned).

NMSV5_EVENT_TX_FIFO_QUEUE_FULL

HDLC transmit send queue is full (no buffer is returned). This error should not occur under normal circumstances.

See Also

NMS_V5StartInterface

Example

void SendData(BYTE  *FrameBuffer, DWORD NumberBytes )
{
NMS_V5_RESULT_T      NmsResult;
DWORD      InterfaceId;    
NMS_V5_CHANNEL_LOCATION_T      ChannelLocation;   

printf("SendData:\n");    

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

printf("Enter channel location:\n");
GetChannelLocationNMS( &ChannelLocation );     
    
NmsResult = NMS_V5PhSendData( InterfaceId,
                              ChannelLocation,
                              NumberBytes,
                              FrameBuffer );
printf ("PhSendData: Result=%s\n",PRINT_RESULT(NmsResult));
}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 23 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.