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-8
 }
 break;
 case ZMHS_VAL_DT_MS_UNBIND_ARG:
 /*
 * Fill in the buffer and set up data length.
 * After calling this function, the data starts at
 * ZMHS_VAL_DT_DATA_OFFSET in the buffer.
 */
 getData (buffer, dataType, &dataLen);
 /* send an MS UNBIND to the LOS */
 printf ("calling LOS_DT_SEND_() with MS UNBIND request\n");
 status = LOS_DT_SEND_(SendFileNum[connection],
 (int *) buffer,
 dataLen,
 maxDataLen,
 ZMHS_VAL_DT_NO_MORE_DATA,
 ZMHS_VAL_DT_MS_UNBIND_ARG);
 if (status != P7_SUCCESS)
 {
 /* Report the error, inform client and return */
 statusError("LOS_DT_SEND_ failed", status);
 return;
 }
 break;
 case ZMHS_VAL_DT_P_DATA:
 /* send a P-DATA to the LOS
 *
 * Fill in the buffer and set up data length.
 * After calling this function, the data starts at
 * ZMHS_VAL_DT_DATA_OFFSET in the buffer.
 */
 getData (buffer, dataType, &dataLen);
 /*****************************************************************/
 /* Note: Because there is no ASN.1 capability in this program, */
 /* the data being sent is not valid. Therefore, the data */
 /* sending code in this program is here for demonstation */
 /* purposes only. */
 /*****************************************************************/
 /* Data may need to be sent in more than one call */
 if (dataLen > ZMHS_VAL_LOUAPI_MAX_DATA_SIZE)
 {
 /* Copy the data to be sent to a static buffer */
 memcpy(SendBuffer, buffer,
 (size_t)(dataLen+ZMHS_VAL_DT_DATA_OFFSET));
 SendOffset = 0;
 SendLength = dataLen;
 /* send the first MAX_DATA_SIZE chunk */
 dataLen = ZMHS_VAL_LOUAPI_MAX_DATA_SIZE;
 printf ("calling LOS_DT_SEND_() with P DATA request\n");
 status = LOS_DT_SEND_(SendFileNum[connection],
 (int *) SendBuffer,
 dataLen,
 maxDataLen,
 ZMHS_VAL_DT_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;
 }










