Tangent Control Surface Extension
API Version: TUBE Version 3.2  TIPC Rev 4 (22nd February 2017)
This plugin allows Hammerspoon to communicate with Tangent's range of panels, such as their Element, Virtual Element Apps, Wave, Ripple and any future panels.
The Tangent Unified Bridge Engine (TUBE) is made up of two software elements, the Mapper and the Hub. The Hub communicates with your application via the TUBE Inter Process Communications (TIPC). TIPC is a standardised protocol to allow any application that supports it to communicate with any current and future panels produced by Tangent via the TUBE Hub.
You can download the Tangent Developer Support Pack & Tangent Hub Installer for Mac here.
This extension was thrown together by Chris Hocking, then dramatically improved by David Peterson for CommandPost.
Signature  hs.tangent.reserved.action > table 

Type  Constant 
Description  Definitions for reserved action IDs. Notes:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.fromHub > table 

Type  Constant 
Description  Definitions for IPC Commands from the HUB to Hammerspoon. Notes:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.panelType > table 

Type  Constant 
Description  Tangent Panel Types. 
Source  extensions/tangent/init.lua 
Signature  hs.tangent.reserved.parameter > table 

Type  Constant 
Description  A table of reserved parameter IDs. Notes:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.toHub > table 

Type  Constant 
Description  Definitions for IPC Commands from Hammerspoon to the HUB. 
Source  extensions/tangent/init.lua 
Signature  hs.tangent.automaticallySendApplicationDefinition > boolean 

Type  Variable 
Description  Automatically send the "Application Definition" response. Defaults to 
Source  extensions/tangent/init.lua 
Signature  hs.tangent.ipAddress > number 

Type  Variable 
Description  IP Address that the Tangent Hub is located at. Defaults to 127.0.0.1. 
Source  extensions/tangent/init.lua 
Signature  hs.tangent.port > number 

Type  Variable 
Description  The port that Tangent Hub monitors. Defaults to 64246. 
Source  extensions/tangent/init.lua 
Signature  hs.tangent.callback() > boolean 

Type  Function 
Description  Sets a callback when new messages are received. Parameters:
Returns:
Notes:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.connect(applicationName, systemPath[, userPath]) > boolean, errorMessage 

Type  Function 
Description  Connects to the Tangent Hub. Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.connected() > boolean 

Type  Function 
Description  Checks to see whether or not you're successfully connected to the Tangent Hub. Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.disconnect() > none 

Type  Function 
Description  Disconnects from the Tangent Hub. Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.isTangentHubInstalled() > boolean 

Type  Function 
Description  Checks to see whether or not the Tangent Hub software is installed. Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.send(byteString) > boolean, string 

Type  Function 
Description  Sends a "bytestring" message to the Tangent Hub. This should be a full encoded string for the command you want to send, withouth the leading 'size' section, which the function will calculate automatically. In general, you should use the more specific functions that package the command for you,
such as Parameters:
Returns:
Notes:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendAllChange() > boolean, string 

Type  Function 
Description  Tells the Hub that a large number of softwarecontrols have changed. The Hub responds by requesting all the current values of softwarecontrols it is currently controlling. Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendApplicationDefinition([appName, systemPath, userPath]) > boolean, string 

Type  Function 
Description  Sends the application details to the Tangent Hub. If no details are provided the ones stored in the module are used. Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendDisplayText(messages[, doubleHeight]) > boolean, string 

Type  Function 
Description 
Example: hs.tangent.sendDisplayText(
{ "Single Height", "Double Height" }, {false, true}
)
If all text is singleheight, the Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendHighlightControl(targetID, active) > boolean, string 

Type  Function 
Description 
Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendIndicateControl(targetID, indicated) > boolean, string 

Type  Function 
Description 
Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendMenuString(menuID, value[, atDefault]) > boolean, string 

Type  Function 
Description  Updates the Hub with a menu value.
The Hub then updates the displays of any panels which are currently
showing the menu.
If a value of Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendModeValue(modeID) > boolean, string 

Type  Function 
Description  Updates the Hub with a mode value. The Hub then changes mode and requests all the current values of softwarecontrols it is controlling. Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendPanelConnectionStatesRequest()) 

Type  Function 
Description 
Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendParameterValue(paramID, value[, atDefault]) > boolean, string 

Type  Function 
Description  Updates the Hub with a parameter value. The Hub then updates the displays of any panels which are currently showing the parameter value. Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendRenameControl(targetID, newName) > boolean, string 

Type  Function 
Description 
Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendUnmanagedDisplayWrite(panelID, displayID, lineNum, pos, message) > boolean, string 

Type  Function 
Description 
Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.sendUnmanagedPanelCapabilitiesRequest(panelID) > boolean, string 

Type  Function 
Description 
Parameters:
Returns:

Source  extensions/tangent/init.lua 
Signature  hs.tangent.setLogLevel(loglevel) > none 

Type  Function 
Description  Sets the Log Level. Parameters:
Returns:

Source  extensions/tangent/init.lua 