5.4. Laddie's Software Design

We used the empty daemon introduced in Chapter 4 to build the ladd daemon. But whether we used the empty daemon, wrote a select()-based program, or wrote a threads-based program, there would still be three main subroutines:

appInit()

Initialize hardware. Start timer. Register the Zone table with RTA.

poll_timeout()

Read the status lines. Log relevant changes.

user_update()

Send logs for user changes to the alarm status.

These routines are described in more detail in the next few sections.

5.4.1. The appInit() Callback Subroutine

The appInit() subroutine is the first callback subroutine the empty daemon invokes. This callback subroutine is responsible for performing any application-specific initialization, setting up ...

Get Linux Appliance Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.