Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions att_hci.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (s *rawService) Read(p []byte) (int, error) {
binary.LittleEndian.PutUint16(p[4:], s.uuid.Get16Bit())
sz += 2
default:
uuid := s.uuid.Bytes()
uuid := s.uuid.bytes()
copy(p[4:], uuid[:])
sz += 16
}
Expand Down Expand Up @@ -166,7 +166,7 @@ func (c *rawCharacteristic) Read(p []byte) (int, error) {
binary.LittleEndian.PutUint16(p[5:], c.uuid.Get16Bit())
sz += 2
default:
uuid := c.uuid.Bytes()
uuid := c.uuid.bytes()
copy(p[5:], uuid[:])
sz += 16
}
Expand Down Expand Up @@ -232,7 +232,7 @@ func (a *rawAttribute) Read(p []byte) (int, error) {
binary.LittleEndian.PutUint16(p[sz:], a.uuid.Get16Bit())
sz += 2
default:
uuid := a.uuid.Bytes()
uuid := a.uuid.bytes()
copy(p[sz:], uuid[:])
sz += 16
}
Expand Down
6 changes: 3 additions & 3 deletions gap.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (buf *rawAdvertisementPayload) HasServiceUUID(uuid UUID) bool {
if len(b) == 0 {
b = buf.findField(0x06) // Incomplete List of 128-bit Service Class UUIDs
}
uuidBuf1 := uuid.Bytes()
uuidBuf1 := uuid.bytes()
for i := 0; i < len(b)/16; i++ {
uuidBuf2 := b[i*16 : i*16+16]
match := true
Expand Down Expand Up @@ -519,7 +519,7 @@ func (buf *rawAdvertisementPayload) addServiceData(uuid UUID, data []byte) (ok b
// Add the data.
buf.data[buf.len+0] = byte(fieldLength - 1)
buf.data[buf.len+1] = 0x21
uuid_bytes := uuid.Bytes()
uuid_bytes := uuid.bytes()
copy(buf.data[buf.len+2:], uuid_bytes[:])
copy(buf.data[buf.len+2+16:], data)
buf.len += uint8(fieldLength)
Expand Down Expand Up @@ -579,7 +579,7 @@ func (buf *rawAdvertisementPayload) addServiceUUID(uuid UUID) (ok bool) {
}
buf.data[buf.len+0] = 17 // length of field, including type
buf.data[buf.len+1] = 0x07 // type, 0x07 means "Complete List of 128-bit Service Class UUIDs"
rawUUID := uuid.Bytes()
rawUUID := uuid.bytes()
copy(buf.data[buf.len+2:], rawUUID[:])
buf.len += 18
return true
Expand Down
2 changes: 1 addition & 1 deletion gap_hci.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func (a *Advertisement) Start() error {
binary.LittleEndian.PutUint16(advertisingData[5:], uuid.Get16Bit())
case uuid.Is32Bit():
sz = 6
data := uuid.Bytes()
data := uuid.bytes()
slices.Reverse(data[:])
copy(advertisingData[5:], data[:])
}
Expand Down
2 changes: 1 addition & 1 deletion gap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestServiceUUIDs(t *testing.T) {
raw string
expected []UUID
}
uuidBytes := ServiceUUIDAdafruitSound.Bytes()
uuidBytes := ServiceUUIDAdafruitSound.bytes()
tests := []testCase{
{},
{
Expand Down
4 changes: 2 additions & 2 deletions gatts_hci.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ type Characteristic struct {
// AddService creates a new service with the characteristics listed in the
// Service struct.
func (a *Adapter) AddService(service *Service) error {
uuid := service.UUID.Bytes()
uuid := service.UUID.bytes()
serviceHandle := a.att.addLocalAttribute(attributeTypeService, 0, shortUUID(gattServiceUUID).UUID(), 0, uuid[:])
valueHandle := serviceHandle
endHandle := serviceHandle

for i := range service.Characteristics {
data := service.Characteristics[i].UUID.Bytes()
data := service.Characteristics[i].UUID.bytes()
cuuid := append([]byte{}, data[:]...)

// add characteristic declaration
Expand Down
2 changes: 1 addition & 1 deletion tools/gen-characteristic-uuids/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (c Characteristic) UUIDFunc() string {
if err != nil {
panic(err)
}
b := uuid.Bytes()
b := uuid.bytes()
bs := hex.EncodeToString(b[:])
bss := ""
for i := 0; i < len(bs); i += 2 {
Expand Down
2 changes: 1 addition & 1 deletion tools/gen-service-uuids/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (s Service) UUIDFunc() string {
if err != nil {
panic(err)
}
b := uuid.Bytes()
b := uuid.bytes()
bs := hex.EncodeToString(b[:])
bss := ""
for i := 0; i < len(bs); i += 2 {
Expand Down
Loading
Loading