<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">

<html>

<head>
<title>NaturalAccess GR303 and V5 Libraries Developer's Manual: NMS_GR303PhSendData </title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta name=NMSConversion content="4.0.8">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
<link rel="stylesheet" href="dialogic_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
<!--
if (navigator.appName !="Netscape")
{   document.write("<link rel='stylesheet' href='dialogic.css'>");}
//-->
</script>
<style type="text/css">
<!--
table.whs1 { width:100%;   x-border-left:1px table-solid; x-border-top:1px table-solid; x-border-right:1px table-solid; x-border-bottom:1px table-solid; border-collapse:separate; border-spacing:0px; }
col.whs2 { width:15.453%; }
col.whs3 { width:84.547%; }
td.whs4 { background-color:#CCCCCC; vertical-align:top;   padding-right:10px; padding-left:10px; }
p.whs5 { font-weight:bold; }
td.whs6 { background-color:#ffffff; vertical-align:top;   padding-right:10px; padding-left:10px; }
p.whs7 { font-style:italic; font-weight:bold; }
col.whs8 { width:31.712%; }
col.whs9 { width:68.288%; }
table.whs10 {   x-border-left:1px table-solid; x-border-top:1px table-solid; x-border-right:1px table-solid; x-border-bottom:1px table-solid; border-spacing:0px; border-collapse:separate; width:100%; }
col.whs11 { width:34.944%; }
col.whs12 { width:65.056%; }
tr.whs13 { background-color:#CCCCCC; x-cell-content-align:top; vertical-align:top; }
td.whs14 { vertical-align:top; padding-left:5px;  padding-right:5px;  }
tr.whs15 { x-cell-content-align:top; vertical-align:top; }
table.whs16 {   x-border-left:1px table-solid; x-border-top:1px table-solid; x-border-right:1px table-solid; x-border-bottom:1px table-solid; border-collapse:separate; border-spacing:0px; width:100%; }
col.whs17 { width:10.477%; }
col.whs18 { width:89.523%; }
div.whs19 { width:100%; }
p.whs20 { text-align:center; }
p.whs21 { text-align:center; font-size:xx-small; }
-->
</style><script type="text/javascript" language="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
{
  var strNSS = "<style type='text/css'>";
  strNSS += "p.whs21 {font-size:x-small; }";
  strNSS +="</style>";
  document.write(strNSS);
}
//-->
</script>
<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
  if (innerWidth != origWidth || innerHeight != origHeight)
     location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	onresize = reDo;
}
onerror = null; 
//-->
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
-->
</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
<script type="text/javascript" language="javascript" src="whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
</head>
<body><script type="text/javascript" language="javascript1.2">
<!--
if (window.gbWhTopic)
{
	if (window.addTocInfo)
	{
	addTocInfo("NMS GR303 function reference\nNMS_GR303PhSendData");
addAvenueInfo("Untitled","nmsgr303modifychannellocation.html","nmsgr303provisioninterface.html");
addButton("show",BTN_TEXT,"Show table of contents for this manual","","","","",0,0,"","","");

	}
	if (window.writeBtnStyle)
		writeBtnStyle();

	if (window.writeIntopicBar)
		writeIntopicBar(1);

	if (window.setRelStartPage)
	{
	setRelStartPage("default.htm");

		autoSync(1);
		sendSyncInfo();
		sendAveInfoOut();
	}
}
else
	if (window.gbIE4)
		document.location.reload();
//-->
</script>
<h1>NMS_GR303PhSendData</h1>

<p>Sends a LAPD frame to a specified HDLC channel.</p>

<h4>Prototype</h4>

<p>NMS_GR303_RESULT_T <span style="font-weight: bold;"><B>NMS_GR303PhSendData</B></span> 
 ( NMS_GR303_INTERFACE_ID_T <span style="font-style: italic; font-weight: bold;"><I><B>interfaceId</B></I></span>, 
 NMS_GR303_CHANNEL_LOCATION_T <span style="font-style: italic; font-weight: bold;"><I><B>channel_loc</B></I></span>, 
 DWORD <span style="font-style: italic; font-weight: bold;"><I><B>number_bytes</B></I></span>, 
 void <span style="font-style: italic; font-weight: bold;"><I><B>*lapd_data</B></I></span>)</p>

<table cellpadding="5" x-use-null-cells cellspacing="0" width="100%" border="1" class="whs1">
<col class="whs2">
<col class="whs3">

<tr>
<td bgcolor="#CCCCCC" width="15.453%" class="whs4">
<p class="whs5">Argument</p></td>
<td bgcolor="#CCCCCC" width="84.547%" class="whs4">
<p class="whs5">Description</p></td></tr>

<tr>
<td bgcolor="#FFFFFF" width="15.453%" class="whs6">
<p class="whs7">interfaceId</p></td>
<td bgcolor="#FFFFFF" width="84.547%" class="whs6">
<p>Interface ID of a provisioned interface.</p></td></tr>

<tr>
<td bgcolor="#FFFFFF" width="15.453%" class="whs6">
<p class="whs7">channel_loc</p></td>
<td bgcolor="#FFFFFF" width="84.547%" class="whs6">
<p>HDLC channel location to which the NMS GR303 library sends the data.</p>
<p class=Example>typedef&nbsp;union&nbsp;_NMS_GR303_CHANNEL_LOCATION_T<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;&nbsp;boardNb;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;&nbsp;trunkNb;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;&nbsp;timeslotNb;<br>
 &nbsp;}&nbsp;CG;<br>
}NMS_GR303_CHANNEL_LOCATION_T</p>
<p>See the <a href="#Details">Details</a> section for field descriptions.</p></td></tr>

