IG Response Message Packets
The IG response message packet was introduced in CIGI version 2, and is used to notify the Host of a condition in the IG that may be of value
to the user. IG response messages are only sent from the IG to the host when the ig_mode field in the IG control
packet is set to IG_CONTROL_IG_MODE_DEBUG.
Message Size
This packet contains a message of variable length and its size is limited by the value of CIGI_MAX_PACKET_SIZE,
declared in the cigi_icd.h header file. The entire size of the packet must not exceed the value indicated by
CIGI_MAX_PACKET_SIZE. Thus, the length of the actual message is lmited to this value minus the size of the
other fields in the packet, defined as CIGI_IG_RESPONSE_MESSAGE_BASE_SIZE.
Max message size = CIGI_MAX_PACKET_SIZE - CIGI_IG_RESPONSE_MESSAGE_BASE_SIZE
The total message size is determined by the number of characters (1 byte each) in the message, including a terminating
NULL character. This maximum message size is defined as IG_RESPONSE_MAX_MESSAGE_LEN.
Setting the Message String
The message string contained in the IG response message packet should be set through the API, in order to ensure that the packet_size is
set correctly and to check the message size. The following API function is used for this purpose.
int CigiSetIGResponseString(
CIGI_IG_RESPONSE_MESSAGE *igResponse,
const char *message
);
|
|
|
Sending the Message
The IG response message is added to the outgoing message buffer and sent like any other ougoing message, using the following function.
int CigiAddPacketIGResponseMessage(
const int sessionid,
const CIGI_IG_RESPONSE_MESSAGE* packet
);
|
|
|
Although the CIGI_IG_RESPONSE_MESSAGE structure definition contains a buffer to hold a message of size up to
the value of IG_RESPONSE_MAX_MESSAGE_LEN, only the bytes that actually contain part of the message string are
sent when the outgoing message is sent.
Note: The size of the packet sent will be padded if necessary, so that the total number of bytes sent (including the terminating
NULL character) will end on a 32-bit word boundary. This is done to ensure that if any packets follow the
IG response message will start on a word boundary in the outgoing message buffer.
|
|