void app_message_deregister_callbacks | ( | void | ) |
Deregisters all callbacks and their context.
void* app_message_get_context | ( | void | ) |
Gets the context that will be passed to all AppMessage callbacks.
uint32_t app_message_inbox_size_maximum | ( | void | ) |
Programatically determine the inbox size maximum in the current configuration.
AppMessageResult app_message_open | ( | const uint32_t | size_inbound, |
const uint32_t | size_outbound | ||
) |
Open AppMessage to transfers.
Use dict_calc_buffer_size_from_tuplets() or dict_calc_buffer_size() to estimate the size you need.
[in] | size_inbound | The required size for the Inbox buffer |
[in] | size_outbound | The required size for the Outbox buffer |
AppMessageResult app_message_outbox_begin | ( | DictionaryIterator ** | iterator | ) |
Begin writing to the Outbox's Dictionary buffer.
[out] | iterator | Location to write the DictionaryIterator pointer. This will be NULL on failure. |
AppMessageResult app_message_outbox_send | ( | void | ) |
Sends the outbound dictionary.
uint32_t app_message_outbox_size_maximum | ( | void | ) |
Programatically determine the outbox size maximum in the current configuration.
AppMessageInboxDropped app_message_register_inbox_dropped | ( | AppMessageInboxDropped | dropped_callback | ) |
Registers a function that will be called after any Inbox message is received but dropped by the system.
Only one callback may be registered at a time. Each subsequent call to this function will replace the previous callback. The callback is optional; setting it to NULL will deregister the current callback and no function will be called anymore.
[in] | dropped_callback | The callback that will be called going forward; NULL to not have a callback. |
AppMessageInboxReceived app_message_register_inbox_received | ( | AppMessageInboxReceived | received_callback | ) |
Registers a function that will be called after any Inbox message is received successfully.
Only one callback may be registered at a time. Each subsequent call to this function will replace the previous callback. The callback is optional; setting it to NULL will deregister the current callback and no function will be called anymore.
[in] | received_callback | The callback that will be called going forward; NULL to not have a callback. |
AppMessageOutboxFailed app_message_register_outbox_failed | ( | AppMessageOutboxFailed | failed_callback | ) |
Registers a function that will be called after any Outbox message is not sent with a timely ACK reply. The call to app_message_outbox_send() must have succeeded.
Only one callback may be registered at a time. Each subsequent call to this function will replace the previous callback. The callback is optional; setting it to NULL will deregister the current callback and no function will be called anymore.
[in] | failed_callback | The callback that will be called going forward; NULL to not have a callback. |
AppMessageOutboxSent app_message_register_outbox_sent | ( | AppMessageOutboxSent | sent_callback | ) |
Registers a function that will be called after any Outbox message is sent and an ACK reply occurs in a timely fashion.
Only one callback may be registered at a time. Each subsequent call to this function will replace the previous callback. The callback is optional; setting it to NULL will deregister the current callback and no function will be called anymore.
[in] | sent_callback | The callback that will be called going forward; NULL to not have a callback. |
void* app_message_set_context | ( | void * | context | ) |
Sets the context that will be passed to all AppMessage callbacks.
[in] | context | The context that will be passed to all AppMessage callbacks. |
typedef void(* AppMessageInboxDropped)(AppMessageResult reason, void *context) |
Called after an incoming message is dropped.
[in] | result | The reason why the message was dropped. Some possibilities include APP_MSG_BUSY and APP_MSG_BUFFER_OVERFLOW. |
[in] | context | Pointer to application data as specified when registering the callback. |
typedef void(* AppMessageInboxReceived)(DictionaryIterator *iterator, void *context) |
Called after an incoming message is received.
[in] | iterator | The dictionary iterator to the received message. Never NULL. Note that the iterator cannot be modified or saved off. The library may need to re-use the buffered space where this message is supplied. Returning from the callback indicates to the library that the received message contents are no longer needed or have already been externalized outside its buffering space and iterator. |
[in] | context | Pointer to application data as specified when registering the callback. |
typedef void(* AppMessageOutboxFailed)(DictionaryIterator *iterator, AppMessageResult reason, void *context) |
Called after an outbound message has not been sent successfully.
[in] | iterator | The dictionary iterator to the sent message. The iterator will be in the final state that was sent. Note that the iterator cannot be modified or saved off as the library will re-open the dictionary with dict_begin() after this callback returns. |
[in] | result | The result of the operation. Some possibilities for the value include APP_MSG_SEND_TIMEOUT, APP_MSG_SEND_REJECTED, APP_MSG_NOT_CONNECTED, APP_MSG_APP_NOT_RUNNING, and the combination (APP_MSG_NOT_CONNECTED | APP_MSG_APP_NOT_RUNNING) . |
context | Pointer to application data as specified when registering the callback. |
typedef void(* AppMessageOutboxSent)(DictionaryIterator *iterator, void *context) |
Called after an outbound message has been sent and the reply has been received.
[in] | iterator | The dictionary iterator to the sent message. The iterator will be in the final state that was sent. Note that the iterator cannot be modified or saved off as the library will re-open the dictionary with dict_begin() after this callback returns. |
[in] | context | Pointer to application data as specified when registering the callback. |
enum AppMessageResult |
AppMessage result codes.
#define APP_MESSAGE_INBOX_SIZE_MINIMUM 124 |
As long as the firmware maintains its current major version, inboxes of this size or smaller will be allowed.
#define APP_MESSAGE_OUTBOX_SIZE_MINIMUM 636 |
As long as the firmware maintains its current major version, outboxes of this size or smaller will be allowed.