Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/mode resource should return what is actually running. #62

Closed
glfejer opened this issue Mar 22, 2019 · 1 comment · Fixed by #63
Closed

/mode resource should return what is actually running. #62

glfejer opened this issue Mar 22, 2019 · 1 comment · Fixed by #63

Comments

@glfejer
Copy link
Contributor

glfejer commented Mar 22, 2019

Currently, the /mode resource traverses the symbolic links and returns the target indicated by the link. This, however, isn't necessarily what is running. If an update was made, it will only take effect after reboot.

Return what the target that is actually running.

Should we return both a current and next state?

@drbild
Copy link
Contributor

drbild commented Mar 22, 2019

The complexity of managing "running" mode vs "next" mode has me leaning back towards the original approach: automatically apply the router card mode when changing it. For now, that means rebooting. GETs should return the actually running mode, not the default symlink.

Eventually just systemctl isolate <new-target> might suffice --- but will require more extensive testing.

The alternative is to specify a generic approach for defining "running" config vs "next" config and promoting "next" to "running". Presumably a reboot (whether intentional or not) would do this for all types of config. For some types, those a simpler action might suffice. Sending SIGHUP to connman for wifi config or systemctl isolate new-target for mode.

Possible strawmen are

{ "config" : {
       "active" : {
            "wifi" : ...,
            "mode" : ...
        },
        "pending" : {
            "wifi" : ..., # objects not pending would be omitted
            "mode" : ...  # pending would be the empty object if no changes were pending
        }
  "serial_number" : ...,
  "control_address" : ...,
  "mac_address" : {... },
  ...,
  "status" : {
       "wifi" : {
           "enabled" : true,
           "IPv4_address" : ...,
           ...
       }
   }
}

or

{  "serial_number" : ...,
   "control_address" : ...,
   "data_address" : ...,
   "mac_address" : ...,
   "mode" : {
       "active" : ...,
       "pending" : ...,
   },
   "wifi" : {
        "config" : {
             "passthrough" : {
                  "active" : ...,
                  "pending" : ...,
             },
             "secure-host" : {
                  "active" : ...,
                  "pending" : ...
             }
        },
        "status" : ...
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants