diff --git a/MSFSTouchPortalPlugin/lib/TouchPortalSDK/TouchPortalSDK.dll b/MSFSTouchPortalPlugin/lib/TouchPortalSDK/TouchPortalSDK.dll index 11c8163..6e2476b 100644 Binary files a/MSFSTouchPortalPlugin/lib/TouchPortalSDK/TouchPortalSDK.dll and b/MSFSTouchPortalPlugin/lib/TouchPortalSDK/TouchPortalSDK.dll differ diff --git a/MSFSTouchPortalPlugin/lib/TouchPortalSDK/TouchPortalSDK.xml b/MSFSTouchPortalPlugin/lib/TouchPortalSDK/TouchPortalSDK.xml new file mode 100644 index 0000000..3d54b1f --- /dev/null +++ b/MSFSTouchPortalPlugin/lib/TouchPortalSDK/TouchPortalSDK.xml @@ -0,0 +1,717 @@ + + + + TouchPortalSDK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Parses a "long" connectorId string from a ConnectorShortIdNotification message into a + dict of key value pairs. + + Example connectorId: + pc_pluginID_connectorId|actionDataId1=dataValue1|actionDataId2=dataValue2 + where the "pc_pluginID_" part is prepended by TP to the actual connectorId. + This helper will first split split the string on the pipe delimeter, + and then further into key/value pairs split on the equals sign. + The result of the parsing (if any) is available from the Data property. + The first member of the initial split on the pipe char is saved in the + ConnectorIdPart property. If a pluginId is passed to the class c'tor, then + the leading "pc_pluginId_" part will be stripped out of the ConnectorIdPart result. + + + + + + + + Resolves and parses a JSON string from byte array into a event Type. + + byte array of UTF8-encdoed chars. + A resolved type or null if the event type is unknown. + In case of any JSON string parsing errors. + + + + Constructor used if registered through AddTouchPortalSdk. + + + + + + + + + + + Send a custom command. There is no state tracking for this. + + + + + + + Creates a dynamic state in Touch Portal Memory. + This state will disappear when restarting Touch Portal. + You will need to persist them yourself and reload them on plugin load. + + + Description of the created state (name in menus). + Default value of this state, default is empty string. + Parent group of this state (TP API v6). Default is an empty string. + + + + + Updates a setting in Touch Portal. + + + + + + + + Removes the dynamic state from Touch Portal. + + + + + + + Value that can be displayed, or an event can trigger on. + Values are not persisted, and will fallback to default value on restart. + - Plugin: Defined in the Entry.tp + - Dynamic: Created or removed at runtime. (in memory only) + - Global: Defined in the Touch Portal UI. (state definition persisted in %AppData%\TouchPortal\states.tp) + + + + + + + + Updates the drop down choices in the Touch Portal UI. + InstanceId can be used to dynamically update a dropdown based on the value chosen from another dropdown. + + Id of UI dropdown. + Values as string array that you can choose from. + if set (fetched from listChange event), this will only update this particular list. + + + + + Updates the constraints of a data value. + + Id of action the number box. + Min value the field can be. + Max value the field can be. + Type of the data field. + if set (fetched from listChange event), this will only update this particular list. + + + + + Adds a notification to the Touch Portal UI. Ex. if the plugin has a updated version. + + If of the notification. + Title on the notification shown to the user. + Text / description of the notification shown to the user. + + + + + Sends a connector value update to Touch Portal using the long form of the connector ID. + + The long ID of the connector to update. The string "pc_{pluginId}_" is automatically prepended + before sending to TP. The total length must not exceed 200 chars. + The value to send, must be between 0 and 100, inclusive. + true on success, false otherwise. + + + + Sends a connector value update to Touch Portal using the short form of the connector ID. + + The short ID of the connector to update. This is obtained from a event. + The value to send, must be between 0 and 100, inclusive. + true on success, false otherwise. + + + + Method for handling raw messages events, in UTF8 encoded json byte array. + + + + + + Method for notifying the message handler of hard errors (handler should probably disconnect after this). + + + + + + + The connection state of this client. `true` when an active socket to Touch Portal is open. + + + + + Connects, pairs, and listens to the Touch Portal application. + + connection success status + + + + Closes the connection to Touch Portal and shutdowns the plugin in a safe manner. + + + + + Factory interface for creating a Touch Portal client. + + + + + Create a Touch Portal Client + + Handler the events from Touch Portal, normally the plugin instance. + Touch Portal Client + + + + Type of the message, see Touch Portal API documentation. + + + + + Gets a unique identifier for a command/event. + (Type, Id, Instance) + + + + + + The connection state of the Socket being used internally. + + + + + Size of the receive buffer in bytes, for possible tuning. + Needs to hold at least one full TP message at a time, but should not be too large + since the unused space is still moved around in memory during line splitting process. + This must be set before is called. + Default is 2048. + + + + + Connects to Touch Portal. + + success flag + + + + Starts the listener thread, and listens for events from Touch Portal. + + success flag + + + + Sends a string message to Touch Portal. The string is encoded to UTF8 before sending. + + The fully formatted JSON to send. + success flag + + + + Sends a JSON message which is already encoded to a UTF8 byte array. + + UTF8 bytes of the fully formatted JSON to send. + success flag + + + + Closes the socket. + + + + + Factory interface for creating a Touch Portal socket. + + + + + Create a Touch Portal Socket + + Handler the json events from the Socket, normally the client instance. + Touch Portal Socket + + + + Interface used to register a plugin that can handle events from Touch Portal. + + + + + EventHandler must define a pluginId to receive plugin events. + + + + + Method to call when Touch Portal is connected. + + + + + Method to call when an item is selected from dropdown in Action Creation of a button. + + + + + Method is called when an broadcast message is sent. + + + + + Settings are first received as a part of the OnInfoEvent. + Then updated through this event if either user changes a setting in Touch Portal, or the SettingUpdate is successfully triggered. + + + + + Method to call when a user presses a button on their device. + + + + + Called when a user clicks on a notification option. + + + + + Method to call when a user moves a slider on their device. + + + + + Called when TP reports a new instance of your connector, either at startup or if user adds/modifies one. + + + + + Method to call when we loose connection to Touch Portal. + + + + + + Messages that are unknown, and therefor we cannot deserialize to a known type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Action type event. `Type` attribute can be one of the following: + + + + action + User presses an action button on the device. + + + down + Finger holds down the action on the device. This event happens only if the action enables the hasHoldFunctionality. + + + up + Finger released the action on the device. This event happens only if the action enables the hasHoldFunctionality. + + + + + + + + The id of the action. + + + + + Returns the Action type. + + enum + + + + Broadcast type is a global event all plugins will receive. + In 2.3 the only event is og PageChange at the Device. + + + + + Event that was broadcast, ex. pageChange + + + + + Name of the page the device is currently on. Ex. "(main)" + + + + + + + + Touch Portal closes/stops the plugin or shuts down. + + + + + The id of the plugin. + + + + + + + + + + + The connector ID. Alias for DataContainerEventBase::Id. + + + + + Current value of the connector. + + + + + Base class for events which have data members, such as actions and connectors. + + + + + The Touch Portal event name. + + + + + The id of the plugin. + + + + + The id of the action/connector. + + + + + Data is name = value pairs dictionary of options the user has selected for this action. + Ex. data1: dropdown1 + data2: dropdown2 + + + + + Indexer to get data values. + + the id of the datafield. + the value of the data field as string or null if not exists + + + + Returns the value of the selected item in an action data field. + This value can be null in some cases, and will be null if data field is miss written. + + the id of the datafield. + Default value to return if the dataId wasn't found. + the value of the data field as string or null if not exists + + + + Event from Touch Portal when a connection is established. + This event includes information about the Touch Portal service. + + + + + Status ex. "paired" + + + + + Version of the SDK this version of Touch Portal knows about. + Ex. 2 + + + + + Touch Portal version as string. + Major, Minor, Patch: M.m.ppp + + + + + Touch Portal version as int. + Format: Major * 10000 + Minor * 1000 + patch. + + + + + Plugin version as code. + + + + + Values in settings. + + + + + + + + When setting up an action in the Touch Portal UI. This event is fired if the user selects and item in the dropdown for a choice list. + + + + + The id of the plugin. + + + + + The actionId the list (dropdown) is a part of. + + + + + The dataId the list (dropdown) is built upon. + + + + + InstanceId is a unique name that identified the action the user is changing. + A button might have multiple actions, and a action might be bound to multiple buttons. + This id will be different. However, it can also be null. + + + + + Value of the selected list (dropdown). + Might be null if nothing is selected, ex. choices updated to something else. + + + + + + + + Notification option in Touch Portal UI clicked by a user. + + + + + Id of the notification. + + + + + The option clicked by the user. + + + + + + + + Plugin settings changed in TouchPortal UI. + + + + + Values in settings. + + + + + + + + Data is name = value pairs dictionary of the connector data members extracted + from the connectorId string. + It is populated only when the Data or ActualConnectorId members are first requested (lazy loading), + or can be pre-populated by calling the ParseData() method. + + + + + Contains the actual connector ID, which is the first part of the sent + connectorId field, before the first "|" delimiter, and also with the + "pc_pluginId_" prefix stripped out. + It is populated only when the ActualConnectorId or Data are first requested (lazy loading), + or can be pre-populated by calling the ParseData() method. + + + + + Parse the long connectorId string into key/value pairs of data fields it represents. + Populates the Data and ActualConnectorId properties. + + + + + Allowed data types for DataValue + + + + + Standard action tap/click. + When this is not a on hold action. + + + + + On Hold action, on end of press of a hold button. + Usually triggers with same behaviour as Tap actions. + + + + + On Hold action, on start of press of a hold button. + + + + + Name of the setting property + + + + + Value of the setting property + + + + + Factories are a pattern that works well with callbacks. + + + + + Private so we don't expose the socket factory. + + + + + Factory for creating the Touch Portal client. + + Handler the events from Touch Portal, normally the plugin instance. + Optional options, if null, default values are selected. + Optional logger factory, if null, no logger is created. + + + + + + + + + + If this is set to a non-null character, will split each incoming `action.data.id` value on this char and only keep the last part. + + + Set to `true` to skip validation of parameter values for all Command types. /// + + + diff --git a/MSFSTouchPortalPlugin/lib/WASimCommander/WASimCommander.WASimClient.dll b/MSFSTouchPortalPlugin/lib/WASimCommander/WASimCommander.WASimClient.dll index e1237d9..93911ae 100644 Binary files a/MSFSTouchPortalPlugin/lib/WASimCommander/WASimCommander.WASimClient.dll and b/MSFSTouchPortalPlugin/lib/WASimCommander/WASimCommander.WASimClient.dll differ diff --git a/MSFSTouchPortalPlugin/lib/WASimCommander/WASimCommander.WASimClient.pdb b/MSFSTouchPortalPlugin/lib/WASimCommander/WASimCommander.WASimClient.pdb index 34e7ca4..de4833d 100644 Binary files a/MSFSTouchPortalPlugin/lib/WASimCommander/WASimCommander.WASimClient.pdb and b/MSFSTouchPortalPlugin/lib/WASimCommander/WASimCommander.WASimClient.pdb differ