Initial commit.

This is the basic infrastructure needed to build the Linux daemon
needed for the project codenamed Wired-Leaf. It includes a skeletal
.proto, which gives the flavor of what we expect to be sending to and
receiving from open-ephys, and the SCons build infrastructure needed
to get protobuf-c sources generated and linked against by the daemon
sources.

For now, the daemon is just a program that writes a serialized
protobuf to stdout.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
more deps

Signed-off-by: bnewbold <bnewbold@leaflabs.com>
SConstruct: add debugging and specify C99 dialect in CFLAGS.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Daemonize properly.

Add new daemon.h, which exposes a daemonize() routine that handles the
usual boilerplate for becoming a daemon process. An implementation is
in daemon.c.

Have main.c call daemonize(), and write the dummy protobuf to a file
under /tmp instead of stdout.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Cosmetics.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Add -Wall -Werror to CFLAGS.

For great justice.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Parse command-line arguments.

For now, this is just the usual -h,--help and a -N,--dont-daemonize
switch to disable daemonization. The latter is useful for debugging.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
open-ephys.proto: Rename Frame -> BoardFrame.

To keep up with the naming conventions Bryan and I agreed on.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Add -D_XOPEN_SOURCE=500 when compiling C.

For access to things like strdup() that are commonly available on Unix
but technically nonstandard:

http://www.gnu.org/software/libc/manual/html_node/XPG.html
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Stash a copy of argv[0] at startup.

We'll be needing it later.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Add simple syslog wrapper.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Use logging instead of printing.

This uses the logging.h API.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
notes on UDP format

Signed-off-by: bryan newbold <bnewbold@leaflabs.com>
Link with libm.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Write HDF5 to file, not protobuf.

This writes a sine wave to /tmp/foo.h5.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Crude HDF5 performance measurement.

Write ~20 seconds of raw data to file, then have HDF5 flush its caches
and call sync() to try getting an approximation for how fast we can
expect writes to go.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Crude HDF5 versus write(2) performance measurement.

Change the #if ... #else ... #endif in main() to switch between using
HDF5 and calling write() directly.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Add sockutil.h, .c, for socket conveniences.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
sockutil.c: Cosmetics.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Skip unread write.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>