diff --git a/agent.go b/agent.go index c7a9957..23031ac 100644 --- a/agent.go +++ b/agent.go @@ -14,6 +14,13 @@ func stop() { os.Exit(1) } +func waitAndExecuteCommandsFromDevice() { + // TODO: Establish connection to the device + // TODO: Wait for action loop + // TODO: Execute action + // TODO: Wait for action loop ... +} + func watchForConfigChanges() { watcher, err := fsnotify.NewWatcher() if err != nil { @@ -31,6 +38,12 @@ func watchForConfigChanges() { // an error to the user. if event.Op&fsnotify.Write == fsnotify.Write { log.Println("Reload the config file ...") + // TODO: Parse the config file + // TODO: Handle errors in the config file + // TODO: Write a mapping for the mapping of the keys to the binary format the avr wants. + // TODO: Establish a connection to the device + // TODO: Transfer the new key mappings + // TODO: Close the connection? } if event.Op&fsnotify.Rename == fsnotify.Rename || @@ -61,5 +74,6 @@ func watchForConfigChanges() { func main() { watchForConfigChanges() + waitAndExecuteCommandsFromDevice() stop() }