Removed hardcoded interfaces from peach-network #47
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
help wanted
invalid
maintenance
peach-lib
peach-network
peach-oled
peach-stats
peach-web
question
refactor
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: PeachCloud/peach-workspace#47
Loading…
Reference in New Issue
No description provided.
Delete Branch "iface_agnostic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As mentioned in issue #45, we had a situation where the interface names (
wlan0
andap0
) were hardcoded in several functions. This PR replaces those hardcoded values with argument-derived equivalents.Changes have been made to the following functions:
start_iface_service(iface: String)
(replacesactivate_ap()
&activate_client()
)add(wlan_iface: String, wifi: &WiFi)
check_iface(wlan_iface: String, ap_iface: String)
The
StartWlan0
andStartAp0
error variants have been collapsed into a singleStartInterface
variant.These are breaking API changes and I will need to update
peach-web
and the physical menu system accordingly.I like the flexibility this change offers (especially in the context of PeachPub where the deployment environment is unlikely to have the full suite of PeachCloud configuration in place). I'm imagining the ability to define the interfaces in the main Peach config
toml
(maybe wireless, access point and ethernet - with all being optional). Then we can still display some network-related stats in the UI for PeachPub, even if the AP <-> client switching functionality isn't available.nice. I wouldn't hold ourselves to making sure all networking functionality works in all situations (sounds like an infininite task), but as you suggest being able to show some status info sounds more doable and cool that we could make it more flexible if needed... or to some future contributor who really wants to make peachcloud work in a specific environment
by the way, was wondering, now that peach-network and other services are not exposed via jsonrpc, do you still plan to call them from peach-web by calling functions in peach-lib? or just to call the functions from peach-network in peach-web directly?
I think it's best to call them from
peach-web
directly. Otherwise we'll be making additional work for ourselves by having to add and maintainpeach-network
calls inpeach-lib
.