Added the argcheck method the the devicecmd struct

This commit is contained in:
2025-12-31 17:02:36 +00:00
parent 58c9412590
commit fe2a83b21e
2 changed files with 28 additions and 3 deletions
+5
View File
@@ -44,12 +44,17 @@ type DeviceCMDPayload struct {
// types in the REPL - or however this will be used
type DeviceCMDFn func(dCMD *DeviceCMD, args []string) (types.Command, []byte, error)
// ArgCheckFn is a function to check the arguments passed. Returns nil or the error
// in the passed arguments
type ArgCheckFn func(args []string) error
type DeviceCMD struct {
Identifier types.Command
Name string
Desc string
Header DeviceCMDHeader
Data DeviceCMDPayload
ArgCheck ArgCheckFn
Fn DeviceCMDFn
}