Adding connection type list
This commit is contained in:
parent
55d03f448e
commit
b6e2f0ebf0
@ -188,6 +188,7 @@ case uartNum: \
|
|||||||
// CLI Functions
|
// CLI Functions
|
||||||
void cliFunc_connectCmd ( char *args );
|
void cliFunc_connectCmd ( char *args );
|
||||||
void cliFunc_connectIdl ( char *args );
|
void cliFunc_connectIdl ( char *args );
|
||||||
|
void cliFunc_connectLst ( char *args );
|
||||||
void cliFunc_connectMst ( char *args );
|
void cliFunc_connectMst ( char *args );
|
||||||
void cliFunc_connectRst ( char *args );
|
void cliFunc_connectRst ( char *args );
|
||||||
void cliFunc_connectSts ( char *args );
|
void cliFunc_connectSts ( char *args );
|
||||||
@ -199,12 +200,14 @@ void cliFunc_connectSts ( char *args );
|
|||||||
// Connect Module command dictionary
|
// Connect Module command dictionary
|
||||||
CLIDict_Entry( connectCmd, "Sends a command via UART Connect, first arg is which uart, next arg is the command, rest are the arguments." );
|
CLIDict_Entry( connectCmd, "Sends a command via UART Connect, first arg is which uart, next arg is the command, rest are the arguments." );
|
||||||
CLIDict_Entry( connectIdl, "Sends N number of Idle commands, 2 is the default value, and should be sufficient in most cases." );
|
CLIDict_Entry( connectIdl, "Sends N number of Idle commands, 2 is the default value, and should be sufficient in most cases." );
|
||||||
|
CLIDict_Entry( connectLst, "Lists available UARTConnect commands and index id" );
|
||||||
CLIDict_Entry( connectMst, "Sets the device as master. Use argument of s to set as slave." );
|
CLIDict_Entry( connectMst, "Sets the device as master. Use argument of s to set as slave." );
|
||||||
CLIDict_Entry( connectRst, "Resets both Rx and Tx connect buffers and state variables." );
|
CLIDict_Entry( connectRst, "Resets both Rx and Tx connect buffers and state variables." );
|
||||||
CLIDict_Entry( connectSts, "UARTConnect status." );
|
CLIDict_Entry( connectSts, "UARTConnect status." );
|
||||||
CLIDict_Def( uartConnectCLIDict, "UARTConnect Module Commands" ) = {
|
CLIDict_Def( uartConnectCLIDict, "UARTConnect Module Commands" ) = {
|
||||||
CLIDict_Item( connectCmd ),
|
CLIDict_Item( connectCmd ),
|
||||||
CLIDict_Item( connectIdl ),
|
CLIDict_Item( connectIdl ),
|
||||||
|
CLIDict_Item( connectLst ),
|
||||||
CLIDict_Item( connectMst ),
|
CLIDict_Item( connectMst ),
|
||||||
CLIDict_Item( connectRst ),
|
CLIDict_Item( connectRst ),
|
||||||
CLIDict_Item( connectSts ),
|
CLIDict_Item( connectSts ),
|
||||||
@ -885,6 +888,20 @@ void cliFunc_connectCmd( char* args )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Animation:
|
case Animation:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RemoteCapability:
|
||||||
|
// TODO
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RemoteOutput:
|
||||||
|
// TODO
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RemoteInput:
|
||||||
|
// TODO
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -909,6 +926,31 @@ void cliFunc_connectIdl( char* args )
|
|||||||
Connect_send_Idle( count );
|
Connect_send_Idle( count );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cliFunc_connectLst( char* args )
|
||||||
|
{
|
||||||
|
const char *Command_strs[] = {
|
||||||
|
"CableCheck",
|
||||||
|
"IdRequest",
|
||||||
|
"IdEnumeration",
|
||||||
|
"IdReport",
|
||||||
|
"ScanCode",
|
||||||
|
"Animation",
|
||||||
|
"RemoteCapability",
|
||||||
|
"RemoteOutput",
|
||||||
|
"RemoteInput",
|
||||||
|
};
|
||||||
|
|
||||||
|
print( NL );
|
||||||
|
info_msg("List of UARTConnect commands");
|
||||||
|
for ( uint8_t cmd = 0; cmd < Command_TOP; cmd++ )
|
||||||
|
{
|
||||||
|
print( NL );
|
||||||
|
printInt8( cmd );
|
||||||
|
print(" - ");
|
||||||
|
dPrint( (char*)Command_strs[ cmd ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cliFunc_connectMst( char* args )
|
void cliFunc_connectMst( char* args )
|
||||||
{
|
{
|
||||||
// Parse number from argument
|
// Parse number from argument
|
||||||
@ -944,7 +986,8 @@ void cliFunc_connectRst( char* args )
|
|||||||
info_msg("Resetting UARTConnect state...");
|
info_msg("Resetting UARTConnect state...");
|
||||||
Connect_reset();
|
Connect_reset();
|
||||||
|
|
||||||
// TODO - Argument for re-sync
|
// Reset node id
|
||||||
|
Connect_id = 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cliFunc_connectSts( char* args )
|
void cliFunc_connectSts( char* args )
|
||||||
|
@ -27,12 +27,20 @@
|
|||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
typedef enum Command {
|
typedef enum Command {
|
||||||
CableCheck = 0, // Comm check
|
CableCheck, // Comm check
|
||||||
IdRequest = 1, // Slave initialization (request id from master)
|
|
||||||
IdEnumeration = 2, // Slave initialization (begin enumeration from master)
|
IdRequest, // Slave initialization (request id from master)
|
||||||
IdReport = 3, // Slave initialization complete, report id to master
|
IdEnumeration, // Slave initialization (begin enumeration from master)
|
||||||
ScanCode = 4, // ScanCode event status change
|
IdReport, // Slave initialization complete, report id to master
|
||||||
Animation = 5, // Master trigger animation event (same command is sent back to master when ready)
|
|
||||||
|
ScanCode, // ScanCode event status change
|
||||||
|
Animation, // Master trigger animation event (same command is sent back to master when ready)
|
||||||
|
|
||||||
|
RemoteCapability, // Activate a capability on the given node
|
||||||
|
RemoteOutput, // Remote debug output from a given node
|
||||||
|
RemoteInput, // Remote command to send to a given node's debug cli
|
||||||
|
|
||||||
|
Command_TOP, // Enum bounds
|
||||||
} Command;
|
} Command;
|
||||||
|
|
||||||
// UART Rx/Tx Status
|
// UART Rx/Tx Status
|
||||||
@ -71,7 +79,6 @@ typedef struct IdRequestCommand {
|
|||||||
|
|
||||||
// Id Enumeration Command
|
// Id Enumeration Command
|
||||||
// Issued by the master whenever an Id Request is received
|
// Issued by the master whenever an Id Request is received
|
||||||
// XXX Future work may include an "external capabilities" list in this command
|
|
||||||
typedef struct IdEnumerationCommand {
|
typedef struct IdEnumerationCommand {
|
||||||
Command command;
|
Command command;
|
||||||
uint8_t id;
|
uint8_t id;
|
||||||
@ -79,7 +86,6 @@ typedef struct IdEnumerationCommand {
|
|||||||
|
|
||||||
// Id Report Command
|
// Id Report Command
|
||||||
// Issued by each slave to the master when assigned an Id
|
// Issued by each slave to the master when assigned an Id
|
||||||
// XXX Future work will include an "external capabilities" list in this command
|
|
||||||
typedef struct IdReportCommand {
|
typedef struct IdReportCommand {
|
||||||
Command command;
|
Command command;
|
||||||
uint8_t id;
|
uint8_t id;
|
||||||
@ -109,6 +115,37 @@ typedef struct AnimationCommand {
|
|||||||
uint8_t firstParam[0];
|
uint8_t firstParam[0];
|
||||||
} AnimationCommand;
|
} AnimationCommand;
|
||||||
|
|
||||||
|
// Remote Capability Command
|
||||||
|
// Initiated by the master to trigger a capability on a given node
|
||||||
|
// RemoteOutput is enabled while capability is activated
|
||||||
|
typedef struct RemoteCapabilityCommand {
|
||||||
|
Command command;
|
||||||
|
uint8_t id;
|
||||||
|
Capability capability;
|
||||||
|
uint8_t numArgs;
|
||||||
|
uint8_t firstArg[0];
|
||||||
|
} RemoteCapabilityCommand;
|
||||||
|
|
||||||
|
// Remote Output Command
|
||||||
|
// Sends debug output to the master node
|
||||||
|
// Uses print command redirection to generate each command message
|
||||||
|
typedef struct RemoteOutputCommand {
|
||||||
|
Command command;
|
||||||
|
uint8_t id;
|
||||||
|
uint8_t length;
|
||||||
|
uint8_t firstChar[0];
|
||||||
|
} RemoteOutputCommand;
|
||||||
|
|
||||||
|
// Remote Input Command
|
||||||
|
// Sends debug input to given node (usually from master)
|
||||||
|
// Uses debug cli to execute command and sends all output using Remote Output Command
|
||||||
|
typedef struct RemoteInputCommand {
|
||||||
|
Command command;
|
||||||
|
uint8_t id;
|
||||||
|
uint8_t length;
|
||||||
|
uint8_t firstChar[0];
|
||||||
|
} RemoteInputCommand;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ----- Functions -----
|
// ----- Functions -----
|
||||||
|
Reference in New Issue
Block a user