File: properties.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 (48 lines) | stat: -rw-r--r-- 1,600 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package override

func GetPropertiesOverride(iface string) (map[string]string, bool) {
	if props, ok := PropertyTypes[iface]; ok {
		return props, ok
	}
	return map[string]string{}, false
}

var PropertyTypes = map[string]map[string]string{
	"org.bluez.Device1": {
		"ServiceData":      "map[string]interface{}",
		"ManufacturerData": "map[uint16]interface{}",
	},
	"org.bluez.GattCharacteristic1": {
		"Value":          "[]byte `dbus:\"emit\"`",
		"Descriptors":    "[]dbus.ObjectPath",
		"WriteAcquired":  "bool `dbus:\"ignore\"`",
		"NotifyAcquired": "bool `dbus:\"ignore\"`",
	},
	"org.bluez.GattDescriptor1": {
		"Value":          "[]byte `dbus:\"emit\"`",
		"Characteristic": "dbus.ObjectPath",
	},
	"org.bluez.GattService1": {
		"Characteristics": "[]dbus.ObjectPath `dbus:\"emit\"`",
		"Includes":        "[]dbus.ObjectPath `dbus:\"omitEmpty\"`",
		"Device":          "dbus.ObjectPath `dbus:\"ignore=IsService\"`",
		"IsService":       "bool `dbus:\"ignore\"`",
	},
	"org.bluez.LEAdvertisement1": {
		// dbus type: (yv) dict of byte variant (array of bytes)
		"Data": "map[byte]interface{}",
		// dbus type: (qv) dict of uint16 variant (array of bytes)
		"ManufacturerData": "map[uint16]interface{}",
		// dbus type: (s[v]) dict of string variant (array of bytes)
		"ServiceData": "map[string]interface{}",
		// SecondaryChannel, if set on 5.54 cause a parsing exception
		"SecondaryChannel": "string `dbus:\"omitEmpty\"`",
	},
	"org.bluez.AdvertisementMonitor1": {
		// array{(uint8, uint8, array{byte})}
		"Patterns": "[]Pattern",
	},
	"org.bluez.MediaPlayer1": {
		"Track": "Track",
	},
}