coreint ethernet_cable
API Reference Manual  /  4 Model-to-Model Interfaces  / 

datagram_link

Description
SIM_INTERFACE(datagram_link) {
        /* Transmit a message to the object. */
        void (*receive)(conf_object_t *NOTNULL obj, bytes_t msg);
};

#define DATAGRAM_LINK_INTERFACE "datagram_link"

This interface is implemented by objects that receive messages from a datagram-link, and by the datagram-link connection endpoints themselves.

There is a single function receive(), which is used to pass the message msg to the object obj.

The message msg is treated as a series of bytes with no special format or meaning expected. If obj is a datagram-link endpoint, it will forward the message to all other endpoints registered on the link except the sender, effectively broadcasting the message on the link. If obj is a device, it will simply receive the message as sent by the original sender.

Note that the symmetry of the interface allows two devices to be connected directly to each other and talk as if connected via a datagram-link. This is however not supported by the default datagram-link component, so a special connector must be created for this purpose. Additionally, the standard link features, such as multicell configurations and latency, will not be available in that setup.

Execution Context
receiveCell Context

coreint ethernet_cable