forked from brutella/hap
-
Notifications
You must be signed in to change notification settings - Fork 2
/
hap.go
53 lines (47 loc) · 1.67 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
50
51
52
53
package hap
// 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
)
// Error codes for TLV8 communication.
const (
TlvErrorUnknown = 0x1
TlvErrorInvalidRequest = 0x2
TlvErrorAuthentication = 0x2
TlvErrorBackoff = 0x3
TlvErrorMaxPeers = 0x4
TlvErrorUnknownPeer = 0x4
TlvErrorMaxTries = 0x5
TlvErrorUnavailable = 0x6
TlvErrorBusy = 0x7
)
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 paired controller.
PermissionUser byte = 0x0
// PermissionAdmin is the administrator permission for a paired controller.
PermissionAdmin byte = 0x1
)