-
Notifications
You must be signed in to change notification settings - Fork 0
/
bluez_const.go
135 lines (129 loc) · 5.05 KB
/
bluez_const.go
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
package bluez
import "github.com/godbus/dbus/introspect"
const (
DBusIntrospectableInterface = "org.freedesktop.DBus.Introspectable"
DBusPropertiesInterface = "org.freedesktop.DBus.Properties"
DBusPropertiesIntro = `
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in" />
<arg name="name" type="s" direction="in" />
<arg name="value" type="v" direction="out" />
</method>
<method name="Set">
<arg name="interface" type="s" direction="in" />
<arg name="name" type="s" direction="in" />
<arg name="value" type="v" direction="in" />
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in" />
<arg name="properties" type="a{sv}" direction="out" />
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" />
<arg name="changed_properties" type="a{sv}" />
<arg name="invalidated_properties" type="as" />
</signal>
</interface>
`
GattService1Interface = "org.bluez.GattService1"
GattService1Intro = `<node>
<interface name="org.bluez.GattService1">
<property name="UUID" type="s" access="read" />
<property name="Primary" type="b" access="read" />
</interface>` + DBusPropertiesIntro + introspect.IntrospectDataString + `</node>`
GattCharacteristic1Interface = "org.bluez.GattCharacteristic1"
GattCharacteristic1Intro = `<node>
<interface name="org.bluez.GattCharacteristic1">
<property name="UUID" type="s" access="read" />
</interface>` + DBusPropertiesIntro + introspect.IntrospectDataString + `</node>`
ObjectManagerInterface = "org.freedesktop.DBus.ObjectManager"
ObjectManagerIntro = `<node>
<interface name="org.freedesktop.DBus.ObjectManager">
<method name="GetManagedObjects">
<arg name="objects" type="a{oa{sa{sv}}}" direction="out"/>
</method>
<signal name="InterfacesAdded">
<arg name="Object" type="o"/>
<arg name="interfaces" type="a{sa{sv}}"/>
</signal>
<signal name="InterfacesRemoved">
<arg name="Object" type="o"/>
<arg name="interfaces" type="as"/>
</signal>
</interface>` + DBusPropertiesIntro + introspect.IntrospectDataString + `</node>`
LEAdvertisement1Interface = "org.bluez.LEAdvertisement1"
LEAdvertisement1Intro = `
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml" type="s" direction="out" />
</method>
</interface>
<interface name="org.bluez.LEAdvertisement1">
<method name="Release" />
<property name="Type" type="s" access="read" />
<property name="ServiceUUIDs" type="as" access="read" />
<property name="Includes" type="as" access="read" />
<property name="LocalName" type="s" access="read" />
<property name="Duration" type="u" access="read" />
<property name="Timeout" type="u" access="read" />
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in" />
<arg name="name" type="s" direction="in" />
<arg name="value" type="v" direction="out" />
</method>
<method name="Set">
<arg name="interface" type="s" direction="in" />
<arg name="name" type="s" direction="in" />
<arg name="value" type="v" direction="in" />
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in" />
<arg name="properties" type="a{sv}" direction="out" />
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" />
<arg name="changed_properties" type="a{sv}" />
<arg name="invalidated_properties" type="as" />
</signal>
</interface>
</node>`
Agent1Interface = "org.bluez.Agent1"
Agent1Intro = `
<node>
<interface name="org.bluez.Agent1">
<method name="Release" />
<method name="RequestPinCode">
<arg direction="in" type="o" />
<arg direction="out" type="s" />
</method>
<method name="DisplayPinCode">
<arg direction="in" type="o" />
<arg direction="in" type="s" />
</method>
<method name="RequestPasskey">
<arg direction="in" type="o" />
<arg direction="out" type="u" />
</method>
<method name="DisplayPasskey">
<arg direction="in" type="o" />
<arg direction="in" type="u" />
<arg direction="in" type="q" />
</method>
<method name="RequestConfirmation">
<arg direction="in" type="o" />
<arg direction="in" type="u" />
</method>
<method name="RequestAuthorization">
<arg direction="in" type="o" />
</method>
<method name="AuthorizeService">
<arg direction="in" type="o" />
<arg direction="in" type="s" />
</method>
<method name="Cancel" />
</interface>` + DBusPropertiesIntro + introspect.IntrospectDataString + `</node>`
)