hosted_comm.c

Communication primitives for external platforms, used to emulate the native event train.

Author

Marcel Sondaar

License

Public Domain

Summary
hosted_comm.cCommunication primitives for external platforms, used to emulate the native event train.
Functions
drv_sendmessagesends a message over communication port
drv_setname
drv_peekmessageChecks if a message is waiting
drv_readmessageReads the message from the queue
drv_peekmessageanyChecks if any message is waiting, including messages to others
drv_peeksenderChecks the sender of the message currently at the front of the queue
drv_readmessageanyReads a message from the queue, independent of target
drv_sendmessageanysends a message over communication port

Functions

drv_sendmessage

void drv_sendmessage(unsigned int dest,
unsigned int size,
char *buffer)

sends a message over communication port

in

destaddress of the receiving object
sizesize of the data to be send
bufferpointer to the data to send

drv_setname

void drv_setname(int service,
int index)

drv_peekmessage

int drv_peekmessage(void)

Checks if a message is waiting

in

nothing

out

returnsize of the waiting message, 0 if none present

drv_readmessage

int drv_readmessage(char *dest)

Reads the message from the queue

in

destpointer to buffer to hold a copy

out

returnaddress of the sending object

drv_peekmessageany

int drv_peekmessageany(int *target)

Checks if any message is waiting, including messages to others

in

targetpointer to a variable to hold the destination address

out

returnsize of the waiting message, 0 if none present
targetif not null, set to the destination address

drv_peeksender

int drv_peeksender()

Checks the sender of the message currently at the front of the queue

in

none

out

returnsender of the waiting message, 0 if none present

drv_readmessageany

int drv_readmessageany(char *dest)

Reads a message from the queue, independent of target

in

destpointer to buffer to hold a copy

out

returnaddress of the sending object

drv_sendmessageany

void drv_sendmessageany(unsigned int dest,
unsigned int src,
unsigned int size,
char *buffer)

sends a message over communication port

in

destaddress of the receiving object
srcsender address to attach to the message
sizesize of the data to send
bufferpointer to the data to send
void drv_sendmessage(unsigned int dest,
unsigned int size,
char *buffer)
sends a message over communication port
void drv_setname(int service,
int index)
int drv_peekmessage(void)
Checks if a message is waiting
int drv_readmessage(char *dest)
Reads the message from the queue
int drv_peekmessageany(int *target)
Checks if any message is waiting, including messages to others
int drv_peeksender()
Checks the sender of the message currently at the front of the queue
int drv_readmessageany(char *dest)
Reads a message from the queue, independent of target
void drv_sendmessageany(unsigned int dest,
unsigned int src,
unsigned int size,
char *buffer)
sends a message over communication port