]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Scan/UARTConnect/connect_scan.h
Adding basic remote capabilities + UART Rx DMA buffers
[kiibohd-controller.git] / Scan / UARTConnect / connect_scan.h
index c2daca580ebbbf3af96bee894f450d0446a8c3a1..cdd7ed0ae6ff5da84069e7bcdd5ecd19623db3d2 100644 (file)
@@ -41,6 +41,7 @@ typedef enum Command {
        RemoteInput,      // Remote command to send to a given node's debug cli
 
        Command_TOP,      // Enum bounds
+       Command_SYN = 0x16, // Reserved for error handling
 } Command;
 
 // UART Rx/Tx Status
@@ -118,11 +119,14 @@ typedef struct AnimationCommand {
 // Remote Capability Command
 // Initiated by the master to trigger a capability on a given node
 // RemoteOutput is enabled while capability is activated
+// Set id to 255 if command should be sent in all directions
 typedef struct RemoteCapabilityCommand {
        Command command;
        uint8_t id;
-       Capability capability;
-       uint8_t numArgs;
+       uint8_t capabilityIndex;
+       uint8_t state;
+       uint8_t stateType;
+       uint8_t numArgs; // # of bytes, args may be larger than 1 byte
        uint8_t firstArg[0];
 } RemoteCapabilityCommand;
 
@@ -148,8 +152,18 @@ typedef struct RemoteInputCommand {
 
 
 
+// ----- Variables -----
+
+extern uint8_t Connect_id;
+extern uint8_t Connect_master; // Set if master
+
+
+
 // ----- Functions -----
 
 void Connect_setup( uint8_t master );
 void Connect_scan();
 
+void Connect_send_ScanCode( uint8_t id, TriggerGuide *scanCodeStateList, uint8_t numScanCodes );
+void Connect_send_RemoteCapability( uint8_t id, uint8_t capabilityIndex, uint8_t state, uint8_t stateType, uint8_t numArgs, uint8_t *args );
+