gtpc2mb9C/C++ Language Support User's Guide

cmsptr-Set the Prepare_To_Receive_Type Characteristic

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.

Programming Considerations

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