<tr>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="15.453%" class="whs6">
<p class="whs7">number_bytes</p></td>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="84.547%" class="whs6">
<p>Size of the LAPD frame in bytes. The maximum number of bytes is 260.</p></td></tr>

<tr>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="15.453%" class="whs6">
<p class="whs7">lapd_data</p></td>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="84.547%" class="whs6">
<p>Pointer to an application buffer containing the LAPD frame to send.</p></td></tr>
</table><br>

<h4>Return values</h4>

<table cellpadding="5" x-use-null-cells cellspacing="0" width="100%" border="1" class="whs1">
<col class="whs8">
<col class="whs9">

<tr>
<td bgcolor="#CCCCCC" width="31.712%" class="whs4">
<p class="whs5">Return value</p></td>
<td bgcolor="#CCCCCC" width="68.288%" class="whs4">
<p class="whs5">Description</p></td></tr>

<tr>
<td bgcolor="#FFFFFF" width="31.712%" class="whs6">
<p>NMSGR303_SUCCESS</p></td>
<td bgcolor="#FFFFFF" width="68.288%" class="whs6">
<p>&nbsp;</p></td></tr>

<tr>
<td bgcolor="#FFFFFF" width="31.712%" class="whs6">
<p>NMSGR303_INTERNAL_FAILURE</p></td>
<td bgcolor="#FFFFFF" width="68.288%" class="whs6">
<p>Internal failure. Refer to the trace log for more information.</p></td></tr>

<tr>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="31.712%" class="whs6">
<p>NMSGR303_INVALID_CHANNEL</p></td>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="68.288%" class="whs6">
<p>Specified HDLC channel is not provisioned on this interface.</p></td></tr>

<tr>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="31.712%" class="whs6">
<p>NMSGR303_INVALID_INTERFACE_ID</p></td>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="68.288%" class="whs6">
<p>Specified interface is not provisioned.</p></td></tr>

<tr>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="31.712%" class="whs6">
<p>NMSGR303_INVALID_PARMS</p></td>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="68.288%" class="whs6">
<p><span style="font-style: italic; font-weight: bold;"><I><B>lapd_data</B></I></span> 
 buffer pointer is NULL.</p></td></tr>

<tr>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="31.712%" class="whs6">
<p>NMSGR303_INVALID_STATE</p></td>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="68.288%" class="whs6">
<p>Interface is not started.</p></td></tr>

<tr>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="31.712%" class="whs6">
<p>NMSGR303_NOT_INITIALIZED</p></td>
<td colspan="1" rowspan="1" bgcolor="#FFFFFF" width="68.288%" class="whs6">
<p>NMS GR303 library was not initialized with <a href="nmsgr303initialize.html"><span 
 style="color: #0000ff;
		font-weight: bold;
		x-text-underline: off;
		/*begin!kadov{{*/ text-decoration: none; /*}}end!kadov*/ "><font color=blue ><B>NMS_GR303Initialize</B></font></span></a>.</p></td></tr>
