Notification Structures
This page aggregates all notification-related structures shared by the C and C++ APIs.
Note
Notification::i3cHotJoin(), Notification::i3cIbi(),
Notification::gpio() and Notification::uartRx() are C++ convenience
methods only (available under #ifdef __cplusplus).
They are not part of the C API.
In C, use CosmicSDK_notificationAsI3cHotJoin,
CosmicSDK_notificationAsI3cIbi, CosmicSDK_notificationAsGpio and
CosmicSDK_notificationAsUartRx from CosmicSDK_API_c.h.
- group Notification-related structures
Enums
-
enum NotificationType
Enum to represent the different notification types.
Values:
-
enumerator NOTIF_I3C_HJ
I3C Hot-Join Notification
-
enumerator NOTIF_I3C_IBI
I3C In-Band Interrupt Notification
-
enumerator NOTIF_GPIO
GPIO Interrupt Notification
-
enumerator NOTIF_UART
UART Rx Notification
-
enumerator NOTIF_UNKNOWN
Unknown Notification
-
enumerator NOTIF_I3C_HJ
-
struct I3cHotJoinNotification
- #include <CosmicNotifications.h>
Parsed I3C Hot-Join notification information.
Public Members
-
uint8_t pid[6]
Provisional ID (48-bit) reported by the device during Hot-Join.
-
uint8_t bcr
Bus Characteristics Register value of the joining device.
-
uint8_t dcr
Device Characteristics Register value of the joining device.
-
uint8_t dynamicAddress
Dynamic address assigned by the controller after Hot-Join.
-
uint8_t pid[6]
-
struct I3cIbiNotification
- #include <CosmicNotifications.h>
Parsed I3C In-Band Interrupt (IBI) notification information.
-
struct UartRxNotification
- #include <CosmicNotifications.h>
Parsed UART RX notification. This struct holds the data received through the UART.
-
struct GpioInterruptNotification
- #include <CosmicNotifications.h>
Parsed GPIO Interrupt notification information.
Public Members
-
uint8_t pinNumber
GPIO pin number that triggered the interrupt.
-
uint8_t pinNumber
-
struct Notification
- #include <CosmicNotifications.h>
Generic notification wrapper used by both C and C++ APIs.
This structure is delivered by callback-based APIs:
C API: CosmicSDK_onNotification
C++ API: CosmicSDK::onNotification
The
typefield identifies the notification category. The payload bytes are exposed throughpayloadandpayloadLength.Parsing:
C users should call the dedicated parser helpers: CosmicSDK_notificationAsI3cHotJoin, CosmicSDK_notificationAsI3cIbi, CosmicSDK_notificationAsGpio, CosmicSDK_notificationAsUartRx.
C++ users can call the convenience methods: i3cHotJoin, i3cIbi, gpio, uartRx.
Public Functions
-
inline Notification(NotificationType t, const uint8_t *p, size_t len) noexcept
Constructs a Notification with the given type and payload.
Note
C++ only. Not available in the C API.
- Parameters:
t – The notification type.
p – Pointer to the notification payload data.
len – Length of the payload data in bytes.
-
const I3cHotJoinNotification *i3cHotJoin() const noexcept
Parses this notification as I3C Hot-Join data.
This method validates
typeand payload length before decoding.Note
C++ only. Not available in the C API.
- Returns:
Pointer to parsed I3cHotJoinNotification when this is a valid
NOTIF_I3C_HJnotification; otherwisenullptr.
-
const I3cIbiNotification *i3cIbi() const noexcept
Parses this notification as I3C In-Band Interrupt (IBI) data.
This method validates
typeand payload length before decoding.Note
C++ only. Not available in the C API.
- Returns:
Pointer to parsed I3cIbiNotification when this is a valid
NOTIF_I3C_IBInotification; otherwisenullptr.
-
const GpioInterruptNotification *gpio() const noexcept
Parses this notification as GPIO interrupt data.
This method validates
typeand payload length before decoding.Note
C++ only. Not available in the C API.
- Returns:
Pointer to parsed GpioInterruptNotification when this is a valid
NOTIF_GPIOnotification; otherwisenullptr.
-
const UartRxNotification *uartRx() const noexcept
Parses this notification as UART RX data.
This method validates
typeand payload length before decoding.Note
C++ only. Not available in the C API.
- Returns:
Pointer to parsed UartRxNotification when this is a valid
NOTIF_UARTnotification; otherwisenullptr.
Public Members
-
NotificationType type
Notification type. See NotificationType for valid values.
-
const uint8_t *payload
Pointer to raw notification payload bytes.
The payload format depends on
type.
-
size_t payloadLength
Payload size in bytes.
-
enum NotificationType