-
Notifications
You must be signed in to change notification settings - Fork 15
/
const.go
67 lines (49 loc) · 1.89 KB
/
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
/*
Copyright 2018 the original author or authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ibbq
import "github.com/mgutz/logxi/v1"
// SettingResult NOTIFY
const SettingResult = "fff1"
// AccountAndVerify WRITE
const AccountAndVerify = "fff2"
// HistoryData NOTIFY
const HistoryData = "fff3"
// RealTimeData NOTIFY
const RealTimeData = "fff4"
// SettingData WRITE
const SettingData = "fff5"
// DeviceName is the name we look for when we scan.
const DeviceName = "iBBQ"
// Status represents our connection status
type Status string
const (
// Disconnected means we are not connected
Disconnected Status = "Disconnected"
//Connecting means we are establishing a connection/session
Connecting Status = "Connecting"
// Connected means we have established a connection/session
Connected Status = "Connected"
// Disconnecting means we have requested to disconnect and are awaiting acknowledgement
Disconnecting Status = "Disconnecting"
)
var (
// Credentials stores our login credentials for the thermometer.
Credentials = []byte{0x21, 0x07, 0x06,
0x05, 0x04, 0x03, 0x02, 0x01, 0xb8, 0x22,
0x00, 0x00, 0x00, 0x00, 0x00}
realTimeDataEnable = []byte{0x0B, 0x01, 0x00, 0x00, 0x00, 0x00}
unitsFahrenheit = []byte{0x02, 0x01, 0x00, 0x00, 0x00, 0x00}
unitsCelsius = []byte{0x02, 0x00, 0x00, 0x00, 0x00, 0x00}
batteryLevel = []byte{0x08, 0x24, 0x00, 0x00, 0x00, 0x00}
logger = log.New("ibbq")
)