35 #include <json/json.h>
38 #define COMMAND_FRAME_OFFSET 3
41 #define EVENT_FRAME_OFFSET 2
43 #define ACL_FRAME_OFFSET 1
50 #define E(x,y) { x,#x },
60 #define E(x,y) { x,#x },
70 #define E(x,y) { x,#x },
80 #define E(x,y) { x,#x },
90 #define E(x,y) { x,#x },
100 #define E(x,y) { x,#x },
105 #define E(x,y) x = y,
110 #define E(x,y) { x,#x },
115 #define E(x,y) x = y,
120 #define E(x,y) { x,#x },
125 #define E(x,y) x = y,
130 #define E(x,y) { x,#x },
141 printf(
"address : %02X:%02X:%02X:%02X:%02X:%02X\n",address[0],address[1],address[2],address[3],address[4],address[5]);
146 sprintf(output,
"%02X:%02X:%02X:%02X:%02X:%02X",address[0],address[1],address[2],address[3],address[4],address[5]);
147 std::string out = output;
157 inline uint8_t
get_ocf(uint8_t msb,uint8_t lsb){
158 return ((msb & 0x03) + lsb);
167 Json::StreamWriterBuilder builder;
168 builder.settings_[
"indentation"] =
"";
169 return Json::writeString(builder, output);
172 return output.toStyledString();
176 #endif // HCIGLOBAL_H
std::string toString()
Definition: hci_global.h:144
const std::map< int, std::string > COMMAND_OCF_LINK_POLICY_STRING_ENUM
Definition: hci_global.h:81
uint8_t address[6]
Definition: hci_global.h:138
COMMAND_OCF_CTRL_BSB_ENUM
Definition: hci_global.h:56
HCI_PACKET_TYPE_ENUM
Definition: hci_global.h:126
const std::map< int, std::string > COMMAND_OCF_LINK_CONTROL_STRING_ENUM
Definition: hci_global.h:91
EVENT_ENUM
Definition: hci_global.h:96
const std::map< int, std::string > COMMAND_OCF_LE_STRING_ENUM
Definition: hci_global.h:51
COMMAND_OCF_LINK_POLICY_ENUM
Definition: hci_global.h:76
uint8_t get_ocf(uint8_t msb, uint8_t lsb)
Definition: hci_global.h:157
COMMAND_OCF_INFORMATIONAL_ENUM
Definition: hci_global.h:66
LE_SUBEVENT_ENUM
Definition: hci_global.h:106
std::string convert_json_to_string(bool beautify, Json::Value output)
Definition: hci_global.h:164
const std::map< int, std::string > LE_SUBEVENT_STRING_ENUM
Definition: hci_global.h:111
const std::map< int, std::string > HCI_PACKET_TYPE_STRING_ENUM
Definition: hci_global.h:131
void print()
Definition: hci_global.h:140
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
uint8_t get_ogf(uint8_t data)
Definition: hci_global.h:153
const std::map< int, std::string > COMMAND_OCF_INFORMATIONAL_STRING_ENUM
Definition: hci_global.h:71
COMMAND_OGF_ENUM
Definition: hci_global.h:116
COMMAND_OCF_LINK_CONTROL_ENUM
Definition: hci_global.h:86
COMMAND_OCF_LE_ENUM
Definition: hci_global.h:46
Definition: hci_global.h:136
const std::map< int, std::string > EVENT_STRING_ENUM
Definition: hci_global.h:101