VuoSerialIO implementation.
Definition in file VuoSerialIO.cc.
Go to the source code of this file.
Classes | |
struct | _VuoSerial_internal |
Private data for a VuoSerial instance. More... | |
Typedefs | |
typedef struct _VuoSerial_internal * | VuoSerial_internal |
Private data for a VuoSerial instance. More... | |
Functions | |
static void | __attribute__ ((constructor)) VuoSerialIO_init() |
Initializes VuoSerial_pendingDevicesQueue . More... | |
void | VuoSerial_processPacket (VuoSerial_internal si) |
Reads and parses a single serial packet from the Dispatch Source's file handle. More... | |
static void | VuoSerial_initSource (VuoSerial_internal si) |
Sets up a Dispatch Source for the specified file handle. More... | |
static int | VuoSerial_openDevice (const char *devicePath) |
Attempts to open the specified device. More... | |
void | VuoSerial_checkPendingDevices (void) |
Attempts to open each device that has been requested but hasn't yet been successfully opened. More... | |
VuoSerial | VuoSerial_getShared (const VuoText devicePath) |
Returns the reference-counted object for the specified serial device. More... | |
void | VuoSerial_addReceiveTrigger (VuoSerial device, VuoOutputTrigger(receivedData, VuoData)) |
Adds a trigger callback, to be invoked whenever the specified serial device receives data. More... | |
void | VuoSerial_removeReceiveTrigger (VuoSerial device, VuoOutputTrigger(receivedData, VuoData)) |
Removes a trigger callback previously added by VuoSerial_addReceiveTrigger. More... | |
void | VuoSerial_sendData (VuoSerial device, const VuoData data) |
Enqueues data for output on device . More... | |
void | VuoSerial_configureDevice (VuoSerial device, VuoInteger baudRate, VuoInteger dataBits, VuoParity parity, VuoInteger stopBits) |
Changes system-wide settings for the specified serial device. More... | |
VUOKEYEDPOOL (std::string, VuoSerial_internal) | |
VuoKeyedPool_VuoSerial. More... | |
static void | VuoSerial_destroy (VuoSerial_internal si) |
VuoKeyedPool_VuoSerial. More... | |
VuoSerial_internal | VuoSerial_make (std::string devicePath) |
VuoKeyedPool_VuoSerial. More... | |
VUOKEYEDPOOL_DEFINE (std::string, VuoSerial_internal, VuoSerial_make) | |
VuoKeyedPool_VuoSerial. More... | |
Variables | |
static dispatch_queue_t | VuoSerial_pendingDevicesQueue |
Serializes access to VuoSerial_pendingDevices . More... | |
static std::set< VuoSerial_internal > | VuoSerial_pendingDevices |
Devices that have been requested but haven't yet been successfully opened. More... | |
struct _VuoSerial_internal |
Class Members | ||
---|---|---|
VuoText | devicePath | The target device this instance represents. |
int | fileHandle | |
dispatch_queue_t | queue | |
dispatch_source_t | source | |
VuoTriggerSet< VuoData > | triggerSet |
typedef struct _VuoSerial_internal * VuoSerial_internal |
Private data for a VuoSerial instance.
|
static |
Initializes VuoSerial_pendingDevicesQueue
.
Definition at line 55 of file VuoSerialIO.cc.
VUOKEYEDPOOL | ( | std::string | , |
VuoSerial_internal | |||
) |
VuoKeyedPool_VuoSerial.
VUOKEYEDPOOL_DEFINE | ( | std::string | , |
VuoSerial_internal | , | ||
VuoSerial_make | |||
) |
VuoKeyedPool_VuoSerial.
void VuoSerial_addReceiveTrigger | ( | VuoSerial | device, |
VuoOutputTrigger(receivedData, VuoData) | |||
) |
Adds a trigger callback, to be invoked whenever the specified serial device receives data.
This function may be called from any thread.
Definition at line 250 of file VuoSerialIO.cc.
void VuoSerial_checkPendingDevices | ( | void | ) |
Attempts to open each device that has been requested but hasn't yet been successfully opened.
This function may be called from any thread.
Definition at line 155 of file VuoSerialIO.cc.
void VuoSerial_configureDevice | ( | VuoSerial | device, |
VuoInteger | baudRate, | ||
VuoInteger | dataBits, | ||
VuoParity | parity, | ||
VuoInteger | stopBits | ||
) |
Changes system-wide settings for the specified serial device.
Definition at line 297 of file VuoSerialIO.cc.
|
static |
VuoKeyedPool_VuoSerial.
Definition at line 206 of file VuoSerialIO.cc.
Returns the reference-counted object for the specified serial device.
Definition at line 239 of file VuoSerialIO.cc.
|
static |
Sets up a Dispatch Source for the specified file handle.
Definition at line 125 of file VuoSerialIO.cc.
VuoSerial_internal VuoSerial_make | ( | std::string | devicePath | ) |
VuoKeyedPool_VuoSerial.
Definition at line 177 of file VuoSerialIO.cc.
|
static |
Attempts to open the specified device.
Definition at line 140 of file VuoSerialIO.cc.
void VuoSerial_processPacket | ( | VuoSerial_internal | si | ) |
Reads and parses a single serial packet from the Dispatch Source's file handle.
This function may only be called on dispatch queue VuoSerial_internal::queue
.
Definition at line 66 of file VuoSerialIO.cc.
void VuoSerial_removeReceiveTrigger | ( | VuoSerial | device, |
VuoOutputTrigger(receivedData, VuoData) | |||
) |
Removes a trigger callback previously added by VuoSerial_addReceiveTrigger.
This function may be called from any thread.
Definition at line 266 of file VuoSerialIO.cc.
Enqueues data
for output on device
.
Definition at line 279 of file VuoSerialIO.cc.
|
static |
Devices that have been requested but haven't yet been successfully opened.
Definition at line 49 of file VuoSerialIO.cc.
|
static |
Serializes access to VuoSerial_pendingDevices
.
Definition at line 48 of file VuoSerialIO.cc.