Some quick code to use UDP-only (no TCP) with mBed. Echos received packets and sends packets when a button is pressed
sys.c File Reference
lwIP Operating System abstraction More...
Go to the source code of this file.
Functions | |
void | sys_mbox_fetch (sys_mbox_t mbox, void **msg) |
Wait (forever) for a message to arrive in an mbox. | |
void | sys_sem_wait (sys_sem_t sem) |
Wait (forever) for a semaphore to become available. | |
void | sys_timeout (u32_t msecs, sys_timeout_handler h, void *arg) |
Create a one-shot timer (aka timeout). | |
void | sys_untimeout (sys_timeout_handler h, void *arg) |
Go through timeout list (for this task only) and remove the first matching entry, even though the timeout has not triggered yet. | |
static void | sswt_handler (void *arg) |
Timeout handler function for sys_sem_wait_timeout() | |
int | sys_sem_wait_timeout (sys_sem_t sem, u32_t timeout) |
Wait for a semaphore with timeout (specified in ms) | |
void | sys_msleep (u32_t ms) |
Sleep for some ms. |
Detailed Description
lwIP Operating System abstraction
Definition in file sys.c.
Function Documentation
static void sswt_handler | ( | void * | arg ) | [static] |
Timeout handler function for sys_sem_wait_timeout()
- Parameters:
-
arg struct sswt_cb* used to signal a semaphore and end waiting.
void sys_mbox_fetch | ( | sys_mbox_t | mbox, |
void ** | msg | ||
) |
void sys_msleep | ( | u32_t | ms ) |
void sys_sem_wait | ( | sys_sem_t | sem ) |
int sys_sem_wait_timeout | ( | sys_sem_t | sem, |
u32_t | timeout | ||
) |
void sys_timeout | ( | u32_t | msecs, |
sys_timeout_handler | h, | ||
void * | arg | ||
) |
Create a one-shot timer (aka timeout).
Timeouts are processed in the following cases:
- while waiting for a message using sys_mbox_fetch()
- while waiting for a semaphore using sys_sem_wait() or sys_sem_wait_timeout()
- while sleeping using the inbuilt sys_msleep()
- Parameters:
-
msecs time in milliseconds after that the timer should expire h callback function to call when msecs have elapsed arg argument to pass to the callback function
void sys_untimeout | ( | sys_timeout_handler | h, |
void * | arg | ||
) |
Go through timeout list (for this task only) and remove the first matching entry, even though the timeout has not triggered yet.
- Note:
- This function only works as expected if there is only one timeout calling 'h' in the list of timeouts.
- Parameters:
-
h callback function that would be called by the timeout arg callback argument that would be passed to h
Generated on Tue Jul 12 2022 19:17:24 by 1.7.2