diff options
author | Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com> | 2023-09-19 18:27:44 +0200 |
---|---|---|
committer | Ayush Garg <ayush.garg@samsung.com> | 2024-01-05 19:04:04 +0530 |
commit | a5a783278582387a238ef4ed33239913839bd182 (patch) | |
tree | 615bef041acc50685bb543f0760cc1bdee8fa3d8 | |
parent | 5009498b9dcae184c99ec1c737b0f1669b25874f (diff) | |
download | bluez-a5a783278582387a238ef4ed33239913839bd182.tar.gz bluez-a5a783278582387a238ef4ed33239913839bd182.tar.bz2 bluez-a5a783278582387a238ef4ed33239913839bd182.zip |
emulator: Skip new line when using util_debug
The debug callback vhci_debug() already prints new line after each debug
string. Explicit new line in the util_debug call causes double new line
in the output.
-rwxr-xr-x | emulator/btdev.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/emulator/btdev.c b/emulator/btdev.c index 58414bd7..65ad0a40 100755 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -7298,16 +7298,17 @@ static const struct btdev_cmd *vnd_cmd(struct btdev *btdev, uint8_t op, const struct btdev_cmd *cmd, const void *data, uint8_t len) { + uint8_t opcode = ((const uint8_t *)data)[0]; + for (; cmd && cmd->func; cmd++) { - if (cmd->opcode != ((uint8_t *)data)[0]) + if (cmd->opcode != opcode) continue; return run_cmd(btdev, cmd, data, len); } util_debug(btdev->debug_callback, btdev->debug_data, - "Unsupported Vendor subcommand 0x%2.2x\n", - ((uint8_t *)data)[0]); + "Unsupported Vendor subcommand 0x%2.2x", opcode); cmd_status(btdev, BT_HCI_ERR_UNKNOWN_COMMAND, op); @@ -7333,7 +7334,7 @@ static const struct btdev_cmd *default_cmd(struct btdev *btdev, uint16_t opcode, } util_debug(btdev->debug_callback, btdev->debug_data, - "Unsupported command 0x%4.4x\n", opcode); + "Unsupported command 0x%4.4x", opcode); cmd_status(btdev, BT_HCI_ERR_UNKNOWN_COMMAND, opcode); @@ -7521,7 +7522,7 @@ void btdev_receive_h4(struct btdev *btdev, const void *data, uint16_t len) break; default: util_debug(btdev->debug_callback, btdev->debug_data, - "Unsupported packet 0x%2.2x\n", pkt_type); + "Unsupported packet 0x%2.2x", pkt_type); break; } } |