OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_PACKET_H_ | |
6 #define COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_PACKET_H_ | |
7 | |
8 #include <stddef.h> | |
9 #include <stdint.h> | |
10 | |
11 #include <vector> | |
12 | |
13 namespace proximity_auth { | |
14 namespace weave { | |
15 | |
16 enum PacketType { DATA = 0x00, CONTROL = 0x01 }; | |
17 | |
18 // Identify the action intended by the control packet. | |
19 enum ControlCommand { | |
20 CONNECTION_REQUEST = 0x00, | |
21 CONNECTION_RESPONSE = 0x01, | |
22 CONNECTION_CLOSE = 0x02 | |
23 }; | |
24 | |
25 // Sent with the ConnectionClose control packet. | |
26 // Identify why the client/server wished to close the connection. | |
27 enum ReasonForClose { | |
28 CLOSE_WITHOUT_ERROR = 0x00, | |
29 UNKNOWN_ERROR = 0x01, | |
30 NO_COMMON_VERSION_SUPPORTED = 0x02, | |
31 RECEIVED_PACKET_OUT_OF_SEQUENCE = 0x03, | |
32 APPLICATION_ERROR = 0x80 | |
33 }; | |
34 | |
35 typedef std::vector<uint8_t> Packet; | |
36 | |
37 const uint16_t kDefaultMaxPacketSize = 20; | |
Kyle Horimoto
2016/06/27 22:25:41
Hmm, does this work? I thought you had to declare
jingxuy
2016/06/27 22:49:08
it's passing the test so I presume so?
| |
38 const uint16_t kWeaveVersion = 1; | |
39 const uint16_t kSelectMaxPacketSize = 0; | |
40 const uint8_t kMaxPacketCounter = 8; | |
41 | |
42 const uint8_t kByteDefaultMaxPacketSize = 20; | |
43 const uint8_t kByteWeaveVersion = 1; | |
44 const uint8_t kByteSelectMaxPacketSize = 0; | |
45 const uint8_t kEmptyUpperByte = 0; | |
46 | |
47 } // namespace weave | |
48 } // namespace proximity_auth | |
49 | |
50 #endif // COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_PACKET_H_ | |
OLD | NEW |