Closed mirackara closed 8 months ago
@deadprogram should be good to go now, sorry I didn't get to test it. I got food poisoning 💀
Note that because this re-structures the implementation of this driver, it will be breaking for https://github.com/tinygo-org/drivers/pull/535
Here is an example where changing to Channel
interface using functions instead of struct with values is a problem: https://github.com/hybridgroup/tinyglobo/blob/main/main.go#L25-L28
The most straightforward solution to the TinyGlobo example within how this PR works, would be to provide SetXXX()
functions for each of the values.
Example:
func (c *ChannelAU) SetFrequency(freq uint32) error {
c.frequency = freq
return nil
}
There is some duplication of code, but it would allow for validation to be added at some point.
What do you think @mirackara @iamemilio ?
I like that. It feels like a much safer way to handle this data structure.
@iamemilio can you add to this PR please? :smile_cat:
Forgot to mention that I tested this in EU868 and it still works. As long as the US915 region is working, then I suggest we merge and then can do some additional refactoring from there.
Commits picked up in #611 so now closing this PR. Thank you very much everyone!
Adds a driver for us 915 protocol to the lora WAN drivers.