gtpc2mb9 | C/C++ Language Support User's Guide |
This function sets the prepare_to_receive_type
characteristic. It overrides the default value set by the
cminit or cmaccp function.
Format
#include <tpfmap.h>
void cmsptr(unsigned char *conversation_ID,
signed int *prepare_to_receive_type,
signed int *return_code);
- conversation_ID
- This is a pointer to an 8-byte character array that contains the
conversation ID. This conversation ID must be the ID returned by the
cminit (INITIALIZE) or cmaccp (ACCEPT_CONVERSATION) that
started this conversation.
- prepare_to_receive_type
- This is a pointer to a 4-byte field that specifies how and when the
conversation should enter receive state when the program issues a
cmptr function. Use one of the following values:
- CM_PREP_TO_RECEIVE_SYNC_LEVEL
- This value specifies that the sync_level characteristic should
be used to determine the type of prepare_to_receive to be done. If
sync_level is CM_NONE, the function executes a
cmflus and then enters receive state. If
sync_level is CM_CONFIRM, the function executes a
cmcfm. If the CONFIRM is successful, the conversation enters
receive state. If the CONFIRM fails, the return code
determines the state of the conversation.
- CM_PREP_TO_RECEIVE_FLUSH
- This value specifies to do a cmflus function and then enter
receive state.
- CM_PREP_TO_RECEIVE_CONFIRM
- This value specifies to do a cmcfm function. If the
CONFIRM is successful, the conversation enters receive
state. If the CONFIRM fails, the return code determines the state of
the conversation.
- return_code
- This is a pointer to a 4-byte field where the return code is to be
placed.
Return Codes
The following is a list of return codes that can be returned to the program
that called the cmsptr function. A complete list of the
return codes and their definitions can be found in Table 45.
- CM_OK
- CM_PROGRAM_PARAMETER_CHECK -- This indicates one of the
following:
- The specified conversation_ID is invalid.
- The specified prepare_to_receive_type is invalid.
- The sync_level characteristic is CM_NONE, and
prepare_to_receive_type is
CM_PREP_TO_RECEIVE_CONFIRM.
Programming Considerations
- You can execute this function on any I-stream.
- The conversation can be in any state.
- The value supplied in conversation_ID must be the conversation ID
returned by the cmaccp or cminit function.
- This function changes the value of the prepare_to_receive_type
characteristic. The sync_level characteristic can also
determine the type of prepare_to_receive to be performed.
- This function causes no state change.
- If return_code is not CM_OK, the
prepare_to_receive_type characteristic remains unchanged.
Examples
The following example changes the prepare_to_receive_type
characteristic.
#include <tpfmap.h>
unsigned char convid[8];
signed int type;
signed int rcode;
.
.
/* set conversation_ID with value returned from accept or initialize */
.
.
cmsptr(convid,&type,&rcode);
. /* normal processing path */
.
.
Related Information