Sends a message to the management manager with attached data.
DWORD imgtSendMessage ( CTAHD ctahd, IMGT_MESSAGE *pmessage, unsigned size, void *pbuff )
|
Argument |
Description |
|
ctahd |
Context handle returned by ctaCreateContext. |
|
pmessage |
Pointer to IMGT_MESSAGE structure. |
|
size |
Size of data block. |
|
pbuff |
Pointer to the primitive-specific data structure (as specified in the IMGT_CONFIG structure). typedef struct IMGT_MESSAGE
|
|
Return value |
Description |
|
SUCCESS |
|
|
CTAERR_BAD_ARGUMENT |
This return value means any of the following:
|
|
CTAERR_INVALID_HANDLE |
The specified context handle is invalid. |
|
IMGTERR_IMGT_NOT_STARTED |
A management session has not been initialized. |
|
Event |
Reason code |
|
IMGTEVN_SEND_MESSAGE |
The event value field contains one of the following reasons or an error code: SUCCESS IMGTERR_BUFFER_TOO_BIG |
See IMGT_CONFIG structure for a list of valid messages and their associated buffer structures.
void MySendOOS( CTAHD ctahd, unsigned char nai, unsigned char Bchannel )
{
IMGT_MESSAGE msg;
char pdata[MAX_IMGT_BUFFER_SIZE];
unsigned size;
struct imgt_service *psvc;
char *errortext="";
/* send SERVICE_RQ on nai to set Bchannel out of service */
msg.nai = nai;
msg.code = IMGT_SERVICE_RQ;
psvc = (struct imgt_service *) pdata;
psvc->type = PREFERENCE_BCHANNEL;
psvc->nai = msg.nai;
psvc->Bchannel = Bchannel;
psvc->status = OUT_OF_SERVICE;
size = sizeof( struct imgt_service );
ret = imgtSendMessage( ctahd, &msg, size, pdata );
if (ret != SUCCESS)
{
ctaGetText( ctahd, ret, (char *) errortext, 40);
printf( "imgtSendMessage failure: %s\n",errortext );
exit( 1 );
}
}