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-13
data)\n");
 status = LOS_DT_FINISH_RESULT_(fileNum,
 (long int *) &tmpBuffer,
 &bufLen,
 maxBufLen,
 &dataType,
 &moreData);
 if (status != P7_SUCCESS)
 {
 /* Report Error and aborted association to client */
 statusError("LOS_DT_FINISH_RESULT_ failed",status);
 mapResultFileNum(fileNum, &sendFile);
 status = LOS_CLOSE_(sendFile, fileNum);
 return;
 }
 /* process result based on dataType */
 switch (dataType)
 {
 case ZMHS_VAL_DT_MS_BIND_RESULT:
 /* copy the data received to a static buffer */
 memcpy(&RecvBufferPtr[RecvOffset], tmpBuffer, (size_t)bufLen);
 RecvOffset = 0;
 /* Inform client association set up */
 informClient(dataType, (zmhs_ddl_uapi_request_def * ) buffer);
 break;
 case ZMHS_VAL_DT_MS_BIND_ERROR:
 /* Inform client of failure and close LO group */
 informClient(dataType,(zmhs_ddl_uapi_request_def *) buffer);
 /* get sendfile to be closed */
 mapResultFileNum(fileNum, &sendFile);
 printf ("calling LOS_CLOSE_() due to error\n");
 status = LOS_CLOSE_(sendFile, fileNum);
 if (status != P7_SUCCESS)
 {
 /* Report error and abort association to client */
 statusError("LOS_CLOSE_ failed", status);
 }
 break;
 case ZMHS_VAL_DT_MS_UNBIND_RESULT:
 /* Inform Client and close LO group */
 informClient(dataType, (zmhs_ddl_uapi_request_def *) buffer);
 /* get sendfile to be closed */
 mapResultFileNum(fileNum, &sendFile);
 printf ("calling LOS_CLOSE_() due to MS UNBIND\n");
 status = LOS_CLOSE_(sendFile, fileNum);
 if (status != P7_SUCCESS)
 {
 /* Report error and abort association to client */
 statusError("LOS_CLOSE_ failed",status);
 }
 break;
 case ZMHS_VAL_DT_P_DATA:
 /* Data may require to be rcvd in more than one call */
 if (moreData == ZMHS_VAL_DT_NO_MORE_DATA)
 {
 /* Copy the data received to a static buffer */
 memcpy(&RecvBufferPtr[RecvOffset], tmpBuffer,










