File: gatt.go

package info (click to toggle)
golang-github-muka-go-bluetooth 5.60-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,688 kB
  • sloc: makefile: 92; sh: 2
file content (33 lines) | stat: -rw-r--r-- 781 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package service

import (
	"github.com/muka/go-bluetooth/bluez/profile/gatt"
)

// Create a new GattService1Properties
func NewGattService1Properties(uuid string) *gatt.GattService1Properties {
	return &gatt.GattService1Properties{
		IsService: true,
		Primary:   true,
		UUID:      uuid,
	}
}

// Create a new GattCharacteristic1Properties
func NewGattCharacteristic1Properties(uuid string) *gatt.GattCharacteristic1Properties {
	return &gatt.GattCharacteristic1Properties{
		UUID:  uuid,
		Flags: []string{},
	}
}

// Create a new GattDescriptor1Properties
func NewGattDescriptor1Properties(uuid string) *gatt.GattDescriptor1Properties {
	return &gatt.GattDescriptor1Properties{
		UUID: uuid,
		Flags: []string{
			gatt.FlagDescriptorRead,
			gatt.FlagDescriptorWrite,
		},
	}
}