</table><br>

<h4>Events</h4>

<table cellpadding="5" x-use-null-cells width="100%" cellspacing="0" border="1" class="whs10">
<col class="whs11">
<col class="whs12">

<tr bgcolor="#CCCCCC" valign="top" class="whs13">
<td width="34.944%" class="whs14">
<p class="whs5">Event</p></td>
<td width="65.056%" class="whs14">
<p class="whs5">Description</p></td></tr>

<tr valign="top" class="whs15">
<td width="34.944%" class="whs14">
<p><span style="color: #000000;
				font-style: normal;
				font-weight: normal;
				x-text-underline: off;
				x-text-overline: off;
				x-text-line-through: off;
				text-transform: none;
				vertical-align: baseline;
				/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=black >NMSGR303_EVENT_TX_ERROR</font></span></p></td>
<td width="65.056%" class="whs14">
<p>Internal HDLC transmit error occurred. No buffer is attached to this 
 error.</p></td></tr>

<tr valign="top" class="whs15">
<td width="34.944%" class="whs14">
<p><span style="color: #000000;
				font-style: normal;
				font-weight: normal;
				x-text-underline: off;
				x-text-overline: off;
				x-text-line-through: off;
				text-transform: none;
				vertical-align: baseline;
				/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=black >NMSGR303_EVENT_TX_FIFO_UNDERRUN</font></span></p></td>
<td width="65.056%" class="whs14">
<p>HDLC transmit FIFO underrun. No buffer is attached to this error. Not 
 supported for CG 6100C or CG 6500C boards.</p></td></tr>

<tr valign="top" class="whs15">
<td width="34.944%" class="whs14">
<p><span style="color: #000000;
				font-style: normal;
				font-weight: normal;
				x-text-underline: off;
				x-text-overline: off;
				x-text-line-through: off;
				text-transform: none;
				vertical-align: baseline;
				/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=black >NMSGR303_EVENT_TX_FIFO_OVERRUN</font></span></p></td>
<td width="65.056%" class="whs14">
<p>HDLC transmit FIFO overrun. No buffer is attached to this error.</p></td></tr>

<tr valign="top" class="whs15">
<td width="34.944%" class="whs14">
<p><span style="color: #000000;
				font-style: normal;
				font-weight: normal;
				x-text-underline: off;
				x-text-overline: off;
				x-text-line-through: off;
				text-transform: none;
				vertical-align: baseline;
				/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=black >NMSGR303_EVENT_TX_QUEUE_FULL</font></span></p></td>
<td width="65.056%" class="whs14">
<p>The error indicates that the internal send queue is full and indicates 
 an abnormal send rate. No buffer is attached to this error. Not supported 
 for CG 6100C or CG 6500C boards.</p></td></tr>
</table><br>

<h4><a name=Details></a>Details</h4>

<p><span style="font-weight: bold;"><B>NMS_GR303PhSendData</B></span>&nbsp;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 <a href="nmsgr303phsenddata.html"><span style="color: #0000ff;
														font-weight: bold;
														x-text-underline: off;
														/*begin!kadov{{*/ text-decoration: none; /*}}end!kadov*/ "><font color=blue ><B>NMS_GR303PhSendData</B></font></span></a>.</p>

<p>The <span style="color: #000000;
					font-style: normal;
					font-weight: normal;
					x-text-underline: off;
					x-text-overline: off;
					x-text-line-through: off;
					text-transform: none;
					vertical-align: baseline;
					/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=black >NMS_GR303_CHANNEL_LOCATION_T 
 </font></span>structure includes the following information:</p>

<table cellpadding="5" x-use-null-cells width="100%" cellspacing="0" border="1" class="whs16">
<col class="whs17">
<col class="whs18">

<tr bgcolor="#CCCCCC" valign="top" class="whs13">
<td width="10.477%" class="whs14">
<p class="whs5">Field</p></td>
<td width="89.523%" class="whs14">
<p class="whs5">Description</p></td></tr>

<tr valign="top" class="whs15">
<td width="10.477%" class="whs14">
<p><span style="color: #000000;
				font-style: normal;
				font-weight: normal;
				x-text-underline: off;
				x-text-overline: off;
				x-text-line-through: off;
				text-transform: none;
				vertical-align: baseline;
				/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=black >boardNb</font></span></p></td>
