-
Notifications
You must be signed in to change notification settings - Fork 0
/
hap.go
49 lines (43 loc) · 1.47 KB
/
hap.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
package hkontroller
// Status codes for json communication.
const (
JsonStatusSuccess = 0
JsonStatusInsufficientPrivileges = -70401
JsonStatusServiceCommunicationFailure = -70402
JsonStatusResourceBusy = -70403
JsonStatusReadOnlyCharacteristic = -70404
JsonStatusWriteOnlyCharacteristic = -70405
JsonStatusNotificationNotSupported = -70406
JsonStatusOutOfResource = -70407
JsonStatusOperationTimedOut = -70408
JsonStatusResourceDoesNotExist = -70409
JsonStatusInvalidValueInRequest = -70410
)
const (
// HTTPContentTypePairingTLV8 is the HTTP content type for tlv8 data
HTTPContentTypePairingTLV8 = "application/pairing+tlv8"
// HTTPContentTypeHAPJson is the HTTP content type for json data
HTTPContentTypeHAPJson = "application/hap+json"
)
const (
MethodPair byte = 0x0 // pair
MethodPairMFi byte = 0x1 // MFi compliant accessory
MethodVerifyPair byte = 0x2 // verify a pairing
MethodAddPairing byte = 0x3 // add client through secure connection
MethodDeletePairing byte = 0x4 // delete pairing through secure connection
MethodListPairings byte = 0x5
)
const (
// PermissionUser is the user permission for a devices controller.
PermissionUser byte = 0x0
// PermissionAdmin is the administrator permission for a devices controller.
PermissionAdmin byte = 0x1
)
const (
M1 byte = 0x1
M2 byte = 0x2
M3 byte = 0x3
M4 byte = 0x4
M5 byte = 0x5
M6 byte = 0x6
)