build-local contains bash-isms. depend on bash

The *buntu's come with dash as the default shell and build-local.sh
fails to build because of it as it requires bash.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Git should not track *~ and .*.swp files

*~ and .*.swp files are backup files used by editors. Git should always
ignore them.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Add missing algorithm.h define for std::count

std::count requires algorithm.h to be included or the compiler gives an
error.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Fix compiler warnings/errors due to wrong types

The compiler warns and errors due to the mis-use of unsigned vs signed
and size_t vs int in the unittests.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Correct the usage of %zi vs %d in printf

currentLine, totalLines, bufferedLines are all ints and thus do not
require the 'z' length modifier that is required for size_t.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Add a -p option to choose which printer the print server controls

When not using UCI to obtain the configuration settings, a dummy
variable forces a makerbot (or whatever printer) as default. Using -p
one of the available printers can be configured via the commandline.
When -p is not supplied, uci (or the dummy var) is used instead.

Missing still is to print the list of available printers when using -p
help or an empty -p. Since there is a function in the 'TODO' area to
print a list of printers, this item is also TODO.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Require a device ID for several actions, fixes segfault

THe AT_GET_TEST an AT_GET_PROGRESS actions require a device ID when,
also when called from -g. If this is not done, calling these actions via
-g causes segfaults.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Fix segfault when doing serial communication.

The serial module does not account for the \0 character when mallocing.
Request 1 extra byte of memory to account for \0.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>