Added an ID to the devices

This commit is contained in:
2025-10-29 22:57:21 +00:00
parent da1fcf3dec
commit b2c0e35f51
4 changed files with 42 additions and 7 deletions
+4 -2
View File
@@ -36,7 +36,8 @@ func (s PeripheralDeviceState) String() string {
type PeripheralDevice struct {
State PeripheralDeviceState
CommState CommState
Name [32]byte
ID uint8
Name string
WT *WalkieTalkie
}
@@ -93,7 +94,8 @@ func (p *PeripheralDevice) ToConnectedIdling() {
}
func (p *PeripheralDevice) Merge(packet *IdentificationPacket) {
p.Name = packet.Name
p.Name = string(packet.Name[:])
p.ID = packet.DeviceID
}
func (p *PeripheralDevice) Disconnect() error {