(Page 5 of 5 in this chapter)


adiSendAGMessage

Description

Sends a message directly to the AG board. This function is used only with board-level development kits and packages.

Prototype

DWORD adiSendAGMessage( CTAHD ctahd,
DWORD channel,
void *hdr,
WORD *parm,
void *bdsc )

ctahd Context handle returned by adiOpenPort.

channel Relative AG channel (default = 0).

hdr Pointer to address of an AG message header, which consists of the following structure:

struct
{
WORD message; /* Message id */
WORD channel; /* adiSendAGMessage will fill this in */
WORD object; /* Overlay or function id code (typically) */
BYTE stream; /* Stream number */
BYTE instance; /* FDB instance number */
DWORD time; /* Timestamp (not used for send) */
WORD reserved; /* Reserved for future use - must be 0 */
BYTE bufcnt; /* Number of buffers */
BYTE parmcnt; /* Number of parameters */
}
parm Pointer to an array of up to 16 parameters, or NULL.

bdsc Pointer to an array of up to 4 buffer descriptors, or NULL. Each buffer descriptor consists of the following structure:

struct
{
DWORD size ; /* Size of the buffer (bytes) */
char *addr; /* buffer address */
}

Return Values

SUCCESS

Events

None

Details

This function is provided for libraries such as fax or voice recognition that communicate with special subsystems on the AG board. It is also provided for DSP developers.

The total number of parameters must be no more than 16 less 4 times the number of buffers. The maximum number of buffers is four.

A buffer can be designated as a return buffer by setting the high bit (0x80000000) in the buffer's size field. Buffers are uni-directional; the contents of a return buffer will not be sent to the board. The buffer may be subsequently attached to a received message.

If it is known that a return buffer will never be received (for example, if the associated DSP function has been stopped), you must release the buffer with adiRetractAGBuffer or close the context.

Buffers that are sent down are available for reuse as soon as the send function returns.

See Also

adiGetAGMessage, adiRetractAGBuffer



(Page 5 of 5 in this chapter)


Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights reserved.