| 1 | // Code generated by go-bluetooth generator DO NOT EDIT. |
| 2 | |
| 3 | package thermometerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ |
| 4 | |
| 5 | import ( |
| 6 | "syncscip-go gomod github.com/golang/go/src go1.14 sync/" |
| 7 | |
| 8 | "github.com/godbus/dbus/v5scip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/" |
| 9 | "github.com/muka/go-bluetooth/bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/" |
| 10 | "github.com/muka/go-bluetooth/propsscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/props`/" |
| 11 | "github.com/muka/go-bluetooth/utilscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/util`/" |
| 12 | ) |
| 13 | |
| 14 | var Thermometer1Interfacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Interface. = "org.bluez.Thermometer1" |
| 15 | |
| 16 | // NewThermometer1 create a new instance of Thermometer1 |
| 17 | // |
| 18 | // Args: |
| 19 | // - objectPath: [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX |
| 20 | func NewThermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/NewThermometer1().(objectPath dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.ObjectPathscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/ObjectPath#) (*Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#, error) { |
| 21 | a := new(Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) |
| 22 | a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client. = bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.NewClientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/NewClient().( |
| 23 | &bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.Configscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#{ |
| 24 | Namescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Name.: "org.bluez", |
| 25 | Ifacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Iface.: Thermometer1Interfacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Interface., |
| 26 | Pathscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Path.: dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.ObjectPathscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/ObjectPath#(objectPath), |
| 27 | Busscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Bus.: bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.SystemBusscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/SystemBus., |
| 28 | }, |
| 29 | ) |
| 30 | a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Properties. = new(Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#) |
| 31 | |
| 32 | _, err := a.GetPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetProperties().() |
| 33 | if err != nil { |
| 34 | return nil, err |
| 35 | } |
| 36 | return a, nil |
| 37 | } |
| 38 | |
| 39 | /* |
| 40 | Thermometer1 Health Thermometer Profile hierarchy |
| 41 | |
| 42 | */ |
| 43 | type Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1# struct { |
| 44 | clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client. *bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.Clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client# |
| 45 | propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#propertiesSignal. chan *dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Signalscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Signal# |
| 46 | objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManagerSignal. chan *dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Signalscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Signal# |
| 47 | objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManager. *bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.ObjectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/ObjectManager# |
| 48 | Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Properties. *Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties# |
| 49 | watchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#watchPropertiesChannel. chan *dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Signalscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Signal# |
| 50 | } |
| 51 | |
| 52 | // Thermometer1Properties contains the exposed properties of an interface |
| 53 | type Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties# struct { |
| 54 | lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#lock. syncscip-go gomod github.com/golang/go/src go1.14 sync/.RWMutexscip-go gomod github.com/golang/go/src go1.14 sync/RWMutex# `dbus:"ignore"` |
| 55 | |
| 56 | /* |
| 57 | Intermediate True if the thermometer supports intermediate |
| 58 | measurement notifications. |
| 59 | */ |
| 60 | Intermediatescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#Intermediate. bool |
| 61 | |
| 62 | /* |
| 63 | Interval (optional) The Measurement Interval defines the time (in |
| 64 | seconds) between measurements. This interval is |
| 65 | not related to the intermediate measurements and |
| 66 | must be defined into a valid range. Setting it |
| 67 | to zero means that no periodic measurements will |
| 68 | be taken. |
| 69 | */ |
| 70 | Intervalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#Interval. uint16 |
| 71 | |
| 72 | /* |
| 73 | Maximum (optional) Defines the maximum value allowed for the interval |
| 74 | between periodic measurements. |
| 75 | */ |
| 76 | Maximumscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#Maximum. uint16 |
| 77 | |
| 78 | /* |
| 79 | Minimum (optional) Defines the minimum value allowed for the interval |
| 80 | between periodic measurements. |
| 81 | */ |
| 82 | Minimumscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#Minimum. uint16 |
| 83 | } |
| 84 | |
| 85 | //Lock access to properties |
| 86 | func (p *Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#) Lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#Lock().() { |
| 87 | p.lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#lock..Lockscip-go gomod github.com/golang/go/src go1.14 sync/RWMutex#Lock().() |
| 88 | } |
| 89 | |
| 90 | //Unlock access to properties |
| 91 | func (p *Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#) Unlockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#Unlock().() { |
| 92 | p.lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#lock..Unlockscip-go gomod github.com/golang/go/src go1.14 sync/RWMutex#Unlock().() |
| 93 | } |
| 94 | |
| 95 | // SetIntermediate set Intermediate value |
| 96 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) SetIntermediatescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetIntermediate().(v bool) error { |
| 97 | return a.SetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetProperty().("Intermediate", v) |
| 98 | } |
| 99 | |
| 100 | // GetIntermediate get Intermediate value |
| 101 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetIntermediatescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetIntermediate().() (bool, error) { |
| 102 | v, err := a.GetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetProperty().("Intermediate") |
| 103 | if err != nil { |
| 104 | return false, err |
| 105 | } |
| 106 | return v.Valuescip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Variant#Value().().(bool), nil |
| 107 | } |
| 108 | |
| 109 | // SetInterval set Interval value |
| 110 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) SetIntervalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetInterval().(v uint16) error { |
| 111 | return a.SetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetProperty().("Interval", v) |
| 112 | } |
| 113 | |
| 114 | // GetInterval get Interval value |
| 115 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetIntervalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetInterval().() (uint16, error) { |
| 116 | v, err := a.GetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetProperty().("Interval") |
| 117 | if err != nil { |
| 118 | return uint16(0), err |
| 119 | } |
| 120 | return v.Valuescip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Variant#Value().().(uint16), nil |
| 121 | } |
| 122 | |
| 123 | // SetMaximum set Maximum value |
| 124 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) SetMaximumscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetMaximum().(v uint16) error { |
| 125 | return a.SetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetProperty().("Maximum", v) |
| 126 | } |
| 127 | |
| 128 | // GetMaximum get Maximum value |
| 129 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetMaximumscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetMaximum().() (uint16, error) { |
| 130 | v, err := a.GetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetProperty().("Maximum") |
| 131 | if err != nil { |
| 132 | return uint16(0), err |
| 133 | } |
| 134 | return v.Valuescip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Variant#Value().().(uint16), nil |
| 135 | } |
| 136 | |
| 137 | // SetMinimum set Minimum value |
| 138 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) SetMinimumscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetMinimum().(v uint16) error { |
| 139 | return a.SetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetProperty().("Minimum", v) |
| 140 | } |
| 141 | |
| 142 | // GetMinimum get Minimum value |
| 143 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetMinimumscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetMinimum().() (uint16, error) { |
| 144 | v, err := a.GetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetProperty().("Minimum") |
| 145 | if err != nil { |
| 146 | return uint16(0), err |
| 147 | } |
| 148 | return v.Valuescip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Variant#Value().().(uint16), nil |
| 149 | } |
| 150 | |
| 151 | // Close the connection |
| 152 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) Closescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Close().() { |
| 153 | a.unregisterPropertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#unregisterPropertiesSignal().() |
| 154 | a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client..Disconnectscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#Disconnect().() |
| 155 | } |
| 156 | |
| 157 | // Path return Thermometer1 object path |
| 158 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) Pathscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Path().() dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.ObjectPathscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/ObjectPath# { |
| 159 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client..Configscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#Config..Pathscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Path. |
| 160 | } |
| 161 | |
| 162 | // Client return Thermometer1 dbus client |
| 163 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) Clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Client().() *bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.Clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client# { |
| 164 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client. |
| 165 | } |
| 166 | |
| 167 | // Interface return Thermometer1 interface |
| 168 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) Interfacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Interface().() string { |
| 169 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client..Configscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#Config..Ifacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Iface. |
| 170 | } |
| 171 | |
| 172 | // GetObjectManagerSignal return a channel for receiving updates from the ObjectManager |
| 173 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetObjectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetObjectManagerSignal().() (chan *dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Signalscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Signal#, func(), error) { |
| 174 | |
| 175 | if a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManagerSignal. == nil { |
| 176 | if a.objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManager. == nil { |
| 177 | om, err := bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.GetObjectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/GetObjectManager().() |
| 178 | if err != nil { |
| 179 | return nil, nil, err |
| 180 | } |
| 181 | a.objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManager. = om |
| 182 | } |
| 183 | |
| 184 | s, err := a.objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManager..Registerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/ObjectManager#Register().() |
| 185 | if err != nil { |
| 186 | return nil, nil, err |
| 187 | } |
| 188 | a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManagerSignal. = s |
| 189 | } |
| 190 | |
| 191 | cancel := func() { |
| 192 | if a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManagerSignal. == nil { |
| 193 | return |
| 194 | } |
| 195 | a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManagerSignal. <- nil |
| 196 | a.objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManager..Unregisterscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/ObjectManager#Unregister().(a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManagerSignal.) |
| 197 | a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManagerSignal. = nil |
| 198 | } |
| 199 | |
| 200 | return a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#objectManagerSignal., cancel, nil |
| 201 | } |
| 202 | |
| 203 | // ToMap convert a Thermometer1Properties to map |
| 204 | func (a *Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#) ToMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#ToMap().() (map[string]interface{}, error) { |
| 205 | return propsscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/props`/.ToMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/props`/ToMap().(a), nil |
| 206 | } |
| 207 | |
| 208 | // FromMap convert a map to an Thermometer1Properties |
| 209 | func (a *Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#) FromMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#FromMap().(props map[string]interface{}) (*Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#, error) { |
| 210 | props1 := map[string]dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Variantscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Variant#{} |
| 211 | for k, val := range props { |
| 212 | props1[k] = dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.MakeVariantscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/MakeVariant().(val) |
| 213 | } |
| 214 | return a.FromDBusMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#FromDBusMap().(props1) |
| 215 | } |
| 216 | |
| 217 | // FromDBusMap convert a map to an Thermometer1Properties |
| 218 | func (a *Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#) FromDBusMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#FromDBusMap().(props map[string]dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Variantscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Variant#) (*Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#, error) { |
| 219 | s := new(Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#) |
| 220 | err := utilscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/util`/.MapToStructscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/util`/MapToStruct().(s, props) |
| 221 | return s, err |
| 222 | } |
| 223 | |
| 224 | // ToProps return the properties interface |
| 225 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) ToPropsscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#ToProps().() bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Properties# { |
| 226 | return a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Properties. |
| 227 | } |
| 228 | |
| 229 | // GetWatchPropertiesChannel return the dbus channel to receive properties interface |
| 230 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetWatchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetWatchPropertiesChannel().() chan *dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Signalscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Signal# { |
| 231 | return a.watchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#watchPropertiesChannel. |
| 232 | } |
| 233 | |
| 234 | // SetWatchPropertiesChannel set the dbus channel to receive properties interface |
| 235 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) SetWatchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetWatchPropertiesChannel().(c chan *dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Signalscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Signal#) { |
| 236 | a.watchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#watchPropertiesChannel. = c |
| 237 | } |
| 238 | |
| 239 | // GetProperties load all available properties |
| 240 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetProperties().() (*Thermometer1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#, error) { |
| 241 | a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Properties..Lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#Lock().() |
| 242 | err := a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client..GetPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#GetProperties().(a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Properties.) |
| 243 | a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Properties..Unlockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1Properties#Unlock().() |
| 244 | return a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#Properties., err |
| 245 | } |
| 246 | |
| 247 | // SetProperty set a property |
| 248 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) SetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#SetProperty().(name string, value interface{}) error { |
| 249 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client..SetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#SetProperty().(name, value) |
| 250 | } |
| 251 | |
| 252 | // GetProperty get a property |
| 253 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetProperty().(name string) (dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Variantscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Variant#, error) { |
| 254 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client..GetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#GetProperty().(name) |
| 255 | } |
| 256 | |
| 257 | // GetPropertiesSignal return a channel for receiving udpdates on property changes |
| 258 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) GetPropertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#GetPropertiesSignal().() (chan *dbusscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/.Signalscip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Signal#, error) { |
| 259 | |
| 260 | if a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#propertiesSignal. == nil { |
| 261 | s, err := a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client..Registerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#Register().(a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#client..Configscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#Config..Pathscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Path., bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.PropertiesInterfacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/PropertiesInterface.) |
| 262 | if err != nil { |
| 263 | return nil, err |
| 264 | } |
| 265 | a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#propertiesSignal. = s |
| 266 | } |
| 267 | |
| 268 | return a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#propertiesSignal., nil |
| 269 | } |
| 270 | |
| 271 | // Unregister for changes signalling |
| 272 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) unregisterPropertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#unregisterPropertiesSignal().() { |
| 273 | if a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#propertiesSignal. != nil { |
| 274 | a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#propertiesSignal. <- nil |
| 275 | a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#propertiesSignal. = nil |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | // WatchProperties updates on property changes |
| 280 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) WatchPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#WatchProperties().() (chan *bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.PropertyChangedscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/PropertyChanged#, error) { |
| 281 | return bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.WatchPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/WatchProperties().(a) |
| 282 | } |
| 283 | |
| 284 | func (a *Thermometer1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#) UnwatchPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/Thermometer1#UnwatchProperties().(ch chan *bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.PropertyChangedscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/PropertyChanged#) error { |
| 285 | return bluezscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/.UnwatchPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/UnwatchProperties().(a, ch) |
| 286 | } |