Overview
A-3
Internal Stack Functions
With a little care, use these functions should be of no concern. The following
are good general guidelines:
-
Always call llEnter() before calling a stack function, and llExit() when done
calling stack functions.
-
Try and keep all code that requires llEnter() and llExit() in a single module.
They are only required for system maintenance.
-
Don’t call a normal user function (like a socket function) between an llEnt-
er() / llExit() pair.
-
Never call llEnter() or llExit() from an ISR.
A.1.3 Events
Communicating what action needs to be performed by the stack is done by
sending event messages to the stack. Event messages are tracked by a
scheduling task implemented in the HAL. This task then alerts the stack to new
pending events. There are currently two event types defined:
-
LL_EVENT_TIMER – One half second has elapsed since the last TIMER
event.
-
LL_EVENT_PACKET – A packet reception has occurred and is ready to
be passed to the stack.
The HAL scheduler uses the stack’s “Exec” API to communicate to the stack.
A.1.4 Objects
Many of the control API functions deal with object handles. These handles are
created by a variety of class functions contained in the stack. When using an
object handle, it is important to realize how the object handle will be treated
by the function being called.
Associated with every object is the concept of who owns it, who is using it, and
who will eventually free it. In general, when an application creates an object,
the app owns it, the app is the only one using it, and the app must eventually
free it. Unfortunately, the matter becomes somewhat confused when object
handles are shared between applications – especially when the scope of the
handle creator may be shorter than the handle itself.
In this system, there are two basic object types:
-
Static Objects – The static object is one that is created by a designated
task, and destroyed by that task or a task where the object has been
passed. In most cases the task that created the object also destroys it.