* _ ____ _ _
* / \ ___ _ _ _ __ ___ / ___| ___ _ __(_) __ _| |
* / _ \ / __| | | | '_ \ / __| \___ \ / _ \ '__| |/ _` | |
* / ___ \\__ \ |_| | | | | (__ ___) | __/ | | | (_| | |
* /_/ \_\___/\__, |_| |_|\___| |____/ \___|_| |_|\__,_|_|
* |___/
*
* AsyncSerial
*
* @version
* 1.0 beta (November 25th 2012)
*
* @discussion
* An external object for Max/MSP on Mac OSX that interfaces
* with serial devices. This is intended to provide more useful
* functionality than the built-in [serial] object. Namely,
* [AsyncSerial] listens for incoming data on a separate thread
* and spits it out whenever it arrives. It does not need to be
* polled. This is similar to how UDPReceive works. Similar care
* must be taken when dealing with multithreaded Max-patches.
* [AsyncSerial] can also have its input buffer flushed,
* which is necessary when sending commands to a device and
* awaiting a reply. [AsyncSerial] can also be put in and out
* of 'canonical' input mode, in which data is only spit out once
* a newline char '\n' is received, which is useful for parsing
* text-based replies. [AsyncSerial] also allows users to set
* VMIN and VTIME, as described in the unix manual, sub verbo
* 'termios':
*
* man termios
*
* [AsyncSerial] cannot be polled using 'bang', because, depending
* on VMIN, VTIME and ICANON, that could cause the main thread to
* hang.
*
* [AsyncSerial] can either output received data as a sequence
* of bytes, as [serial] does, or as a list of text symbols, which
* is useful with canonic input processing.
*
* @author
* Written by Michael Krzyzaniak at Arizona State
* University's School of Arts, Media + Engineering
* in Fall of 2012.
*
* mkrzyzan@asu.edu