Skip to content
Update Plugin Function Exports and Syntax authored by Heal-Bot's avatar Heal-Bot
......@@ -4,34 +4,55 @@
*Device Information Exports*
---
These Functions are used to report to the backend the general device information. The name to display, the size on the canvas, Product and Vendor id's to search for, etc.
`export function Name() { return "Device Product name as a String"; }`
`export function Publisher() { return "This is You! as a String"; }`
*Publisher and Device Name*
---
These are basic string returning functions for what to display on the devices panel for the device's name, and for who created the plugin.
```
export function Name() { return "Device Product name as a String"; };
export function Publisher() { return "This is You! as a String"; };
```
These are used to search the system for the device. Both are Encoded in Hex values in the format "0x****".
*Vid and Pid*
---
These are used to search the system for the device. Both are Encoded in Hex values in the format "0x****". These to need to be exactly matching your device. If your device/plugin is not showing up in signal it's is most likely a mismatched Vendor and Product Id. The bare Minimum needed to get a device to be detected(Not Running) in Signal is a matching vid and pid.
`export function VendorId() { return 0xABCD; } //Device's USB Vendor Id in Hex`
`export function ProductId() { return 0xABCD;} //Device's USB Product Id in Hex`
```
export function VendorId() { return 0xABCD;}; //Device's USB Vendor Id in Hex
export function ProductId() { return 0xABCD;}; //Device's USB Product Id in Hex
```
*Size and Positioning*
---
This is the base size of the device's box on the Canvas before any scaling in a 2D Int Array. You can not grab colors outside of these bounds in our plugin so the size must be set to accommodate the with and height of the devices Leds when you translate them to rows and columns.
```
export function Size() { return [X,Y]; };
```
These will set the devices Default Positoning(the values before any user customization). the DefaultPosition is returning the 2d Point coordinates of the top left corner. While the Default Scale returns the scaling multiplier on a scale of 1.0-20.0.
```
export function DefaultPosition(){return [X,Y]};
export function DefaultScale(){return 8.0};
```
Base Size of the device's box on the Canvas in a 2D Int Array.
`export function Size() { return [X,Y]; }`
The default top left corner position on the Canvas before User Customization in a 2D Int Array.
`export function DefaultPosition(){return [X,Y]}`
The default device scale on the Canvas before User Customization in a Float Value.
`export function DefaultScale(){return 8.0}`
*Led Names and Positions*
---
Returns a 2d Array of all Led names on the device. These should follow the Supported Key Names Located [Here](https://onlinepngtools.com/convert-png-to-base64) to support keypress effects and Led Painting Features.
This function returns a 2d Array of all Led names on the device. These should follow the Supported Key Names Located [Here](https://onlinepngtools.com/convert-png-to-base64) to support keypress effects and Led Painting Features.
`export function LedNames(){return vLedNames;}`
This returns a Matrix of the individual Led's positions within the device's Canvas Box.
This returns a Matrix of the individual Led's positions within the device's Canvas Box. All of the positions must be within the bounds set by the device's Size() export.
`export function LedPositions(){return vLedPositions;}`
*Base 64 Image*
---
This returns the device's Image encoded in a base 64 image string. Online conversion of a PNG to Base64 can be done [Here](https://onlinepngtools.com/convert-png-to-base64).
`export function Image(){ return "Base 64 Image String";}`
```
export function Image(){ return "Base 64 Image String";}
```
This function is responsible for determining which USB endpoints SingalRGB wants to open and use for the device. Every endpoint will 4 parameters with it to use as filters. Multiple endpoints can be opened for each Device.
......@@ -55,13 +76,17 @@ export function Validate(endpoint)
Usb Protocol Type, Most devices use Hid Protocols, But some devices like AIO's will use Libusb functions instead. Modes are case insensitive and are "HID" and "LIBUSB".
`export function Type() { return "[Hid|LibUsb]"; }`
```
export function Type() { return "[Hid|LibUsb]"; }
```
This Function exports a list of conflicting exe's. Signal will not Initialize the plugin while one of these is running. When the conflicting process is closed SignalRGB will then initialize the plugin.
`export function ConflictingProcesses() {
return ["NGenuity2.exe"];
}`
```
export function ConflictingProcesses() {
return ["NGenuity2.exe"];
}
```
This function contains all of the settings for the device plugin. These Settings are stored as JS/JSON objects.
......
......