
Description | Example | Errors | See Also
Name: |
int dt_castdecode (msgp, decmsgbufp) | |
Inputs: |
void *msgp |
|
void *decmsgbufp |
| |
Returns: |
0 on success | |
Includes: |
dtilib.h | |
Category: |
CAS DTI Convenience | |
Mode: |
synchronous | |
The dt_castdecode( ) function is called internally by the DTI event retriever for each CAS DTI reply or event message block that occurs. Its purpose is to decode the CAS DTI reply or event message block before it is given to dt_castmgmt( ) or the application, respectively. This function is offered to localize the tasks of host system issues (i.e. byte swapping) and message formation with regards to messages that are passed across the host system bus.
The dt_castdecode( ) function takes as its first parameter a CAS DTI message block. It will use the decmsgbufp parameter to return the decoded message block. The operation of this function does not prevent msgp and decmsgbufp from being the same buffer.
#include "dtilib.h"
...
/*
* This is a code fragment demonstrating
* the use of the _dt_castdecode() function.
*/
...
/*
* Read CAS DTI message block from driver.
*/
...
/*
* Decode the CAS DTI message block
* before interrogating it's contents.
*
* Note: The CAS DTI message block should
* not be manipulated until after this point.
*/
if ((n = _dt_castdecode(msgp, msgp)) == -1) {
ndt_set_lasterr(devh, EDT_INVMSG);
return -1;
}
...
This function returns -1 if it does not recognize the msg_code field the reply or event message block.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation