Conversation
| if Config.Interface == "" { | ||
| ConfigReset() | ||
| newConfigPort := Config.IPort[Config.Interface] | ||
| Config.Interface, newConfigPort.Port, newConfigPort.PortConfig = notecard.Defaults() |
There was a problem hiding this comment.
Notehub is an equal consumer of lib.
It does not seem right from a layering perspective that you are referencing notecard and setting defaults in here. It may be fine but it does not seem right in the spirit of a shared library. That is why I had suggested doing it in notecard main.go
There was a problem hiding this comment.
Interesting. I discovered this area, because it was responsible for blowing away the changes as you originally suggested them.
This section of code only runs on the first launch after a new installation (or removal of the configuration data).
There was a problem hiding this comment.
I am yielding and you should do what you think is best. However, make sure that you test and thoroughly understand
- blow away, then use the notehub utility, then use the notecard utility, all with no interface specified.
- Blow away, then use the notecard utility then use the notehub utility, all with no interface specified
- Blow away, then use the notehub utility with "-interface lease", then use the notecard utility with no interface
- Blow away, then use the notecard utility with "-interface serial", then use the notehub utility with no interface
There was a problem hiding this comment.
Am I doing something wrong, or did you have something else in mind?
Notehub CLI
$ notehub -interface lease
flag provided but not defined: -interface
notehub - Command line tool for interacting with notehub
USAGE: notehub [options]
Notecard CLI
$ notecard -interface lease -req '{"req":"card.version"}'
{"body":{"built":"Dec 22 2023 14:43:52","org":"Blues Wireless","product":"Notecard","target":"r5","ver_build":16332,"ver_major":6,"ver_minor":1,"ver_patch":1,"version":"notecard-6.1.1"},"version":"notecard-6.1.1.16332","name":"Blues Wireless Notecard","device":"dev:868050040018596","sku":"NOTE-WBNA-500","board":"1.11","cell":true,"gps":true,"api":6}
No description provided.