Soletta™ Framework
|
Inter Processor Messaging API for Soletta. More...
Functions | |
uint32_t | sol_ipm_get_max_id (void) |
Get maximum IPM message ID for the platform. More... | |
int | sol_ipm_send (uint32_t id, struct sol_blob *message) |
Send IPM message. More... | |
int | sol_ipm_set_consumed_callback (uint32_t id, void(*message_consumed_cb)(void *cb_data, uint32_t id, struct sol_blob *message), const void *data) |
Set callback to be called when sent messaged is consumed. More... | |
int | sol_ipm_set_receiver (uint32_t id, void(*receive_cb)(void *cb_data, uint32_t id, struct sol_blob *message), const void *data) |
Set receiver to IPM messages. More... | |
Inter Processor Messaging API for Soletta.
Some platforms may have more than one core available to use. This API provides a way to send data from one to another, assuming shared memory among cores and a mechanism to send messages from one core to another, like mailbox.
uint32_t sol_ipm_get_max_id | ( | void | ) |
Get maximum IPM message ID for the platform.
Some platforms limit maximum number that can be used for message ID. This function retrieves such value.
int sol_ipm_send | ( | uint32_t | id, |
struct sol_blob * | message | ||
) |
Send IPM message.
Sends messages with id id.
id | id of message. Only receivers listening to the same id will receive this message. |
message | message to be sent. |
int sol_ipm_set_consumed_callback | ( | uint32_t | id, |
void(*)(void *cb_data, uint32_t id, struct sol_blob *message) | message_consumed_cb, | ||
const void * | data | ||
) |
Set callback to be called when sent messaged is consumed.
When remote core unrefs its last reference to message, this callback is called to inform that message was consumed - so it can, for instance, perform some cleanup tasks or logging.
id | id of messages that whose consumption will be listened to. |
message_consumed_cb | callback to be called when receiver consumed this message. This happens when last reference to it is gone. If NULL, deletes current callback for id. |
data | user defined data to be sent to message_consumed_cb. |
NULL
. This is so to avoid accidentally changing callback.int sol_ipm_set_receiver | ( | uint32_t | id, |
void(*)(void *cb_data, uint32_t id, struct sol_blob *message) | receive_cb, | ||
const void * | data | ||
) |
Set receiver to IPM messages.
Receives messages sent with id id on callback receive_cb. Message content is on callback parameter message.
id | id of messages to listen to. Only messages sent with id will be sent to this receiver. |
receive_cb | callback to be called with message sent with id. If NULL , deletes a previously set callback. |
data | user defined data that will be sent to callback cb |
NULL
). Negative number otherwise.sol_blob
. Only when all references to this blob are gone sender will receive its consumed confirmation.NULL
. This is so to avoid accidentally changing callback.