Skip to content

fix: new config load#46

Merged
zfields merged 1 commit intomasterfrom
zak-config
May 27, 2025
Merged

fix: new config load#46
zfields merged 1 commit intomasterfrom
zak-config

Conversation

@zfields
Copy link
Copy Markdown
Contributor

@zfields zfields commented May 17, 2025

No description provided.

@zfields zfields requested a review from rayozzie May 17, 2025 00:00
Comment thread lib/config.go
if Config.Interface == "" {
ConfigReset()
newConfigPort := Config.IPort[Config.Interface]
Config.Interface, newConfigPort.Port, newConfigPort.PortConfig = notecard.Defaults()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

@zfields zfields May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}

@zfields zfields merged commit 1bdebed into master May 27, 2025
1 check passed
@zfields zfields deleted the zak-config branch May 27, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants