ACC-72EX User Manual
DPRAM Data Processing
62
Using ulSrc and ulSrcId
Generally, a netX protocol stack is addressed through its communication channel mailbox. The example
below shows how a host application addresses a protocol stack running in the context of the netX chip.
The application is identified by a number (#444 in this example). The application consists of three
processes numbered #11, #22 and #33. These processes communicate through the channel mailbox to the
AP task of a protocol stack. See the following image:
Example:
This example applies to command messages imitated by a process in the context of the host application
identified by number #444. If the process #22 sends a packet through the channel mailbox to the AP task,
the packet header has to be filled in as follows:
Destination Queue Handler
ulDest = 32; /* 0x20: local channel mailbox */
Source Queue Handler
ulSrc
= 444; /* host application */
Destination Identifier
ulDestId = 0;
/* not used */
Source Identifier
ulSrcId = 22; /* process number */
For packets through the channel mailbox, the application uses 32 (= 0x20, Channel Token) for the
destination queue handler ulDest. The source queue handler ulSrc and the source identifier ulSrcId are
used to identify the originator of a packet. The destination identifier ulDestId can be used to address
certain resources in the protocol stack. It is not used in this example. The source queue handler ulSrc
must have an entry, and therefore its use is mandatory; the use of ulSrcId is optional.
The netX operating system passes the request packet to the protocol stack’s AP task. The protocol stack
then builds a reply to the packet and returns it to the mailbox. The application has to make sure that the
packet finds its way back to the originator (process #22 in the example).
How to Route rcX Packets
To route an rcX packet, the source identifier ulSrcId and the source queues handler ulSrc in the packet
header hold the identification of the originating process. The router saves the original handle from ulSrcId
and ulSrc. It uses handles of its own choice for ulSrcId and ulSrc before it sends the packet to the
receiving process. That way, the router can identify the corresponding reply packet and match the handle
from that packet with the one stored earlier. Lastly, the router replaces its handles with the original
handles and returns the packet to the originating process.