OSI/MHS P7 Application Programmatic Interface (P7 API) Manual

C Language Example Program
OSI/MHS P7 Application Programmatic Interface (P7 API) Manual424825-001
E-10
* 0020: 0B 44 45 56 45 4C 4F 50 4D 45 4E 54 83 04 4D 54 .DEVELOPMENT..MT
* 0030: 41 31 A5 08 80 06 55 41 4D 53 31 31 A6 09 13 07 A1....UAMS11....
* 0040: 4D 53 55 53 45 52 53 A2 08 04 06 55 41 4D 53 31 MSUSERS....UAMS1
* 0050: 31 1
*/
/* reserve first 24 bytes (ZMHS_VAL_DT_DATA_OFFSET) for control
information */
info_ptr = &buffer[ZMHS_VAL_DT_DATA_OFFSET];
strcpy(info_ptr, "\xB0\x4F\x31\x4D\x60\x41\x30\x3F\x61");
strcat(info_ptr, "\x04\x13\x02\x55\x53\x62\x0D\x13\x0B\x50\x4F");
strcat(info_ptr, "\x53\x54\x4D\x41\x53\x54\x45\x52\x31\xA2\x0D");
strcat(info_ptr, "\x13\x0B\x44\x45\x56\x45\x4C\x4F\x50\x4D\x45");
strcat(info_ptr, "\x4E\x54\x83\x04\x4D\x54\x41\x31\xA5\x08\x80");
strcat(info_ptr, "\x06\x55\x41\x4D\x53\x31\x31\xA6\x09\x13\x07");
strcat(info_ptr, "\x4D\x53\x55\x53\x45\x52\x53\xA2\x08\x04\x06");
strcat(info_ptr, "\x55\x41\x4D\x53\x31\x31");
*dataLen = strlen(info_ptr) ;
break;
case ZMHS_VAL_DT_MS_UNBIND_ARG:
/*
* Send a P7 UNBIND request.
* There is no data in an UNBIND so just set length to 0
*/
*dataLen = 0 ;
break;
case ZMHS_VAL_DT_P_DATA:
/* Prompt user for length of data to be sent. */
printf ("Send Data length >> ");
scanf ("%d",&length);
printf (" \n");
/* reserve first 24 bytes (ZMHS_VAL_DT_DATA_OFFSET) for control
information */
info_ptr = &buffer[ZMHS_VAL_DT_DATA_OFFSET];
/* fill the buffer with the desired number of X's*/
for(i=0; i< length; i++)
info_ptr[i]='X';
*dataLen = length ;
break;
default :
printf ("invalid data type (getData)\n");
}
return;
} /* end getData */
#pragma page
/***************************************************************************/
/* Function name: sendCompletion */
/* */
/* Arguments: fileNum */
/* buffer */
/* */
/* Description: This function processes a completion on the send file. */
/* It checks if the data was sent successfully. If the */
/* send was successful and there is more data to be sent, */
/* it is sent here. */
/***************************************************************************/
void
sendCompletion ( short int fileNum, /* File number completion occurred on */
char *buffer) /* Associated Completion Data */