hci-decoder  1.0
Lightweight Bluetooth HCI decoder library parsing individually HCI frames into JSON format
command_complete.h
Go to the documentation of this file.
1 /************************************************************************************
2  * The MIT License (MIT) *
3  * *
4  * Copyright (c) 2015 Bertrand Martel *
5  * *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy *
7  * of this software and associated documentation files (the "Software"), to deal *
8  * in the Software without restriction, including without limitation the rights *
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
10  * copies of the Software, and to permit persons to whom the Software is *
11  * furnished to do so, subject to the following conditions: *
12  * *
13  * The above copyright notice and this permission notice shall be included in *
14  * all copies or substantial portions of the Software. *
15  * *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
22  * THE SOFTWARE. *
23  ************************************************************************************/
31 #ifndef COMMANDCOMPLETE_H
32 #define COMMANDCOMPLETE_H
33 
36 #include "json/json.h"
37 
38 /* HCI Event 0x0E : Command Complete Event*/
40 {
41 
42 public:
43 
44  CommandComplete(const std::vector<char> &data);
45 
47 
48  void print();
49 
50  std::string toJson(bool beautify);
51 
52  Json::Value toJsonObj();
53 
54 private:
55 
56  /* 1B | number of HCI command packets which are allowed to be sent to the Controller from the Host */
57  uint8_t num_hci_command_packets;
58 
59  uint8_t ogf_ret;
60  uint8_t ocf_ret;
61 
62  /* 2B | Opcode of the command which caused this event */
63  uint16_t command_opcode;
64 
65  /* XB | return parameter(s) for the command specified in the Command_Opcode event parameter */
66  std::vector<uint8_t> return_parameters;
67 
68  IHciResponseFrame* response_frame;
69 
70 };
71 
72 #endif // COMMANDCOMPLETE_H
Definition: command_complete.h:39
std::string toJson(bool beautify)
toStyledJson convert frame information to beautiful json format
Definition: command_complete.cpp:473
IHciResponseFrame class Interface defining all a generic HCI Response Frame.
Definition: IHciResponseFrame.h:43
Json::Value toJsonObj()
toStyledJson convert frame information to beautiful json format
Definition: command_complete.cpp:378
IHciEventFrame class Interface defining all a generic HCI Event Frame.
Definition: IHciEventFrame.h:44
void print()
Definition: command_complete.cpp:372
~CommandComplete()
Definition: command_complete.cpp:368
CommandComplete(const std::vector< char > &data)
Definition: command_complete.cpp:41