hci-decoder  1.0
Lightweight Bluetooth HCI decoder library parsing individually HCI frames into JSON format
hci_event_packet.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 HCIEVENTPACKET_H
32 #define HCIEVENTPACKET_H
33 
34 #include <iostream>
35 
36 /**********************************************************************/
37 /**********************************************************************/
38 /********************* HCI EVENTS** ***********************************/
39 /**********************************************************************/
40 /**********************************************************************/
41 
42 /* HCI Event 0x3E : LE META Event*/
43 typedef struct le_meta_event{
44 
45  uint8_t command; /* 1B | */
46  uint8_t parameter_length; /* 1B | parameter length */
47  uint8_t subevent_code; /* 1B | Subevent code for LE Connection Complete event */
48 
49  le_meta_event(const std::vector<char> &data){
50  this->command = HCI_EVENT_LE_META;
51  this->parameter_length = data[EVENT_FRAME_OFFSET];
52  this->subevent_code = data[EVENT_FRAME_OFFSET+1];
53  }
54 
56 
57 /**********************************************************************/
58 /**********************************************************************/
59 /********************* LE META SUBEVENT *******************************/
60 /**********************************************************************/
61 /**********************************************************************/
62 
63 /*advertising report struct */
64 typedef struct {
65 
66  uint8_t event_type; /* 1B | 0x00 Connectable undirected advertising (ADV_IND) | 0x01 Connectable directed advertising (ADV_DIRECT_IND) | 0x02 Scannable undirected advertising (ADV_SCAN_IND) | 0x03 Non connectable undirected advertising (ADV_NONCONN_IND) | 0x04 Scan Response (SCAN_RSP)*/
67  uint8_t address_type; /* 1B | 0x00 Public Device Address | 0x01 Random Device Address | 0x02 Public Identity Address (Corresponds to Resolved Private Address) | 0x03 Random (static) Identity Address (Corresponds to Resolved Private Address)*/
68  uint8_t address[6]; /* 6B | Public Device Address, Random Device Address, Public Identity Address or Random (static) Identity Address of the advertising device*/
69  uint8_t length_data; /* 1B | Length of the Data[i] field for each device which responded */
70  uint8_t data[]; /* XB | Length_Data[i] octets of advertising or scan response data */
71  uint8_t rssi; /* 1B | Size: 1 Octet (signed integer) Range: -127 ≤ N ≤ +20 Units: dBm */
72 
74 
75 
76 //HCI Event 0x3E | subevent_code : 0x02 : LE Advertising Report Event
77 typedef struct {
78 
79  uint8_t command; /* 1B | */
80  uint8_t subevent_code; /* 1B | Subevent code for LE Advertising Report event */
81  uint8_t num_reports; /* 1B | Number of responses in event */
83 
85 
87 
88  uint8_t event_type; /* 1B | 0x00 : Connectable undirected advertising (ADV_IND)
89  0x01 : Connectable directed advertising (ADV_DIRECT_IND)
90  0x02 : Scannable undirected advertising (ADV_SCAN_IND)
91  0x03 : Non connectable undirected advertising (ADV_NONCONN_IND)
92  0x04 : Scan Response (SCAN_RSP) */
93 
94  uint8_t address_type; /* 1B | 0x00 : Public Device Address
95  0x01 : Random Device Address
96  0x02 : Public Identity Address (Corresponds to Resolved Private Address)
97  0x03 : Random (static) Identity Address */
98 
99  bt_address address; /* 6B | Public Device Address, Random Device Address, Public Identity
100  Address or Random (static) Identity Address of the advertising device*/
101 
102  uint8_t data_length; /* 1B | 0x00-0x1F : Length of the Data[i] field for each device which responded */
103 
104  std::vector<uint8_t> data; /* XB | Length_Data[i] octets of advertising or scan response data formatted */
105 
106  uint8_t rssi; /* 1B | Range: -127 ≤ N ≤ +20; Units: dBm */
107 
108  Json::Value toJson(){
109 
110  Json::Value output;
111  output["event_type"] = event_type;
112  output["address_type"] = address_type;
113  output["address"] = address.toString();
114  output["data_length"] = data_length;
115  output["rssi"] = rssi;
116 
117  Json::Value data_array(Json::arrayValue);
118 
119  unsigned int i = 0;
120  for (i = 0; i < data.size();i++){
121  data_array.append(data[i]);
122  }
123  output["data"] = data_array;
124 
125  return output;
126  }
127 
128 };
129 
130 /* HCI LE Meta sub event 0x02 : LE_ADVERTISING_REPORT*/
132 
133  uint8_t num_reports; /* 1B | 0x01-0x19 : Number of responses in event */
134  LE_SUBEVENT_ENUM subevent_code; /*subevent code*/
135 
136  std::vector<advertising_report*> ad_report_items; /* a list of advertising report*/
137 
138  void clear(){
139  for (std::vector<advertising_report*>::iterator it = ad_report_items.begin(); it != ad_report_items.end();it++){
140  delete (*it);
141  }
142  ad_report_items.clear();
143  }
144 
145  le_meta_advertising_report_event(const std::vector<char> &data){
146  this->event_code = HCI_EVENT_LE_META;
147  this->subevent_code = HCI_EVENT_LE_ADVERTISING_REPORT;
149  this->num_reports = data[EVENT_FRAME_OFFSET+2];
150 
151  unsigned int i = 0;
152  int offset = EVENT_FRAME_OFFSET+3;
153 
154  for (i = 0 ;i < this->num_reports;i++){
155 
156  advertising_report *report = new advertising_report();
157 
158  report->event_type = data[offset];
159  report->address_type = data[offset + 1];
160 
161  bt_address addr;
162  addr.address[0]=data[offset + 7];
163  addr.address[1]=data[offset + 6];
164  addr.address[2]=data[offset + 5];
165  addr.address[3]=data[offset + 4];
166  addr.address[4]=data[offset + 3];
167  addr.address[5]=data[offset + 2];
168 
169  report->address = addr;
170 
171  report->data_length = data[offset + 8];
172 
173  std::vector<uint8_t> data_val;
174 
175  int j = 0;
176  for (j=0;j < report->data_length;j++){
177  data_val.push_back(data[offset + 9 + j]);
178  }
179  report->data = data_val;
180  report->rssi = data[report->data_length + offset + 9];
181  this->ad_report_items.push_back(report);
182  offset+=report->data_length + 10;
183  }
184  }
185 
186  Json::Value toJsonObj(){
187 
188  Json::Value output;
189  Json::Value parameters;
190  Json::Value event_code;
191  event_code["code"] = HCI_EVENT_LE_ADVERTISING_REPORT;
192  event_code["value"] = LE_SUBEVENT_STRING_ENUM.at(HCI_EVENT_LE_ADVERTISING_REPORT);
193  output["subevent_code"] = event_code;
194 
195  init(output);
196  parameters["num_reports"] = num_reports;
197 
198  Json::Value report_list(Json::arrayValue);
199  unsigned int i = 0;
200  for (i = 0; i < ad_report_items.size();i++){
201  report_list.append(ad_report_items[i]->toJson());
202  }
203  parameters["reports"] = report_list;
204  output["parameters"] = parameters;
205  return output;
206  }
207 
209 
210 
211 /* HCI Event 0x0F : Command status Event*/
212 typedef struct command_status : public IHciEventFrame{
213 
214  uint8_t status; /* 1B | 0x00 : Connection successfully completed, 0x01-0xFF : connection failure */
215  uint8_t num_hci_packet; /*The Number of HCI command packets which are allowed to be sent to the Controller from the Host*/
216 
217  /*Opcode of the command which caused this event and is pending completion*/
218  uint8_t ogf;
219  uint8_t ocf;
220 
221  command_status(const std::vector<char> &data){
222  this->event_code = HCI_EVENT_COMMAND_STATUS;
224  this->status = data[EVENT_FRAME_OFFSET+1];
225  this->num_hci_packet = data[EVENT_FRAME_OFFSET + 2];
226  ogf = get_ogf(data[EVENT_FRAME_OFFSET + 4]);
227  ocf = get_ocf(data[EVENT_FRAME_OFFSET + 4],data[EVENT_FRAME_OFFSET + 3]);
228  }
229 
230  Json::Value toJsonObj(){
231 
232  Json::Value output;
233  Json::Value parameters;
234  init(output);
235  parameters["status"] = status;
236  parameters["num_hci_packet"] = num_hci_packet;
237 
238  Json::Value command_opcode;
239 
240  Json::Value ogf_val;
241  ogf_val["code"] = ogf;
242 
243  if (COMMAND_OGF_STRING_ENUM.count(ogf))
244  ogf_val["value"] = COMMAND_OGF_STRING_ENUM.at(ogf);
245 
246  Json::Value ocf_val;
247  ocf_val["code"] = ocf;
248 
249  switch (ogf)
250  {
251  case HCI_CMD_OGF_LINK_CONTROL_COMMANDS:
252  {
254  ocf_val["value"] = COMMAND_OCF_LINK_CONTROL_STRING_ENUM.at(ocf);
255  break;
256  }
257  case HCI_CMD_OGF_LINK_POLICY_COMMANDS:
258  {
260  ocf_val["value"] = COMMAND_OCF_LINK_POLICY_STRING_ENUM.at(ocf);
261  break;
262  }
263  case HCI_CMD_OGF_CONTROLLER_BASEBAND_COMMANDS:
264  {
265  if (COMMAND_OCF_CTRL_BSB_STRING_ENUM.count(ocf))
266  ocf_val["value"] = COMMAND_OCF_CTRL_BSB_STRING_ENUM.at(ocf);
267 
268  break;
269  }
270  case HCI_CMD_OGF_INFORMATIONAL_PARAMETERS:
271  {
273  ocf_val["value"] = COMMAND_OCF_INFORMATIONAL_STRING_ENUM.at(ocf);
274 
275  break;
276  }
277  case HCI_CMD_OGF_STATUS_PARAMETERS:
278  {
279  break;
280  }
281  case HCI_CMD_OGF_TESTING_COMMANDS:
282  {
283  break;
284  }
285  case HCI_CMD_OGF_LE_CONTROLLER_COMMANDS:
286  {
287  if (COMMAND_OCF_LE_STRING_ENUM.count(ocf))
288  ocf_val["value"] = COMMAND_OCF_LE_STRING_ENUM.at(ocf);
289 
290  break;
291  }
292  case HCI_CMD_OGF_VENDOR_SPECIFIC:
293  {
294  break;
295  }
296  }
297 
298  command_opcode["ogf"] = ogf_val;
299  command_opcode["ocf"] = ocf_val;
300 
301  parameters["command_opcode"] = command_opcode;
302  output["parameters"] = parameters;
303  return output;
304  }
305 
307 
308 typedef struct completed_packet{
309 
312 
313  completed_packet(uint16_t connection_handle,uint16_t num_of_completed_packet){
314  this->connection_handle = connection_handle;
315  this->num_of_completed_packet = num_of_completed_packet;
316  }
317 
318  Json::Value toJson(){
319  Json::Value output;
320  output["connection_handle"] = connection_handle;
321  output["num_of_completed_packet"] = num_of_completed_packet;
322  return output;
323  }
324 
326 
327 /* HCI Event 0x13 : Number of completed packet Event*/
329 
330  uint8_t number_of_handles; /* 1B | The number of Connection_Handles and Num_HCI_Data_Packets parameters pairs contained in this event */
331  std::vector<completed_packet_t*> completed_packet_list;
332 
333  void clear(){
334  for (std::vector<completed_packet_t*>::iterator it = completed_packet_list.begin(); it != completed_packet_list.end();it++){
335  delete (*it);
336  }
337  completed_packet_list.clear();
338  }
339 
340  number_of_completed_packet_event(const std::vector<char> &data){
341  this->event_code = HCI_EVENT_NUMBER_OF_COMPLETED_PACKET;
343  this->number_of_handles = data[EVENT_FRAME_OFFSET+1];
344 
345  int offset = 0;
346 
347  for (unsigned int i = 0; i < number_of_handles;i++){
348  completed_packet_list.push_back(new completed_packet_t(
349  data[EVENT_FRAME_OFFSET + 2 + offset]+(data[EVENT_FRAME_OFFSET + 3 + offset]<<8),
350  data[EVENT_FRAME_OFFSET + 4 + offset]+(data[EVENT_FRAME_OFFSET + 5 + offset]<<8)
351  ));
352  offset+=4;
353  }
354  }
355 
356  Json::Value toJsonObj(){
357 
358  Json::Value output;
359  Json::Value parameters;
360  init(output);
361  parameters["number_of_handles"] = number_of_handles;
362 
363  Json::Value completed_packet_arr(Json::arrayValue);
364 
365  for (unsigned int i = 0; i < number_of_handles;i++){
366  completed_packet_arr.append(completed_packet_list[i]->toJson());
367  }
368  parameters["completed_packet_list"] = completed_packet_arr;
369 
370  output["parameters"] = parameters;
371  return output;
372  }
373 
375 
376 /* HCI Event 0x05 : Disconnection Complete Event*/
378 
379  uint8_t status; /* 1B | 0x00 : Connection successfully completed, 0x01-0xFF : connection failure */
380  uint16_t connection_handle; /* 2B | Connection_Handle which was disconnected*/
381  uint8_t reason; /* 1B | Reason for disconnection*/
382 
383  disconnection_complete_event(const std::vector<char> &data){
384  this->event_code = HCI_EVENT_DISCONNECTION_COMPLETE;
386  this->status = data[EVENT_FRAME_OFFSET+1];
387  this->connection_handle = data[EVENT_FRAME_OFFSET+2] + (data[EVENT_FRAME_OFFSET+3]<<8);
388  this->reason = data[EVENT_FRAME_OFFSET+4];
389  }
390 
391  Json::Value toJsonObj(){
392 
393  Json::Value output;
394  Json::Value parameters;
395  init(output);
396  parameters["status"] = status;
397  parameters["connection_handle"] = connection_handle;
398  parameters["reason"] = reason;
399  output["parameters"] = parameters;
400  return output;
401  }
402 
404 
405 /* HCI Event 0x01 : Inquiry Complete Event*/
406 typedef struct inquiry_complete_event : public IHciEventFrame{
407 
408  uint8_t status; /* 1B | 0x00 : Connection successfully completed, 0x01-0xFF : connection failure */
409 
410  inquiry_complete_event(const std::vector<char> &data){
411  this->event_code = HCI_EVENT_INQUIRY_COMPLETE;
413  this->status = data[EVENT_FRAME_OFFSET+1];
414  }
415 
416  Json::Value toJsonObj(){
417 
418  Json::Value output;
419  Json::Value parameters;
420  init(output);
421  parameters["status"] = status;
422  output["parameters"] = parameters;
423  return output;
424  }
425 
427 
428 
429 /* HCI Event 0x2F : Extended Inquiry Event*/
431 
432  uint8_t num_responses; /*Number of responses from the inquiry*/
433  bt_address bd_addr; /*BD_ADDR for the device that responded*/
434  uint8_t page_repetition_mode; /*0:R0 1:R1 2:R2*/
435  uint32_t class_of_device; /*Class of Device for the device that responded*/
436  uint16_t clock_offset;
437  uint8_t rssi;
438  std::vector<uint8_t> extended_inquiry_response;
439 
440  extended_inquiry_result_event(const std::vector<char> &data){
441  this->event_code = HCI_EVENT_EXTENDED_INQUIRY_RESULT;
443  this->num_responses = data[EVENT_FRAME_OFFSET+1];
444  bd_addr.address[0]=data[EVENT_FRAME_OFFSET + 7];
445  bd_addr.address[1]=data[EVENT_FRAME_OFFSET + 6];
446  bd_addr.address[2]=data[EVENT_FRAME_OFFSET + 5];
447  bd_addr.address[3]=data[EVENT_FRAME_OFFSET + 4];
448  bd_addr.address[4]=data[EVENT_FRAME_OFFSET + 3];
449  bd_addr.address[5]=data[EVENT_FRAME_OFFSET + 2];
450  page_repetition_mode = data[EVENT_FRAME_OFFSET + 8];
451  //1 octet reserved here
452  class_of_device = data[EVENT_FRAME_OFFSET + 10] + (data[EVENT_FRAME_OFFSET + 11 ] << 8) + (data[EVENT_FRAME_OFFSET + 12 ] << 16) ;
453  clock_offset = data[EVENT_FRAME_OFFSET + 13] + (data[EVENT_FRAME_OFFSET + 14] << 8);
454  rssi = data[EVENT_FRAME_OFFSET + 15];
455  for (unsigned int i = 0 ; i< 240;i++){
456  extended_inquiry_response.push_back(data[EVENT_FRAME_OFFSET + 16]);
457  }
458  }
459 
460  Json::Value toJsonObj(){
461 
462  Json::Value output;
463  Json::Value parameters;
464  init(output);
465  parameters["num_responses"] = num_responses;
466  parameters["bd_addr"] = bd_addr.toString();
467  parameters["page_repetition_mode"] = page_repetition_mode;
468  parameters["class_of_device"] = class_of_device;
469  parameters["clock_offset"] = clock_offset;
470  parameters["rssi"] = rssi;
471 
472  Json::Value inquiry_response_array(Json::arrayValue);
473  for (unsigned int i = 0 ; i< 240;i++){
474  inquiry_response_array.append(extended_inquiry_response[i]);
475  }
476  parameters["extended_inquiry_response"] = inquiry_response_array;
477 
478  output["parameters"] = parameters;
479  return output;
480  }
481 
483 
484 /* HCI LE Meta sub event 0x01 : LE_CONNECTION_COMPLETE*/
486 
487  uint8_t status; /* 1B | 0x00 : Connection successfully completed, 0x01-0xFF : connection failure */
488  uint16_t connection_handle; /* 2B | Connection_Handle to be used to identify a connection between two
489  Bluetooth devices. The Connection_Handle is used as an identifier
490  for transmitting and receiving data*/
491  uint8_t role; /* 1B | 0x00 : Connection is master, 0x01 : Connection is slave */
492  uint8_t peer_address_type; /* 1B | 0x00 : Peer is using a Public Device Address, 0x01 : Peer is using a Random Device Address */
493  bt_address peer_address; /* 6B | address */
494  uint16_t conn_interval; /* 2B | Connection interval used on this connection */
495  uint16_t conn_latency; /* 2B | Slave latency for the connection in number of connection events */
496  uint16_t supervision_timeout; /* 2B | Connection supervision timeout */
497  uint8_t master_clock_accuracy; /* 1B | */
498  LE_SUBEVENT_ENUM subevent_code; /*subevent code*/
499 
500  le_meta_connection_complete_event(const std::vector<char> &data){
501  this->event_code = HCI_EVENT_LE_META;
502  this->subevent_code = HCI_EVENT_LE_CONNECTION_COMPLETE;
504  this->status = data[EVENT_FRAME_OFFSET+2];
505  this->connection_handle = (data[EVENT_FRAME_OFFSET+3]<<8) + data[EVENT_FRAME_OFFSET+4];
506  this->role = data[EVENT_FRAME_OFFSET+5];
507  this->peer_address_type = data[EVENT_FRAME_OFFSET+6];
508 
509  this->peer_address.address[0] = data[EVENT_FRAME_OFFSET+12];
510  this->peer_address.address[1] = data[EVENT_FRAME_OFFSET+11];
511  this->peer_address.address[2] = data[EVENT_FRAME_OFFSET+10];
512  this->peer_address.address[3] = data[EVENT_FRAME_OFFSET+9];
513  this->peer_address.address[4] = data[EVENT_FRAME_OFFSET+8];
514  this->peer_address.address[5] = data[EVENT_FRAME_OFFSET+7];
515 
516  this->conn_interval = (data[EVENT_FRAME_OFFSET+13]<<8) + data[EVENT_FRAME_OFFSET+14];
517  this->conn_latency = (data[EVENT_FRAME_OFFSET+15]<<8) + data[EVENT_FRAME_OFFSET+16];
518  this->supervision_timeout = (data[EVENT_FRAME_OFFSET+17]<<8) + data[EVENT_FRAME_OFFSET+18];
519  this->master_clock_accuracy = data[EVENT_FRAME_OFFSET+19];
520  }
521 
522  Json::Value toJsonObj(){
523 
524  Json::Value output;
525  Json::Value event_code;
526  Json::Value parameters;
527  event_code["code"] = HCI_EVENT_LE_CONNECTION_COMPLETE;
528  event_code["value"] = LE_SUBEVENT_STRING_ENUM.at(HCI_EVENT_LE_CONNECTION_COMPLETE);
529  output["subevent_code"] = event_code;
530  init(output);
531  parameters["status"] = status;
532  parameters["connection_handle"] = connection_handle;
533  parameters["peer_address_type"] = peer_address_type;
534  parameters["peer_address"] = peer_address.toString();
535  parameters["conn_interval"] = conn_interval;
536  parameters["conn_latency"] = conn_latency;
537  parameters["supervision_timeout"] = supervision_timeout;
538  parameters["master_clock_accuracy"] = master_clock_accuracy;
539  output["parameters"] = parameters;
540  return output;
541  }
542 
544 
545 #endif //HCIEVENTPACKET_H
Definition: hci_event_packet.h:131
completed_packet(uint16_t connection_handle, uint16_t num_of_completed_packet)
Definition: hci_event_packet.h:313
std::vector< advertising_report * > ad_report_items
Definition: hci_event_packet.h:136
std::string toString()
Definition: hci_global.h:144
Definition: hci_event_packet.h:430
const std::map< int, std::string > COMMAND_OCF_LINK_POLICY_STRING_ENUM
Definition: hci_global.h:81
disconnection_complete_event disconnection_complete_event_t
Json::Value toJsonObj()
toStyledJson convert frame information to beautiful json format
Definition: hci_event_packet.h:186
uint8_t subevent_code
Definition: hci_event_packet.h:47
uint16_t conn_interval
Definition: hci_event_packet.h:494
uint8_t status
Definition: hci_event_packet.h:408
uint8_t peer_address_type
Definition: hci_event_packet.h:492
command_status command_status_t
std::vector< uint8_t > data
Definition: hci_event_packet.h:104
LE_SUBEVENT_ENUM subevent_code
Definition: hci_event_packet.h:498
uint16_t clock_offset
Definition: hci_event_packet.h:436
uint8_t event_type
Definition: hci_event_packet.h:88
uint8_t address[6]
Definition: hci_global.h:138
Json::Value toJsonObj()
toStyledJson convert frame information to beautiful json format
Definition: hci_event_packet.h:416
uint8_t role
Definition: hci_event_packet.h:491
uint8_t command
Definition: hci_event_packet.h:45
uint8_t ogf
Definition: hci_event_packet.h:218
extended_inquiry_result_event extended_inquiry_result_event_t
#define EVENT_FRAME_OFFSET
Definition: hci_global.h:41
uint8_t data_length
Definition: hci_event_packet.h:102
Json::Value toJson()
Definition: hci_event_packet.h:318
const std::map< int, std::string > COMMAND_OCF_LINK_CONTROL_STRING_ENUM
Definition: hci_global.h:91
uint16_t connection_handle
Definition: hci_event_packet.h:310
Definition: hci_event_packet.h:86
Definition: hci_event_packet.h:64
uint8_t subevent_code
Definition: hci_event_packet.h:80
disconnection_complete_event(const std::vector< char > &data)
Definition: hci_event_packet.h:383
inquiry_complete_event inquiry_complete_event_t
bt_address bd_addr
Definition: hci_event_packet.h:433
struct le_meta_event le_meta_event_t
uint8_t master_clock_accuracy
Definition: hci_event_packet.h:497
void clear()
Definition: hci_event_packet.h:138
Definition: hci_event_packet.h:485
uint8_t rssi
Definition: hci_event_packet.h:437
Definition: hci_event_packet.h:212
Definition: hci_event_packet.h:77
number_of_completed_packet_event(const std::vector< char > &data)
Definition: hci_event_packet.h:340
Json::Value toJson()
Definition: hci_event_packet.h:108
bt_address peer_address
Definition: hci_event_packet.h:493
uint16_t connection_handle
Definition: hci_event_packet.h:380
Json::Value toJsonObj()
toStyledJson convert frame information to beautiful json format
Definition: hci_event_packet.h:460
const std::map< int, std::string > COMMAND_OCF_LE_STRING_ENUM
Definition: hci_global.h:51
uint8_t ocf
Definition: hci_event_packet.h:219
uint8_t status
Definition: hci_event_packet.h:487
le_meta_connection_complete_event(const std::vector< char > &data)
Definition: hci_event_packet.h:500
le_meta_advertising_report_event(const std::vector< char > &data)
Definition: hci_event_packet.h:145
uint8_t num_hci_packet
Definition: hci_event_packet.h:215
uint8_t parameter_length
Definition: hci_event_packet.h:46
uint8_t parameter_total_length
Definition: IHciEventFrame.h:103
uint8_t event_type
Definition: hci_event_packet.h:66
uint8_t get_ocf(uint8_t msb, uint8_t lsb)
Definition: hci_global.h:157
uint8_t address_type
Definition: hci_event_packet.h:67
uint8_t num_reports
Definition: hci_event_packet.h:81
LE_SUBEVENT_ENUM
Definition: hci_global.h:106
Json::Value toJsonObj()
toStyledJson convert frame information to beautiful json format
Definition: hci_event_packet.h:230
Json::Value toJsonObj()
toStyledJson convert frame information to beautiful json format
Definition: hci_event_packet.h:522
le_meta_advertising_report_event le_meta_advertising_report_event_t
void clear()
Definition: hci_event_packet.h:333
uint8_t number_of_handles
Definition: hci_event_packet.h:330
const std::map< int, std::string > LE_SUBEVENT_STRING_ENUM
Definition: hci_global.h:111
uint8_t rssi
Definition: hci_event_packet.h:71
uint8_t reason
Definition: hci_event_packet.h:381
Json::Value toJsonObj()
toStyledJson convert frame information to beautiful json format
Definition: hci_event_packet.h:391
uint8_t command
Definition: hci_event_packet.h:79
struct completed_packet completed_packet_t
uint8_t length_data
Definition: hci_event_packet.h:69
std::string toJson(bool beautify)
toStyledJson convert frame information to beautiful json format
Definition: IHciEventFrame.h:61
uint8_t address_type
Definition: hci_event_packet.h:94
uint8_t status
Definition: hci_event_packet.h:379
uint8_t rssi
Definition: hci_event_packet.h:106
le_meta_event(const std::vector< char > &data)
Definition: hci_event_packet.h:49
Json::Value toJsonObj()
toStyledJson convert frame information to beautiful json format
Definition: hci_event_packet.h:356
uint16_t num_of_completed_packet
Definition: hci_event_packet.h:311
Definition: hci_event_packet.h:377
Definition: hci_event_packet.h:406
extended_inquiry_result_event(const std::vector< char > &data)
Definition: hci_event_packet.h:440
uint8_t page_repetition_mode
Definition: hci_event_packet.h:434
uint32_t class_of_device
Definition: hci_event_packet.h:435
const std::map< int, std::string > COMMAND_OCF_CTRL_BSB_STRING_ENUM
Definition: hci_global.h:61
const std::map< int, std::string > COMMAND_OGF_STRING_ENUM
Definition: hci_global.h:121
EVENT_ENUM event_code
Definition: IHciEventFrame.h:100
Definition: hci_event_packet.h:308
command_status(const std::vector< char > &data)
Definition: hci_event_packet.h:221
Definition: hci_event_packet.h:43
inquiry_complete_event(const std::vector< char > &data)
Definition: hci_event_packet.h:410
uint8_t get_ogf(uint8_t data)
Definition: hci_global.h:153
Definition: hci_event_packet.h:328
const std::map< int, std::string > COMMAND_OCF_INFORMATIONAL_STRING_ENUM
Definition: hci_global.h:71
IHciEventFrame class Interface defining all a generic HCI Event Frame.
Definition: IHciEventFrame.h:44
uint16_t connection_handle
Definition: hci_event_packet.h:488
uint16_t conn_latency
Definition: hci_event_packet.h:495
Definition: hci_global.h:136
bt_address address
Definition: hci_event_packet.h:99
std::vector< completed_packet_t * > completed_packet_list
Definition: hci_event_packet.h:331
void init(Json::Value &output)
Definition: IHciEventFrame.h:84
le_meta_connection_complete_event le_meta_connection_complete_event_t
LE_SUBEVENT_ENUM subevent_code
Definition: hci_event_packet.h:134
uint8_t num_reports
Definition: hci_event_packet.h:133
uint16_t supervision_timeout
Definition: hci_event_packet.h:496
number_of_completed_packet_event number_of_completed_packet_event_t
uint8_t num_responses
Definition: hci_event_packet.h:432
std::vector< uint8_t > extended_inquiry_response
Definition: hci_event_packet.h:438
uint8_t status
Definition: hci_event_packet.h:214