Embedded WebSockets Experiment

Dependencies:   mbed MD5

Embed: (wiki syntax)

« Back to documentation index

sys.c File Reference

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:
argstruct sswt_cb* used to signal a semaphore and end waiting.

Definition at line 287 of file sys.c.

void sys_mbox_fetch ( sys_mbox_t  mbox,
void **  msg 
)

Wait (forever) for a message to arrive in an mbox.

While waiting, timeouts (for this thread) are processed.

Parameters:
mboxthe mbox to fetch the message from
msgthe place to store the message

Definition at line 66 of file sys.c.

void sys_msleep ( u32_t  ms )

Sleep for some ms.

Timeouts are processed while sleeping.

Parameters:
msnumber of milliseconds to sleep

Definition at line 334 of file sys.c.

void sys_sem_wait ( sys_sem_t  sem )

Wait (forever) for a semaphore to become available.

While waiting, timeouts (for this thread) are processed.

Parameters:
semsemaphore to wait for

Definition at line 126 of file sys.c.

int sys_sem_wait_timeout ( sys_sem_t  sem,
u32_t  timeout 
)

Wait for a semaphore with timeout (specified in ms)

Parameters:
semsemaphore to wait
timeouttimeout in ms (0: wait forever)
Returns:
0 on timeout, 1 otherwise

Definition at line 304 of file sys.c.

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:

Parameters:
msecstime in milliseconds after that the timer should expire
hcallback function to call when msecs have elapsed
argargument to pass to the callback function

Definition at line 188 of file sys.c.

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:
hcallback function that would be called by the timeout
argcallback argument that would be passed to h

Definition at line 248 of file sys.c.