@@ -30,13 +30,16 @@ const (
30
30
appAddressKey = "app_address"
31
31
availableWiFiNetworksKey = "networks"
32
32
statusKey = "status"
33
+ manufacturerKey = "manufacturer"
34
+ modelKey = "model"
35
+ fragmentKey = "fragment_id"
33
36
errorsKey = "errors"
34
37
cryptoKey = "pub_key"
35
38
)
36
39
37
40
var (
38
41
characteristicsWriteOnly = []string {ssidKey , pskKey , robotPartIDKey , robotPartSecretKey , appAddressKey }
39
- characteristicsReadOnly = []string {cryptoKey , statusKey , availableWiFiNetworksKey , errorsKey }
42
+ characteristicsReadOnly = []string {cryptoKey , statusKey , manufacturerKey , modelKey , fragmentKey , availableWiFiNetworksKey , errorsKey }
40
43
)
41
44
42
45
type btCharacteristics struct {
@@ -107,6 +110,15 @@ func (b *btCharacteristics) initCrypto() error {
107
110
return err
108
111
}
109
112
113
+ func (b * btCharacteristics ) initDevInfo (cfg utils.NetworkConfiguration ) error {
114
+ b .mu .Lock ()
115
+ defer b .mu .Unlock ()
116
+ _ , err1 := b .writables [manufacturerKey ].Write ([]byte (cfg .Manufacturer ))
117
+ _ , err2 := b .writables [modelKey ].Write ([]byte (cfg .Model ))
118
+ _ , err3 := b .writables [fragmentKey ].Write ([]byte (cfg .FragmentID ))
119
+ return errors .Join (err1 , err2 , err3 )
120
+ }
121
+
110
122
// initWriteOnlyCharacteristic returns a bluetooth characteristic config.
111
123
func (b * btCharacteristics ) initWriteOnlyCharacteristic (cName string ) bluetooth.CharacteristicConfig {
112
124
// Generate predictable (v5) UUID from common namespace+cName
0 commit comments