| 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 ThermometerWatcher1Interfacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Interface. = "org.bluez.ThermometerWatcher1" |
| 15 | |
| 16 | // NewThermometerWatcher1 create a new instance of ThermometerWatcher1 |
| 17 | // |
| 18 | // Args: |
| 19 | // - servicePath: unique name |
| 20 | // - objectPath: freely definable |
| 21 | func NewThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/NewThermometerWatcher1().(servicePath string, 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#) (*ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#, error) { |
| 22 | a := new(ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) |
| 23 | a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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().( |
| 24 | &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#{ |
| 25 | Namescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Name.: servicePath, |
| 26 | Ifacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Config#Iface.: ThermometerWatcher1Interfacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Interface., |
| 27 | 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), |
| 28 | 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., |
| 29 | }, |
| 30 | ) |
| 31 | a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#Properties. = new(ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#) |
| 32 | |
| 33 | _, err := a.GetPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#GetProperties().() |
| 34 | if err != nil { |
| 35 | return nil, err |
| 36 | } |
| 37 | return a, nil |
| 38 | } |
| 39 | |
| 40 | /* |
| 41 | ThermometerWatcher1 Health Thermometer Watcher hierarchy |
| 42 | |
| 43 | */ |
| 44 | type ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1# struct { |
| 45 | clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# |
| 46 | propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# |
| 47 | objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# |
| 48 | objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# |
| 49 | Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#Properties. *ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties# |
| 50 | watchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# |
| 51 | } |
| 52 | |
| 53 | // ThermometerWatcher1Properties contains the exposed properties of an interface |
| 54 | type ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties# struct { |
| 55 | lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#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"` |
| 56 | } |
| 57 | |
| 58 | //Lock access to properties |
| 59 | func (p *ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#) Lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#Lock().() { |
| 60 | p.lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#lock..Lockscip-go gomod github.com/golang/go/src go1.14 sync/RWMutex#Lock().() |
| 61 | } |
| 62 | |
| 63 | //Unlock access to properties |
| 64 | func (p *ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#) Unlockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#Unlock().() { |
| 65 | p.lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#lock..Unlockscip-go gomod github.com/golang/go/src go1.14 sync/RWMutex#Unlock().() |
| 66 | } |
| 67 | |
| 68 | // Close the connection |
| 69 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) Closescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#Close().() { |
| 70 | a.unregisterPropertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#unregisterPropertiesSignal().() |
| 71 | a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#client..Disconnectscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#Disconnect().() |
| 72 | } |
| 73 | |
| 74 | // Path return ThermometerWatcher1 object path |
| 75 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) Pathscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# { |
| 76 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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. |
| 77 | } |
| 78 | |
| 79 | // Client return ThermometerWatcher1 dbus client |
| 80 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) Clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# { |
| 81 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#client. |
| 82 | } |
| 83 | |
| 84 | // Interface return ThermometerWatcher1 interface |
| 85 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) Interfacescip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#Interface().() string { |
| 86 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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. |
| 87 | } |
| 88 | |
| 89 | // GetObjectManagerSignal return a channel for receiving updates from the ObjectManager |
| 90 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) GetObjectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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) { |
| 91 | |
| 92 | if a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManagerSignal. == nil { |
| 93 | if a.objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManager. == nil { |
| 94 | 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().() |
| 95 | if err != nil { |
| 96 | return nil, nil, err |
| 97 | } |
| 98 | a.objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManager. = om |
| 99 | } |
| 100 | |
| 101 | s, err := a.objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManager..Registerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/ObjectManager#Register().() |
| 102 | if err != nil { |
| 103 | return nil, nil, err |
| 104 | } |
| 105 | a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManagerSignal. = s |
| 106 | } |
| 107 | |
| 108 | cancel := func() { |
| 109 | if a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManagerSignal. == nil { |
| 110 | return |
| 111 | } |
| 112 | a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManagerSignal. <- nil |
| 113 | a.objectManagerscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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`/ThermometerWatcher1#objectManagerSignal.) |
| 114 | a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManagerSignal. = nil |
| 115 | } |
| 116 | |
| 117 | return a.objectManagerSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#objectManagerSignal., cancel, nil |
| 118 | } |
| 119 | |
| 120 | // ToMap convert a ThermometerWatcher1Properties to map |
| 121 | func (a *ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#) ToMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#ToMap().() (map[string]interface{}, error) { |
| 122 | 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 |
| 123 | } |
| 124 | |
| 125 | // FromMap convert a map to an ThermometerWatcher1Properties |
| 126 | func (a *ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#) FromMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#FromMap().(props map[string]interface{}) (*ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#, error) { |
| 127 | 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#{} |
| 128 | for k, val := range props { |
| 129 | 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) |
| 130 | } |
| 131 | return a.FromDBusMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#FromDBusMap().(props1) |
| 132 | } |
| 133 | |
| 134 | // FromDBusMap convert a map to an ThermometerWatcher1Properties |
| 135 | func (a *ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#) FromDBusMapscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#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#) (*ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#, error) { |
| 136 | s := new(ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#) |
| 137 | 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) |
| 138 | return s, err |
| 139 | } |
| 140 | |
| 141 | // ToProps return the properties interface |
| 142 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) ToPropsscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# { |
| 143 | return a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#Properties. |
| 144 | } |
| 145 | |
| 146 | // GetWatchPropertiesChannel return the dbus channel to receive properties interface |
| 147 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) GetWatchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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# { |
| 148 | return a.watchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#watchPropertiesChannel. |
| 149 | } |
| 150 | |
| 151 | // SetWatchPropertiesChannel set the dbus channel to receive properties interface |
| 152 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) SetWatchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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#) { |
| 153 | a.watchPropertiesChannelscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#watchPropertiesChannel. = c |
| 154 | } |
| 155 | |
| 156 | // GetProperties load all available properties |
| 157 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) GetPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#GetProperties().() (*ThermometerWatcher1Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#, error) { |
| 158 | a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#Properties..Lockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#Lock().() |
| 159 | err := a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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`/ThermometerWatcher1#Properties.) |
| 160 | a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#Properties..Unlockscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1Properties#Unlock().() |
| 161 | return a.Propertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#Properties., err |
| 162 | } |
| 163 | |
| 164 | // SetProperty set a property |
| 165 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) SetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#SetProperty().(name string, value interface{}) error { |
| 166 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#client..SetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#SetProperty().(name, value) |
| 167 | } |
| 168 | |
| 169 | // GetProperty get a property |
| 170 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) GetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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) { |
| 171 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#client..GetPropertyscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#GetProperty().(name) |
| 172 | } |
| 173 | |
| 174 | // GetPropertiesSignal return a channel for receiving udpdates on property changes |
| 175 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) GetPropertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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) { |
| 176 | |
| 177 | if a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#propertiesSignal. == nil { |
| 178 | s, err := a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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`/ThermometerWatcher1#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.) |
| 179 | if err != nil { |
| 180 | return nil, err |
| 181 | } |
| 182 | a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#propertiesSignal. = s |
| 183 | } |
| 184 | |
| 185 | return a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#propertiesSignal., nil |
| 186 | } |
| 187 | |
| 188 | // Unregister for changes signalling |
| 189 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) unregisterPropertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#unregisterPropertiesSignal().() { |
| 190 | if a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#propertiesSignal. != nil { |
| 191 | a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#propertiesSignal. <- nil |
| 192 | a.propertiesSignalscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#propertiesSignal. = nil |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | // WatchProperties updates on property changes |
| 197 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) WatchPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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) { |
| 198 | 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) |
| 199 | } |
| 200 | |
| 201 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) UnwatchPropertiesscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#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 { |
| 202 | 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) |
| 203 | } |
| 204 | |
| 205 | /* |
| 206 | MeasurementReceived This callback gets called when a measurement has been |
| 207 | scanned in the thermometer. |
| 208 | Measurement: |
| 209 | int16 Exponent: |
| 210 | int32 Mantissa: |
| 211 | Exponent and Mantissa values as |
| 212 | extracted from float value defined by |
| 213 | IEEE-11073-20601. |
| 214 | Measurement value is calculated as |
| 215 | (Mantissa) * (10^Exponent) |
| 216 | For special cases Exponent is |
| 217 | set to 0 and Mantissa is set to |
| 218 | one of following values: |
| 219 | +(2^23 - 1) NaN (invalid or |
| 220 | missing data) |
| 221 | -(2^23) NRes |
| 222 | +(2^23 - 2) +Infinity |
| 223 | -(2^23 - 2) -Infinity |
| 224 | string Unit: |
| 225 | Possible values: "celsius" or |
| 226 | "fahrenheit" |
| 227 | uint64 Time (optional): |
| 228 | Time of measurement, if |
| 229 | supported by device. |
| 230 | Expressed in seconds since epoch. |
| 231 | string Type (optional): |
| 232 | Only present if measurement type |
| 233 | is known. |
| 234 | Possible values: "armpit", "body", |
| 235 | "ear", "finger", "intestines", |
| 236 | "mouth", "rectum", "toe", |
| 237 | "tympanum" |
| 238 | string Measurement: |
| 239 | Possible values: "final" or |
| 240 | "intermediate" |
| 241 | |
| 242 | */ |
| 243 | func (a *ThermometerWatcher1scip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#) MeasurementReceivedscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#MeasurementReceived().(measurement map[string]interface{}) error { |
| 244 | return a.clientscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez/profile/thermometer`/ThermometerWatcher1#client..Callscip-go gomod github.com/muka/go-bluetooth . `github.com/muka/go-bluetooth/bluez`/Client#Call().("MeasurementReceived", 0, measurement).Storescip-go gomod github.com/godbus/dbus/v5 v5.0.3 `github.com/godbus/dbus/v5`/Call#Store().() |
| 245 | } |