added error returns to the SendData method on the peripheral interface

This commit is contained in:
2026-09-18 16:37:30 +01:00
parent a2e14ba6a9
commit 174b27004f
5 changed files with 37 additions and 13 deletions
+4 -2
View File
@@ -17,9 +17,9 @@ func NewUIDevice() (peripheral.Peripheral, error) {
}, nil
}
func (uid *UIDevice) SendData(data *telemetry.TelemetryData) {
func (uid *UIDevice) SendData(data *telemetry.TelemetryData) error {
if data == nil {
return
return peripheral.ErrInvalidData
}
select {
@@ -27,6 +27,8 @@ func (uid *UIDevice) SendData(data *telemetry.TelemetryData) {
default:
// Drop frame if buffer is full
}
return nil
}
func (uid *UIDevice) Name() string {