28 #ifndef __MESSAGING_H__ 29 #define __MESSAGING_H__ 36 #define MSG_READ_YET 0 37 #define MSG_READ_ALL 1 44 MSG_REPLY_NO_REQUIRED = 0,
45 MSG_REPLY_REQUIRED = 1,
73 typedef void (*
msg_callback_t)(msg_reply_type_t msg_type, msg_recv_buf_t *recv_data,
void *cb_data);
100 int messaging_send_sync(
const char *port_name, msg_send_data_t *send_data, msg_recv_buf_t *reply_buf);
120 int messaging_send_async(
const char *port_name, msg_send_data_t *send_data, msg_recv_buf_t *reply_buf, msg_callback_info_t *cb_info);
137 int messaging_send(
const char *port_name, msg_send_data_t *send_data);
151 int messaging_reply(
const char *port_name, pid_t sender_pid, msg_send_data_t *reply_data);
int messaging_send_sync(const char *port_name, msg_send_data_t *send_data, msg_recv_buf_t *reply_buf)
Send(unicast) message with sync mode.
msg_reply_type_e
The type of sending message.
The structure of parameters which used for sending.
int messaging_recv_block(const char *port_name, msg_recv_buf_t *recv_buf)
Wait to receive unicast message from specified message port.
The structure of parameters which has callback information.
void(* msg_callback_t)(msg_reply_type_t msg_type, msg_recv_buf_t *recv_data, void *cb_data)
Called when a message is received.
int messaging_send_async(const char *port_name, msg_send_data_t *send_data, msg_recv_buf_t *reply_buf, msg_callback_info_t *cb_info)
Send(unicast) message with async mode.
The structure of parameters which used for receiving.
int messaging_cleanup(const char *port_name)
Remove the messaging port information if this message port is not used anymore.
int messaging_send(const char *port_name, msg_send_data_t *send_data)
Send(unicast) message with noreply mode.
int messaging_multicast(const char *port_name, msg_send_data_t *send_data)
Send(multicast) message.
int messaging_recv_nonblock(const char *port_name, msg_recv_buf_t *recv_buf, msg_callback_info_t *cb_info)
Set the callback for receiving messages.
int messaging_reply(const char *port_name, pid_t sender_pid, msg_send_data_t *reply_data)
Reply(unicast) message to specified message port.