mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-18 05:33:58 +00:00
lora/lorawan: refactor shared functionality for ChannelUS, etc into embedded type
named channel, do the same for RegionSettings, and then change RegionSettings to just Settings to avoid the redundant naming. Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package region
|
||||
|
||||
type Settings interface {
|
||||
JoinRequestChannel() Channel
|
||||
JoinAcceptChannel() Channel
|
||||
UplinkChannel() Channel
|
||||
}
|
||||
|
||||
type settings struct {
|
||||
joinRequestChannel Channel
|
||||
joinAcceptChannel Channel
|
||||
uplinkChannel Channel
|
||||
}
|
||||
|
||||
func (r *settings) JoinRequestChannel() Channel {
|
||||
return r.joinRequestChannel
|
||||
}
|
||||
|
||||
func (r *settings) JoinAcceptChannel() Channel {
|
||||
return r.joinAcceptChannel
|
||||
}
|
||||
|
||||
func (r *settings) UplinkChannel() Channel {
|
||||
return r.uplinkChannel
|
||||
}
|
||||
Reference in New Issue
Block a user