Skip to content

Commit 3a8ce6e

Browse files
Thalleymmahadevan108
authored andcommitted
tests: Bluetooth: tester: Add logging of messages for BTP
Add log statements for each command, event and response for debugging purposes. Tests do not send enough of these to clutter the IUT logs and it is useful for debugging to more easily determine what command triggered a function call or when the responses and events are sent to the AutoPTS client. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 3c83604 commit 3a8ce6e

File tree

1 file changed

+12
-0
lines changed
  • tests/bluetooth/tester/src

1 file changed

+12
-0
lines changed

tests/bluetooth/tester/src/btp.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ static void cmd_handler(void *p1, void *p2, void *p3)
9696

9797
cmd = k_fifo_get(&cmds_queue, K_FOREVER);
9898

99+
LOG_DBG("cmd service %u opcode %u index %u", cmd->hdr.service, cmd->hdr.opcode,
100+
cmd->hdr.index);
101+
99102
len = sys_le16_to_cpu(cmd->hdr.len);
100103

101104
btp = find_btp_handler(cmd->hdr.service, cmd->hdr.opcode);
@@ -293,6 +296,8 @@ static void tester_rsp_with_index(uint8_t service, uint8_t opcode, uint8_t index
293296
{
294297
struct btp_status s;
295298

299+
LOG_DBG("service %u opcode %u index %u status %u", service, opcode, index, status);
300+
296301
if (status == BTP_STATUS_SUCCESS) {
297302
tester_send_with_index(service, opcode, index, NULL, 0);
298303
return;
@@ -305,6 +310,9 @@ static void tester_rsp_with_index(uint8_t service, uint8_t opcode, uint8_t index
305310
void tester_event(uint8_t service, uint8_t opcode, const void *data, size_t len)
306311
{
307312
__ASSERT_NO_MSG(opcode >= 0x80);
313+
314+
LOG_DBG("service %u opcode %u", service, opcode);
315+
308316
tester_send_with_index(service, opcode, BTP_INDEX, data, len);
309317
}
310318

@@ -315,6 +323,8 @@ void tester_rsp_full(uint8_t service, uint8_t opcode, const void *rsp, size_t le
315323
__ASSERT_NO_MSG(opcode < 0x80);
316324
__ASSERT_NO_MSG(delayed_cmd != NULL);
317325

326+
LOG_DBG("service %u opcode %u", service, opcode);
327+
318328
tester_send_with_index(service, opcode, BTP_INDEX, rsp, len);
319329

320330
cmd = delayed_cmd;
@@ -331,6 +341,8 @@ void tester_rsp(uint8_t service, uint8_t opcode, uint8_t status)
331341
__ASSERT_NO_MSG(opcode < 0x80);
332342
__ASSERT_NO_MSG(delayed_cmd != NULL);
333343

344+
LOG_DBG("service %u opcode %u status %u", service, opcode, status);
345+
334346
tester_rsp_with_index(service, opcode, BTP_INDEX, status);
335347

336348
cmd = delayed_cmd;

0 commit comments

Comments
 (0)