CDI_Chain_Message

Chains CDM message requests through layers of CDM filters prior to being received by a translator CDM (also referred to as a base CDM) where the message is converted to a SuperHACB. This function is used only by filter CDMs.

Thread Context:Blocking

Syntax

    LONG CDI_Chain_Message (
       LONG   cdiBindHandle,
       LONG   msgPutHandle,
       LONG  *cdmMessage,
       LONG (*callback)(
          struct CDMMessageStruct *cdmMessage,
          LONG                     callbackParameter,
          LONG                     returnParameter,
          LONG                     completionCode),
       LONG   callbackParameter
    );
    

Parameters

cdiBindHandle
(IN) NWPA-generated bind handle that was assigned to the calling CDM when it bound to the target device using CDI_Bind_CDM_To_Object.
msgPutHandle
(IN) Handle to the CDM message (CDMMessageStruct) being passed downward. The value of this parameter is obtained from the msgPutHandle field of the CDMMessageStruct.
cdmMessage
(IN) Points to the chained CDM message casted to a pointer to a LONG.
callback
(IN) Address of the filter CDM's callback function. NWPA calls this function when the translator (base) CDM completes the CDM message associated with the request. If the filter CDM does not require a callback, then this field should be set to zero.
callbackParameter
(IN) The input parameter of the filter CDM's callback function. This function can be whatever is needed to identify the chained message. If the filter CDM does not require a callback, then this field should be set to zero.

Return Values

The following table lists return values and descriptions.

zero

Successful

nonzero

Unsuccessful

Remarks

This function is used by filter CDMs to chain CDM messages through each layer in a CDM filter chain until the message is received by a translator (base) CDM. Each filter CDM in the chain has the ability to alter CDM message information before passing the message to the next filter. The translator CDM is the last link in the chain, meaning that no more data massaging of the CDM message is performed. Instead, as the last link in the chain, the translator CDM converts the CDM message into a SuperHACB request and initiates its execution. CDI_Chain_Message allows the filter CDM to specify a callback function, so that it can be notified when the request cycle associated with the message has been completed. If there are multiple filter CDMs, then their respective callbacks are called in reverse order, thereby rippling completion-notification upward through the chain.