Communicate with external devices through a serial port (most commonly RS-232).
Powered by ORSSerialPort. Thrown together by @latenitefilms.
Copyright (c) 2011-2012 Andrew R. Madsen ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Signature | hs.serial.availablePortDetails() -> table |
---|---|
Type | Function |
Description |
Returns a table of currently connected serial ports details, organised by port name. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 655 |
Signature | hs.serial.availablePortNames() -> table |
---|---|
Type | Function |
Description |
Returns a table of currently connected serial ports names. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 631 |
Signature | hs.serial.availablePortPaths() -> table |
---|---|
Type | Function |
Description |
Returns a table of currently connected serial ports paths. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 683 |
Signature | hs.serial.deviceCallback(callbackFn) -> none |
---|---|
Type | Function |
Description |
A callback that's triggered when a serial port is added or removed from the system. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 1161 |
Signature | hs.serial.newFromName(portName) -> serialPortObject |
---|---|
Type | Constructor |
Description |
Creates a new |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 525 |
Signature | hs.serial.newFromPath(path) -> serialPortObject |
---|---|
Type | Constructor |
Description |
Creates a new |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 558 |
Signature | hs.serial:baudRate([value], [allowNonStandardBaudRates]) -> number | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets the baud rate for the serial port. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 783 |
Signature | hs.serial:callback(callbackFn) -> serialPortObject |
---|---|
Type | Method |
Description |
Sets or removes a callback function for the |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 591 |
Signature | hs.serial:close() -> serialPortObject |
---|---|
Type | Method |
Description |
Closes the serial port. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 765 |
Signature | hs.serial:dataBits([value]) -> number | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets the number of data bits for the serial port. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 1091 |
Signature | hs.serial:dtr([value]) -> boolean | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets the state of the serial port's DTR (Data Terminal Ready) pin. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 972 |
Signature | hs.serial:isOpen() -> boolean |
---|---|
Type | Method |
Description |
Gets whether or not a serial port is open. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 1122 |
Signature | hs.serial:name() -> string |
---|---|
Type | Method |
Description |
Returns the name of a |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 707 |
Signature | hs.serial:open() -> serialPortObject | nil |
---|---|
Type | Method |
Description |
Opens the serial port. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 743 |
Signature | hs.serial:parity([value]) -> string | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets the parity for the serial port. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 834 |
Signature | hs.serial:path() -> string |
---|---|
Type | Method |
Description |
Returns the path of a |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 725 |
Signature | hs.serial:rts([value]) -> boolean | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets the state of the serial port's RTS (Request to Send) pin. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 1001 |
Signature | hs.serial:sendData(value) -> none |
---|---|
Type | Method |
Description |
Sends data via a serial port. |
Parameters |
|
Returns |
|
Source | extensions/serial/libserial.m line 1140 |
Signature | hs.serial:shouldEchoReceivedData([value]) -> boolean | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets whether the port should echo received data. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 1030 |
Signature | hs.serial:stopBits([value]) -> number | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets the number of stop bits for the serial port. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 1058 |
Signature | hs.serial:usesDTRDSRFlowControl([value]) -> boolean | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets whether the port should use DTR/DSR Flow Control. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 916 |
Signature | hs.serial:usesRTSCTSFlowControl([value]) -> boolean | serialPortObject |
---|---|
Type | Method |
Description |
Gets or sets whether the port should use RTS/CTS Flow Control. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/serial/libserial.m line 944 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.serial.html