diff options
author | Gowtham Anandha Babu <gowtham.ab@samsung.com> | 2014-12-03 17:31:21 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-12-04 12:27:41 +0200 |
commit | 912a7a53fc0a50fe8622e41aafa0a79b6c7351f7 (patch) | |
tree | e37bf56c408226671237c075c4432acb522d4b22 /monitor/rfcomm.c | |
parent | 90b017f247028959253d822b31f73a5a68960777 (diff) | |
download | bluez-912a7a53fc0a50fe8622e41aafa0a79b6c7351f7.tar.gz |
monitor/rfcomm: Add support for NSC frame decoding
Changes made to decode NSC frame in RFCOMM for btmon.
Not able capture the output.
Diffstat (limited to 'monitor/rfcomm.c')
-rw-r--r-- | monitor/rfcomm.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c index 2a82001a3..e90fc1c0a 100644 --- a/monitor/rfcomm.c +++ b/monitor/rfcomm.c @@ -113,6 +113,10 @@ struct rfcomm_rls { uint8_t error; } __attribute__((packed)); +struct rfcomm_nsc { + uint8_t cmd_type; +} __attribute__((packed)); + struct rfcomm_lmcc { uint8_t type; uint16_t length; @@ -279,6 +283,20 @@ static inline bool mcc_pn(struct rfcomm_frame *rfcomm_frame, uint8_t indent) return true; } +static inline bool mcc_nsc(struct rfcomm_frame *rfcomm_frame, uint8_t indent) +{ + struct l2cap_frame *frame = &rfcomm_frame->l2cap_frame; + struct rfcomm_nsc nsc; + + if (!l2cap_frame_get_u8(frame, &nsc.cmd_type)) + return false; + + print_field("%*ccr %d, mcc_cmd_type %x", indent, ' ', + GET_CR(nsc.cmd_type), RFCOMM_GET_MCC_TYPE(nsc.cmd_type)); + + return true; +} + struct mcc_data { uint8_t type; const char *str; @@ -348,6 +366,8 @@ static inline bool mcc_frame(struct rfcomm_frame *rfcomm_frame, uint8_t indent) return mcc_rls(rfcomm_frame, indent+2); case RFCOMM_PN: return mcc_pn(rfcomm_frame, indent+2); + case RFCOMM_NSC: + return mcc_nsc(rfcomm_frame, indent+2); default: packet_hexdump(frame->data, frame->size); } |