From 430ba6d062f22d919629282b50279ba825e61a6f Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Tue, 12 Jul 2016 23:48:01 +0200 Subject: [PATCH] Add some notes ... --- agent.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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() }