Skip to content

Conversation

@deadprogram
Copy link
Member

This PR adds a few missing functions to the sx127x that are used for FSK radio communication. It also cleans up a few existing functions to clarify the implementation. Also tested that Lora still works!

@deadprogram
Copy link
Member Author

Review requested please! 😸

Copy link
Contributor

@HattoriHanzo031 HattoriHanzo031 left a comment

Choose a reason for hiding this comment

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

Just some small, non-functional adjustments for clarity/consistency.

d.spiRxBuf = append(d.spiRxBuf, 0)
d.spi.Tx(nil, d.spiRxBuf)
d.controller.SetNss(true)
if d.controller != nil {
Copy link
Contributor

@HattoriHanzo031 HattoriHanzo031 Dec 26, 2025

Choose a reason for hiding this comment

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

Is there a use-case of using the driver without the controller? If yes, maybe we could in New set the default nopControler that does nothing to avoid this checks.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to leave that question for a future PR.

controller RadioController // to manage interrupts with the radio
deepSleep bool // Internal Sleep state
deviceType int // sx1261,sx1262,sx1268 (defaults sx1261)
deviceType int // sx1272, sx1273, sx1276, sx1279 (defaults sx1276)
Copy link
Contributor

Choose a reason for hiding this comment

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

deviceType is actually not used anywhere

Copy link
Member Author

Choose a reason for hiding this comment

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

That was an oversight on my part, I think. I have added SetDeviceType() to make consistent with sx126x.

@deadprogram
Copy link
Member Author

Thanks for the feedback @HattoriHanzo031 I have made a few updates.

I also added a smoketest for the sx127x which was missing. So I think this PR is now ready.

Copy link
Contributor

@HattoriHanzo031 HattoriHanzo031 left a comment

Choose a reason for hiding this comment

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

Looks good to me (after unused constants are removed)

Signed-off-by: deadprogram <ron@hybridgroup.com>
@deadprogram deadprogram merged commit a35786b into dev Jan 3, 2026
1 check passed
@deadprogram deadprogram deleted the sx127x-fsk branch January 3, 2026 16:49
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