本文整理汇总了C++中p_indent函数的典型用法代码示例。如果您正苦于以下问题:C++ p_indent函数的具体用法?C++ p_indent怎么用?C++ p_indent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了p_indent函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: avrcp_displayable_charset
static void avrcp_displayable_charset(int level, struct frame *frm,
uint8_t ctype, uint16_t len)
{
uint8_t num;
if (ctype > AVC_CTYPE_GENERAL_INQUIRY)
return;
p_indent(level, frm);
if (len < 2) {
printf("PDU Malformed\n");
raw_dump(level, frm);
return;
}
num = get_u8(frm);
printf("CharsetCount: 0x%02x\n", num);
for (; num > 0; num--) {
uint16_t charset;
p_indent(level, frm);
charset = get_u16(frm);
printf("CharsetID: 0x%04x (%s)\n", charset,
charset2str(charset));
}
}
开发者ID:aloisiojr,项目名称:bluez-hcidump,代码行数:29,代码来源:avrcp.c
示例2: info_opt
static void info_opt(int level, int type, void *ptr, int len)
{
uint32_t mask;
p_indent(level, 0);
switch (type) {
case 0x0001:
printf("Connectionless MTU %d\n", get_val(ptr, len));
break;
case 0x0002:
mask = get_val(ptr, len);
printf("Extended feature mask 0x%4.4x\n", mask);
if (parser.flags & DUMP_VERBOSE) {
if (mask & 0x01) {
p_indent(level + 1, 0);
printf("Flow control mode\n");
}
if (mask & 0x02) {
p_indent(level + 1, 0);
printf("Retransmission mode\n");
}
if (mask & 0x04) {
p_indent(level + 1, 0);
printf("Bi-directional QoS\n");
}
}
break;
default:
printf("Unknown (len %d)\n", len);
break;
}
}
开发者ID:0omega,项目名称:platform_external_bluez,代码行数:33,代码来源:l2cap.c
示例3: avrcp_get_play_status_dump
static void avrcp_get_play_status_dump(int level, struct frame *frm,
uint8_t ctype, uint16_t len)
{
uint32_t interval;
uint8_t status;
if (ctype <= AVC_CTYPE_GENERAL_INQUIRY)
return;
p_indent(level, frm);
if (len < 9) {
printf("PDU Malformed\n");
raw_dump(level, frm);
return;
}
interval = get_u32(frm);
printf("SongLength: 0x%08x (%u miliseconds)\n", interval, interval);
p_indent(level, frm);
interval = get_u32(frm);
printf("SongPosition: 0x%08x (%u miliconds)\n", interval, interval);
p_indent(level, frm);
status = get_u8(frm);
printf("PlayStatus: 0x%02x (%s)\n", status, playstatus2str(status));
}
开发者ID:aloisiojr,项目名称:bluez-hcidump,代码行数:30,代码来源:avrcp.c
示例4: mcc_rpn
static inline void mcc_rpn(int level, uint8_t *ptr, unsigned int len,
long_frame_head *head, mcc_long_frame_head *mcc_head)
{
rpn_msg *rpn = (void *) (ptr - STRUCT_END(rpn_msg, mcc_s_head));
printf("RPN %s: ", CR_STR(mcc_head));
print_rfcomm_hdr(head, ptr, len);
print_mcc(mcc_head);
p_indent(level, 0);
printf("dlci %d ", GET_DLCI(rpn->dlci));
/* Assuming that rpn_val is _declared_ as a member of rpn_msg... */
if (len <= STRUCT_OFFSET(rpn_msg, rpn_val) - STRUCT_END(rpn_msg, mcc_s_head)) {
printf("\n");
return;
}
printf("br %d db %d sb %d p %d pt %d xi %d xo %d\n",
rpn->rpn_val.bit_rate, rpn->rpn_val.data_bits,
rpn->rpn_val.stop_bit, rpn->rpn_val.parity,
rpn->rpn_val.parity_type, rpn->rpn_val.xon_input,
rpn->rpn_val.xon_output);
p_indent(level, 0);
printf("rtri %d rtro %d rtci %d rtco %d xon %d xoff %d pm 0x%04x\n",
rpn->rpn_val.rtr_input, rpn->rpn_val.rtr_output,
rpn->rpn_val.rtc_input, rpn->rpn_val.rtc_output,
rpn->rpn_val.xon, rpn->rpn_val.xoff, btohs(rpn->rpn_val.pm));
}
开发者ID:ACSOP,项目名称:android_external_bluetooth_hcidump,代码行数:30,代码来源:rfcomm.c
示例5: att_find_info_resp_dump
static void att_find_info_resp_dump(int level, struct frame *frm)
{
uint8_t fmt = get_u8(frm);
p_indent(level, frm);
if (fmt == 0x01) {
printf("format: uuid-16\n");
while (frm->len > 0) {
uint16_t handle = btohs(htons(get_u16(frm)));
uint16_t uuid = btohs(htons(get_u16(frm)));
p_indent(level + 1, frm);
printf("handle 0x%4.4x, uuid 0x%4.4x (%s)\n", handle, uuid,
uuid2str(uuid));
}
} else {
printf("format: uuid-128\n");
while (frm->len > 0) {
uint16_t handle = btohs(htons(get_u16(frm)));
p_indent(level + 1, frm);
printf("handle 0x%4.4x, uuid ", handle);
print_uuid128(frm);
printf("\n");
}
}
}
开发者ID:AlanZheng,项目名称:hcidump-android,代码行数:29,代码来源:att.c
示例6: conf_rsp
static inline void conf_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm)
{
l2cap_conf_rsp *h = frm->ptr;
uint16_t scid = btohs(h->scid);
uint16_t result = btohs(h->result);
int clen = btohs(cmd->len) - L2CAP_CONF_RSP_SIZE;
if (p_filter(FILT_L2CAP))
return;
printf("Config rsp: scid 0x%4.4x flags 0x%2.2x result %d clen %d\n",
scid, btohs(h->flags), result, clen);
if (clen > 0) {
if (result) {
p_indent(level + 1, frm);
printf("%s\n", confresult2str(result));
}
if (result == 0x0003)
conf_list(level + 1, h->data, clen);
else
conf_opt(level + 1, h->data, clen, frm->in,
frm->handle, scid);
} else {
p_indent(level + 1, frm);
printf("%s\n", confresult2str(result));
}
}
开发者ID:Andrewas,项目名称:android_hardware_semc,代码行数:28,代码来源:l2cap.c
示例7: hcrp_dump
void hcrp_dump(int level, struct frame *frm)
{
uint16_t pid, tid, plen, status;
uint32_t credits;
pid = get_u16(frm);
tid = get_u16(frm);
plen = get_u16(frm);
p_indent(level, frm);
printf("HCRP %s %s: tid 0x%x plen %d",
pid2str(pid), frm->in ? "rsp" : "cmd", tid, plen);
if (frm->in) {
status = get_u16(frm);
printf(" status %d (%s)\n", status, status2str(status));
} else
printf("\n");
if (pid == 0x0001 && !frm->in) {
credits = get_u32(frm);
p_indent(level + 1, frm);
printf("credits %d\n", credits);
}
if (pid == 0x0002 && frm->in) {
credits = get_u32(frm);
p_indent(level + 1, frm);
printf("credits %d\n", credits);
}
raw_dump(level + 1, frm);
}
开发者ID:AazibSafi,项目名称:pwn_plug_sources,代码行数:34,代码来源:hcrp.c
示例8: cmd_connect_active
static void cmd_connect_active(int level, uint8_t subcmd, struct frame *frm)
{
uint8_t len;
cmd_common(level, subcmd, frm);
if (subcmd == 0x82) {
len = CAPI_U8(frm);
if (len > 0) {
p_indent(level, frm);
printf("Connected number:\n");
hex_dump(level, frm, len);
}
len = CAPI_U8(frm);
if (len > 0) {
p_indent(level, frm);
printf("Connected subaddress:\n");
hex_dump(level, frm, len);
}
len = CAPI_U8(frm);
if (len > 0) {
p_indent(level, frm);
printf("LLC:\n");
hex_dump(level, frm, len);
}
}
}
开发者ID:AazibSafi,项目名称:pwn_plug_sources,代码行数:29,代码来源:capi.c
示例9: avrcp_set_player_value_dump
static void avrcp_set_player_value_dump(int level, struct frame *frm,
uint8_t ctype, uint16_t len)
{
uint8_t num;
p_indent(level, frm);
if (ctype > AVC_CTYPE_GENERAL_INQUIRY)
return;
if (len < 1) {
printf("PDU Malformed\n");
raw_dump(level, frm);
return;
}
num = get_u8(frm);
printf("AttributeCount: 0x%02x\n", num);
for (; num > 0; num--) {
uint8_t attr, value;
p_indent(level, frm);
attr = get_u8(frm);
printf("AttributeID: 0x%02x (%s)\n", attr, attr2str(attr));
p_indent(level, frm);
value = get_u8(frm);
printf("ValueID: 0x%02x (%s)\n", value,
value2str(attr, value));
}
}
开发者ID:aloisiojr,项目名称:bluez-hcidump,代码行数:34,代码来源:avrcp.c
示例10: cmd_common
static void cmd_common(int level, uint8_t subcmd, struct frame *frm)
{
uint32_t val;
uint16_t info, ncci;
uint8_t ctr, plci;
val = CAPI_U32(frm);
ctr = val & 0xff;
plci = (val & 0xff00) >> 8;
ncci = (val & 0xffff0000) >> 16;
p_indent(level, frm);
printf("Controller: %d %s\n", ctr & 0x7f, ctr & 0x80 ? "Ext." : "Int.");
if (plci > 0) {
p_indent(level, frm);
printf("PLCI: 0x%02x\n", plci);
}
if (ncci > 0) {
p_indent(level, frm);
printf("NCCI: 0x%04x\n", ncci);
}
if (subcmd == 0x81) {
info = CAPI_U16(frm);
p_indent(level, frm);
printf("Info: 0x%04x (%s)\n", info, info2str(info));
}
}
开发者ID:AazibSafi,项目名称:pwn_plug_sources,代码行数:30,代码来源:capi.c
示例11: smp_cmd_pairing_failed_dump
static void smp_cmd_pairing_failed_dump(int level, struct frame *frm)
{
uint8_t reason = p_get_u8(frm);
p_indent(level, frm);
printf("reason 0x%2.2x\n", reason);
p_indent(level, frm);
printf("Reason %s\n", smpreason2str(reason));
}
开发者ID:AwxiVYTHUIiMOol,项目名称:bluez,代码行数:10,代码来源:smp.c
示例12: att_read_multi_req_dump
static void att_read_multi_req_dump(int level, struct frame *frm)
{
p_indent(level, frm);
printf("Handles\n");
while (frm->len > 0) {
p_indent(level, frm);
printf("handle 0x%4.4x\n", btohs(htons(get_u16(frm))));
}
}
开发者ID:AlanZheng,项目名称:hcidump-android,代码行数:10,代码来源:att.c
示例13: avrcp_dump
void avrcp_dump(int level, struct frame *frm)
{
uint8_t ctype, address, subunit, opcode, company[3];
int i;
p_indent(level, frm);
ctype = get_u8(frm);
address = get_u8(frm);
opcode = get_u8(frm);
printf("AV/C: %s: address 0x%02x opcode 0x%02x\n", ctype2str(ctype),
address, opcode);
p_indent(level + 1, frm);
subunit = address >> 3;
printf("Subunit: %s\n", subunit2str(subunit));
p_indent(level + 1, frm);
printf("Opcode: %s\n", opcode2str(opcode));
/* Skip non-panel subunit packets */
if (subunit != AVC_SUBUNIT_PANEL) {
raw_dump(level, frm);
return;
}
/* Not implemented should not contain any operand */
if (ctype == AVC_CTYPE_NOT_IMPLEMENTED) {
raw_dump(level, frm);
return;
}
switch (opcode) {
case AVC_OP_PASSTHROUGH:
avrcp_passthrough_dump(level + 1, frm);
break;
case AVC_OP_VENDORDEP:
p_indent(level + 1, frm);
printf("Company ID: 0x");
for (i = 0; i < 3; i++) {
company[i] = get_u8(frm);
printf("%02x", company[i]);
}
printf("\n");
avrcp_pdu_dump(level + 1, frm, ctype);
break;
default:
raw_dump(level, frm);
}
}
开发者ID:aloisiojr,项目名称:bluez-hcidump,代码行数:55,代码来源:avrcp.c
示例14: att_error_dump
static void att_error_dump(int level, struct frame *frm)
{
uint8_t op = get_u8(frm);
uint16_t handle = btohs(htons(get_u16(frm)));
uint8_t err = get_u8(frm);
p_indent(level, frm);
printf("Error: %s (%d)\n", atterror2str(err), err);
p_indent(level, frm);
printf("%s (0x%.2x) on handle 0x%4.4x\n", attop2str(op), op, handle);
}
开发者ID:AlanZheng,项目名称:hcidump-android,代码行数:12,代码来源:att.c
示例15: avrcp_get_capabilities_dump
static void avrcp_get_capabilities_dump(int level, struct frame *frm, uint16_t len)
{
uint8_t cap;
uint8_t count;
p_indent(level, frm);
if (len < 1) {
printf("PDU Malformed\n");
raw_dump(level, frm);
return;
}
cap = get_u8(frm);
printf("CapabilityID: 0x%02x (%s)\n", cap, cap2str(cap));
if (len == 1)
return;
p_indent(level, frm);
count = get_u8(frm);
printf("CapabilityCount: 0x%02x\n", count);
switch (cap) {
case 0x2:
for (; count > 0; count--) {
int i;
p_indent(level, frm);
printf("%s: 0x", cap2str(cap));
for (i = 0; i < 3; i++)
printf("%02x", get_u8(frm));
printf("\n");
}
break;
case 0x3:
for (; count > 0; count--) {
uint8_t event;
p_indent(level, frm);
event = get_u8(frm);
printf("%s: 0x%02x (%s)\n", cap2str(cap), event,
event2str(event));
}
break;
default:
raw_dump(level, frm);
}
}
开发者ID:aloisiojr,项目名称:bluez-hcidump,代码行数:52,代码来源:avrcp.c
示例16: att_handle_notify_dump
static void att_handle_notify_dump(int level, struct frame *frm)
{
uint16_t handle = btohs(htons(get_u16(frm)));
p_indent(level, frm);
printf("handle 0x%4.4x\n", handle);
p_indent(level, frm);
printf("value ");
while (frm->len > 0)
printf("0x%.2x ", get_u8(frm));
printf("\n");
}
开发者ID:AlanZheng,项目名称:hcidump-android,代码行数:13,代码来源:att.c
示例17: att_find_by_type_req_dump
static void att_find_by_type_req_dump(int level, struct frame *frm)
{
uint16_t start = btohs(htons(get_u16(frm)));
uint16_t end = btohs(htons(get_u16(frm)));
uint16_t uuid = btohs(htons(get_u16(frm)));
p_indent(level, frm);
printf("start 0x%4.4x, end 0x%4.4x, uuid 0x%4.4x\n", start, end, uuid);
p_indent(level, frm);
printf("value");
while (frm->len > 0)
printf(" 0x%2.2x", get_u8(frm));
printf("\n");
}
开发者ID:AlanZheng,项目名称:hcidump-android,代码行数:15,代码来源:att.c
示例18: att_prep_write_dump
static void att_prep_write_dump(int level, struct frame *frm)
{
uint16_t handle = btohs(htons(get_u16(frm)));
uint16_t val_offset = btohs(htons(get_u16(frm)));
p_indent(level, frm);
printf("attr handle 0x%4.4x, value offset 0x%4.4x\n", handle,
val_offset);
p_indent(level, frm);
printf("part attr value ");
while (frm->len > 0)
printf(" 0x%2.2x", get_u8(frm));
printf("\n");
}
开发者ID:AlanZheng,项目名称:hcidump-android,代码行数:15,代码来源:att.c
示例19: att_read_req_dump
static void att_read_req_dump(int level, struct frame *frm)
{
uint16_t handle = btohs(htons(get_u16(frm)));
p_indent(level, frm);
printf("handle 0x%4.4x\n", handle);
}
开发者ID:AlanZheng,项目名称:hcidump-android,代码行数:7,代码来源:att.c
示例20: complex_dump
static inline void complex_dump(int level, char *str, struct frame *frm)
{
p_indent(level, frm);
printf("%s\n", str);
raw_dump(level, frm);
}
开发者ID:0omega,项目名称:platform_external_bluez,代码行数:7,代码来源:csr.c
注:本文中的p_indent函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论