|
ether2ser 0.1.0
Ethernet <-> synchronous V.24 bridge firmware for RP2040 + W5500
|


Go to the source code of this file.
Data Structures | |
| struct | event_queue_data_t |
| Generic event payload wrapper for network/V.24 config operations. More... | |
| struct | event_t |
| Event queue entry. More... | |
Macros | |
| #define | EVENT_QUEUE_CAPACITY 16 |
| Maximum number of event slots in queue storage. | |
Enumerations | |
| enum | event_type_t { EV_NONE = 0 , EV_CLI_LINE , EV_UDP_RX , EV_UDP_TX , EV_HDLC_DECODE , EV_SAVE_CONFIG , EV_STATUS , EV_MEM , EV_WIPE_CONFIG , EV_SET_NET_SETTINGS , EV_GET_NET_SETTINGS , EV_SET_V24_SETTINGS , EV_GET_V24_SETTINGS , EV_REBOOT } |
| Event type identifiers. More... | |
| enum | event_queue_data_types_t { NET_IP_REMOTE , NET_IP_GATEWAY , NET_IP_LOCAL , NET_IP_MASK , NET_PORT_LOCAL , NET_PORT_REMOTE , V24_BAUDRATE , V24_POLARITIES , V24_CLOCK_MODE , SYS_REBOOT } |
| Typed payload selector for configuration-oriented events. More... | |
Functions | |
| void | event_queue_init (void) |
| Initialize the event queue storage. | |
| bool | event_queue_push (const event_t *event_entry) |
| Enqueue an event. | |
| bool | event_queue_pop (event_t *event_out) |
| Dequeue an event. | |
| bool | event_queue_is_empty (void) |
| Check whether the queue is empty. | |
| bool | event_queue_is_full (void) |
| Check whether the queue is full. | |
| size_t | event_queue_get_count (void) |
| Get current number of queued events. | |
| size_t | event_queue_get_high_water_mark (void) |
| Get peak queue fill count observed since init. | |
| uint32_t | event_queue_get_push_drop_count (void) |
| Get cumulative number of dropped push attempts. | |
| bool | event_get_payload_ptr (const event_t *event, size_t required_size, const void **out) |
| Resolve payload pointer and validate minimum payload size. | |
| #define EVENT_QUEUE_CAPACITY 16 |
Maximum number of event slots in queue storage.
Definition at line 29 of file event_queue.h.
Typed payload selector for configuration-oriented events.
| Enumerator | |
|---|---|
| NET_IP_REMOTE | |
| NET_IP_GATEWAY | |
| NET_IP_LOCAL | |
| NET_IP_MASK | |
| NET_PORT_LOCAL | |
| NET_PORT_REMOTE | |
| V24_BAUDRATE | |
| V24_POLARITIES | |
| V24_CLOCK_MODE | |
| SYS_REBOOT | |
Definition at line 55 of file event_queue.h.
| enum event_type_t |
Event type identifiers.
Definition at line 34 of file event_queue.h.
| bool event_get_payload_ptr | ( | const event_t * | event, |
| size_t | required_size, | ||
| const void ** | out | ||
| ) |
Resolve payload pointer and validate minimum payload size.
| event | Event to inspect. |
| required_size | Minimum bytes required by caller. |
| out | Output pointer to payload bytes/object. |
Definition at line 104 of file event_queue.c.
References event_t::bytes, event_t::data, event_t::data_len, event_t::is_inline, and event_t::ptr.
Referenced by event_dispatch(), and print_net_settings_event().

| size_t event_queue_get_count | ( | void | ) |
Get current number of queued events.
Definition at line 89 of file event_queue.c.
References event_queue_count_internal().
Referenced by update_statistics().


| size_t event_queue_get_high_water_mark | ( | void | ) |
Get peak queue fill count observed since init.
Definition at line 94 of file event_queue.c.
References event_queue_high_water_mark.
Referenced by update_statistics().

| uint32_t event_queue_get_push_drop_count | ( | void | ) |
Get cumulative number of dropped push attempts.
Definition at line 99 of file event_queue.c.
References event_queue_push_drops.
Referenced by update_statistics().

| void event_queue_init | ( | void | ) |
Initialize the event queue storage.
Definition at line 40 of file event_queue.c.
References event_queue, event_queue_high_water_mark, event_queue_push_drops, event_queue_read, and event_queue_write.
Referenced by main().

| bool event_queue_is_empty | ( | void | ) |
Check whether the queue is empty.
Definition at line 78 of file event_queue.c.
References event_queue_read, and event_queue_write.
| bool event_queue_is_full | ( | void | ) |
Check whether the queue is full.
Definition at line 83 of file event_queue.c.
References EVENT_QUEUE_CAPACITY, event_queue_read, and event_queue_write.
| bool event_queue_pop | ( | event_t * | event_out | ) |
Dequeue an event.
| event_out | Destination for the popped event. |
Definition at line 67 of file event_queue.c.
References event_queue, EVENT_QUEUE_CAPACITY, event_queue_read, and event_queue_write.
Referenced by poll_and_dispatch_events().

| bool event_queue_push | ( | const event_t * | event_entry | ) |
Enqueue an event.
| event_entry | Event to push; payload pointer ownership stays with caller. |
Definition at line 49 of file event_queue.c.
References event_queue, EVENT_QUEUE_CAPACITY, event_queue_count_internal(), event_queue_high_water_mark, event_queue_push_drops, event_queue_read, and event_queue_write.
Referenced by cli_poll(), cmd_mem(), cmd_reboot(), cmd_save(), cmd_status(), cmd_wipe(), dispatch_get_request(), dispatch_get_udp_port(), dispatch_ip(), dispatch_set_udp_port(), dispatch_v24_baudrate(), dispatch_v24_polarities(), event_dispatch(), request_save_config(), and subcmd_set_v24_clockmode().

