hci-decoder  1.0
Lightweight Bluetooth HCI decoder library parsing individually HCI frames into JSON format
hcidecoder.h
Go to the documentation of this file.
1 
21 /************************************************************************************
22  * The MIT License (MIT) *
23  * *
24  * Copyright (c) 2015 Bertrand Martel *
25  * *
26  * Permission is hereby granted, free of charge, to any person obtaining a copy *
27  * of this software and associated documentation files (the "Software"), to deal *
28  * in the Software without restriction, including without limitation the rights *
29  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
30  * copies of the Software, and to permit persons to whom the Software is *
31  * furnished to do so, subject to the following conditions: *
32  * *
33  * The above copyright notice and this permission notice shall be included in *
34  * all copies or substantial portions of the Software. *
35  * *
36  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
37  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
38  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
39  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
40  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
41  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
42  * THE SOFTWARE. *
43  ************************************************************************************/
44 
52 #ifndef HCIDECODER_H
53 #define HCIDECODER_H
54 
55 #include "vector"
56 #include "hci_decoder/IHciFrame.h"
57 
59 {
60 
61 public:
62 
63  HciDecoder();
64 
65  ~HciDecoder();
66 
75  IHciFrame* decode(std::vector<char> data);
76 
83  std::vector<IHciFrame*> getFrameList();
84 
93  std::string toJson(bool beautify);
94 
95 private:
96 
97  /*list of frame decoded with this decoder*/
98  std::vector<IHciFrame*> frame_list;
99 
100 };
101 
102 #endif // HCIDECODER_H
The IHciFrame class Interface defining all a generic HCI Frame.
Definition: IHciFrame.h:42
HciDecoder()
Definition: hcidecoder.cpp:40
Definition: hcidecoder.h:58
std::string toJson(bool beautify)
convert all decoded frame to json
Definition: hcidecoder.cpp:70
IHciFrame * decode(std::vector< char > data)
decode one HCI frame
Definition: hcidecoder.cpp:95
~HciDecoder()
Definition: hcidecoder.cpp:43
std::vector< IHciFrame * > getFrameList()
get all decoded packet
Definition: hcidecoder.cpp:58