OSI/MHS P7 Application Programmatic Interface (P7 API) Manual
C Language Example Program
OSI/MHS P7 Application Programmatic Interface (P7 API) Manual—424825-001
E-9
 SendOffset = ZMHS_VAL_LOUAPI_MAX_DATA_SIZE;
 }
 else
 {
 /* send all the data in one block */
 SendLength = 0;
 printf ("calling LOS_DT_SEND_() with P DATA request\n");
 status = LOS_DT_SEND_(SendFileNum[connection],
 (int *) buffer,
 dataLen,
 maxDataLen,
 ZMHS_VAL_DT_NO_MORE_DATA,
 ZMHS_VAL_DT_P_DATA);
 if (status != P7_SUCCESS)
 {
 /* Report the error, inform client and return */
 statusError("LOS_DT_SEND_ failed", status);
 return;
 }
 }
 break;
 default:
 reportError("Invalid Data Type");
 }
 return;
} /* end sendData */
#pragma page
/***************************************************************************/
/* Function name: GetData */
/* */
/* Arguments: buffer */
/* dataType */
/* dataLen */
/* */
/* Description: This function fills in the buffer with the appropriate */
/* data depending on the dataType passed into the function.*/
/* This function could be replaced with calls to a UA that */
/* will fill in the P7 operation buffers. */
/* */
/***************************************************************************/
void
getData( char *buffer,
 int dataType,
 long int *dataLen)
{
 int i = 0;
 int length = 0;
 char *info_ptr; /* used as offset to where data should start in
 buffer, for inserting information */
 /* initialize datalength to zero */
 *dataLen = 0;
 /* fill in values according to dataType */
 switch (dataType)
 {
 case ZMHS_VAL_DT_MS_BIND_ARG :
 /*
 * Build a P7 BIND operation. This requires the
 * use of an ASN.1 compiler. In this example we use a
 * "canned" P7 BIND.
*
* HEX display of P7 BIND:
* 0000: B0 4F 31 4D 60 41 30 3F 61 04 13 02 55 53 62 0D .O1M`A0?a...USb.
* 0010: 13 0B 50 4F 53 54 4D 41 53 54 45 52 31 A2 0D 13 ..POSTMASTER1...