<td width="89.523%" class="whs14">
<p>Logical board number where an HDLC instance is located (as defined by 
 NMS OAM).</p></td></tr>

<tr valign="top" class="whs15">
<td width="10.477%" class="whs14">
<p><span style="color: #000000;
				font-style: normal;
				font-weight: normal;
				x-text-underline: off;
				x-text-overline: off;
				x-text-line-through: off;
				text-transform: none;
				vertical-align: baseline;
				/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=black >trunkNb</font></span></p></td>
<td width="89.523%" class="whs14">
<p>Logical trunk number associated with the HDLC instance (as defined by 
 NMS OAM).</p></td></tr>

<tr valign="top" class="whs15">
<td width="10.477%" class="whs14">
<p><span style="color: #000000;
				font-style: normal;
				font-weight: normal;
				x-text-underline: off;
				x-text-overline: off;
				x-text-line-through: off;
				text-transform: none;
				vertical-align: baseline;
				/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=black >timeslotNb</font></span></p></td>
<td width="89.523%" class="whs14">
<p>Physical timeslot number associated with the HDLC instance.</p></td></tr>
</table><br>

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

<p class=Example>typedef&nbsp;void(*NMS_GR303_CHANNEL_CALLBACK_T)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(NMS_GR303_INTERFACE_ID_T&nbsp;interfaceId,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NMS_GR303_CHANNEL_LOCATION_T&nbsp;channel_loc,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NMS_GR303_CHANNEL_EVENT_T&nbsp;channel_event,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void&nbsp;*databuffer,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;datasize);&nbsp;</p>

<p>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.</p>

<h4>See also</h4>

<p><a href="nmsgr303startinterface.html"><span style="color: #0000ff;
														font-style: normal;
														font-weight: bold;
														x-text-underline: off;
														x-text-overline: off;
														x-text-line-through: off;
														text-transform: none;
														vertical-align: baseline;
														/*begin!kadov{{*/ text-decoration: none none none; /*}}end!kadov*/ "><font color=blue ><B>NMS_GR303StartInterface</B></font></span></a></p>

<h4>Example</h4>

<p class=Example>void&nbsp;SendData(BYTE&nbsp;&nbsp;*FrameBuffer,&nbsp;DWORD&nbsp;NumberBytes&nbsp;)<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;NMS_GR303_RESULT_T&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NmsResult;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;DWORD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InterfaceId;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NMS_GR303_CHANNEL_LOCATION_T&nbsp;&nbsp;&nbsp;ChannelLocation;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;SendData:\n&quot;);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Get&nbsp;parameters&nbsp;*/<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;promptdw_nodft(&quot;Enter&nbsp;interfaceId&quot;,&nbsp;&amp;InterfaceId);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;Enter&nbsp;channel&nbsp;location:\n&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetChannelLocationNMS(&nbsp;&amp;ChannelLocation&nbsp;);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NmsResult&nbsp;=&nbsp;<span style="font-weight: bold;"><B>NMS_GR303PhSendData</B></span>(&nbsp;InterfaceId,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChannelLocation,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NumberBytes,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FrameBuffer&nbsp;);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf&nbsp;(&quot;PhSendData:&nbsp;Result=%s\n&quot;,PRINT_RESULT(NmsResult));<br>
}</p>

<div placeholder id="footer" class="whs19">
 <p align="center" class="whs20">&nbsp;</p>
 <p align="center" class="whs20"><script type="text/javascript" language="JavaScript1.2">var mailSubject = 'Documentation link: ' + document.title;
var mailBody = 'Link to reference this topic:%0A %0A' + location.href;
var mailDisplay = '<img src="send_link.gif" border="0" alt="Send link to this topic">'; 
document.write( 
'<a href="mailto:Enter recipient email address' 
+ '?subject=' + escape(mailSubject) 
+ '&body=' + (mailBody) 
+ '">' + mailDisplay + '</a>' 
);</script></p>
 <p align="center" class="whs21">&#169; 
 Copyright 2009 Dialogic Corporation. All rights reserved.</p>
</div>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
	writeIntopicBar(0);
//-->
</script>
</body>
</html>

