|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <apple_notifications.h>
Public Types | |
| enum class | Result { More , Complete , Invalid } |
Public Member Functions | |
| void | begin (uint32_t uid, bool includeNegativeAction=false) |
| Result | feed (const uint8_t *data, size_t length) |
| bool | negativeActionIsDismissal () const |
Static Public Member Functions | |
| static void | request (uint32_t uid, bool includeNegativeAction, uint8_t *out) |
| static void | request (uint32_t uid, uint8_t(&out)[11]) |
Public Attributes | |
| char | title [32] {} |
| char | message [64] {} |
| char | negativeActionLabel [32] {} |
Private Attributes | |
| uint32_t | uid_ {0} |
| bool | includeNegativeAction_ {false} |
| uint8_t | bytes_ [140] {} |
| size_t | size_ {0} |
Transport-independent decoder for one ANCS notification-attribute response.
The firmware issues at most one attribute request at a time, so this parser accumulates its fragments in one bounded buffer and verifies the UID before publishing text. It knows the ANCS wire format but not GATT callbacks; that split makes malformed/truncated packet behavior testable without a radio.
|
strong |
Response parser state returned by feed().
| Enumerator | |
|---|---|
| More | |
| Complete | |
| Invalid | |
|
inline |
Start collecting the response for uid and clear prior text.
| uid | Notification identifier expected in the next response. |
| includeNegativeAction | Also parse the optional action label. |
|
inline |
Append a response fragment and parse any complete requested attributes.
|
inline |
Return whether the optional negative action label means dismiss/clear. Whitespace and ASCII case are ignored to handle common provider variants.
|
inlinestatic |
Encode the ANCS Get Notification Attributes command into caller storage. The output needs 11 bytes for title/message and 12 when action label is requested; caller supplies the correct capacity for the selected form.
|
inlinestatic |
Convenience overload for the standard fixed 11-byte request.
|
private |
|
private |
| char ersa::protocols::AncsAttributes::message[64] {} |
| char ersa::protocols::AncsAttributes::negativeActionLabel[32] {} |
|
private |
| char ersa::protocols::AncsAttributes::title[32] {} |
|
private |