From 2cc64731f1c48ac9553535bc053ba99b949c6874 Mon Sep 17 00:00:00 2001 From: Henry Seurer Date: Tue, 19 Nov 2024 08:31:47 -0800 Subject: [PATCH] change how we handle ble bluetooth messages. --- go.mod | 15 --------------- messages.go | 11 +++++------ 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 36b1626..f5b646a 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,3 @@ module git.bellaerba.dev/henry/farm-messages go 1.23 - -require tinygo.org/x/bluetooth v0.10.0 - -require ( - github.com/go-ole/go-ole v1.3.0 // indirect - github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/saltosystems/winrt-go v0.0.0-20241030114511-98be01919aa6 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect - github.com/soypat/cyw43439 v0.0.0-20241116210509-ae1ce0e084c5 // indirect - github.com/soypat/seqs v0.0.0-20240527012110-1201bab640ef // indirect - github.com/tinygo-org/cbgo v0.0.4 // indirect - github.com/tinygo-org/pio v0.0.0-20240901140349-27cbe9d986eb // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect -) diff --git a/messages.go b/messages.go index abf2710..b33d81d 100644 --- a/messages.go +++ b/messages.go @@ -35,7 +35,6 @@ import ( "strings" "sync/atomic" "time" - "tinygo.org/x/bluetooth" ) type BuildVersion struct { @@ -967,16 +966,16 @@ type StatusMessage struct { States map[string]bool `json:"states,omitempty"` } -type BleCompany struct { +type BleManufacturerData struct { CompanyId uint16 `json:"company_id,omitempty"` Name string `json:"name,omitempty"` + Data []byte `json:"data,omitempty"` } type BleAdvertisementPayload struct { - LocalName string `json:"localName,omitempty"` - Companies []BleCompany `json:"companies,omitempty"` - Bytes []byte `json:"bytes,omitempty"` - ManufacturerData []bluetooth.ManufacturerDataElement `json:"manufacturerData,omitempty"` + LocalName string `json:"localName,omitempty"` + Bytes []byte `json:"bytes,omitempty"` + ManufacturerData []BleManufacturerData `json:"companies,omitempty"` } type BleDevice struct {