pub unsafe extern "C" fn event_post(
    event_base: *const crate::binary::c_types::c_char,
    event_id: i32,
    event_data: *mut crate::binary::c_types::c_void,
    event_data_size: usize,
    ticks_to_wait: u32,
) -> i32 {
    trace!(
        "event_post {:?} {} {:?} {} {:?}",
        event_base, event_id, event_data, event_data_size, ticks_to_wait
    );
    use num_traits::FromPrimitive;

    let event = unwrap!(WifiEvent::from_i32(event_id));
    trace!("EVENT: {:?}", event);

    WIFI_EVENTS.with(|events| events.borrow_mut().insert(event));
    let handled =
        unsafe { super::event::dispatch_event_handler(event, event_data, event_data_size) };

    super::state::update_state(event, handled);

    event.waker().wake();

    match event {
        WifiEvent::StaConnected | WifiEvent::StaDisconnected => {
            crate::wifi::embassy::STA_LINK_STATE_WAKER.wake();
        }

        WifiEvent::ApStart | WifiEvent::ApStop => {
            crate::wifi::embassy::AP_LINK_STATE_WAKER.wake();
        }

        _ => {}
    }

    memory_fence();

    0
}
**************************************************************************
Name: esp_event_post

Description:
Active work queue and let the work to process the cached event

Input Parameters:
event_base      - Event set name
event_id        - Event ID
event_data      - Event private data
event_data_size - Event data size
ticks           - Waiting system ticks

Returned Value:
0 if success or -1 if fail

*************************************************************************
esp-wifi/src/wifi/os_adapter.rs