next up previous contents
Next: 6.19 position Up: 6. Device Interfaces Previous: 6.17 localize   Contents

Subsections


6.18 mcom

Synopsis

The mcom interface is designed for exchanging information between clients. A client sends a message of a given "type" and "channel". This device stores adds the message to that channel's stack. A second client can then request data of a given "type" and "channel". Push, Pop, Read, and Clear operations are defined, but their semantics can vary, based on the stack discipline of the underlying driver. For example, the lifo_mcom driver enforces a last-in-first-out stack.

Constants

#define MCOM_DATA_LEN 128
#define MCOM_COMMAND_BUFFER_SIZE (sizeof(player_mcom_config_t))
#define MCOM_DATA_BUFFER_SIZE 0
size of the data field in messages

#define MCOM_N_BUFS 10
number of buffers to keep per channel

#define MCOM_CHANNEL_LEN 8
size of channel name

#define MCOM_EMPTY_STRING "(EMPTY)"
returns this if empty

#define PLAYER_MCOM_PUSH_REQ 0
#define PLAYER_MCOM_POP_REQ 1
#define PLAYER_MCOM_READ_REQ 2
#define PLAYER_MCOM_CLEAR_REQ 3
#define PLAYER_MCOM_SET_CAPACITY_REQ 4
request ids

Data

The mcom interface returns no data.

Command

The mcom interface accepts no commands.

Configuration



struct player_mcom_data : A piece of data.

char full;
a flag

char data[MCOM_DATA_LEN];
the data



struct player_mcom_config : Config requests sent to server.

uint8_t command;
Which request. Should be one of the defined request ids.

uint16_t type;
The "type" of the data.

char channel[MCOM_CHANNEL_LEN];
The name of the channel.

player_mcom_data_t data;
The data.



struct player_mcom_return : Config replies from server.

uint16_t type;
The "type" of the data

char channel[MCOM_CHANNEL_LEN];
The name of the channel.

player_mcom_data_t data;
The data.


next up previous contents
Next: 6.19 position Up: 6. Device Interfaces Previous: 6.17 localize   Contents
2004-06-02