diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-12-27 21:14:39 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-12-27 21:14:39 +0100 |
commit | e002e80f55217e825d6b8a1c6d27b3b781b5e850 (patch) | |
tree | bbe54c6278773ad32f5470aadd0938a50ec83e36 /tools/btmgmt.c | |
parent | 1b9e48f4c2b98ea88e43bd493c098dcca822a1d0 (diff) | |
download | bluez-e002e80f55217e825d6b8a1c6d27b3b781b5e850.tar.gz |
tools: Add support for MGMT_DEBUG environment variable
Diffstat (limited to 'tools/btmgmt.c')
-rw-r--r-- | tools/btmgmt.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/btmgmt.c b/tools/btmgmt.c index fc8f0e37a..f82461ed7 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -4640,6 +4640,13 @@ static struct io *setup_stdin(void) return io; } +static void mgmt_debug(const char *str, void *user_data) +{ + const char *prefix = user_data; + + print("%s%s", prefix, str); +} + int main(int argc, char *argv[]) { struct io *input; @@ -4675,6 +4682,9 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } + if (getenv("MGMT_DEBUG")) + mgmt_set_debug(mgmt, mgmt_debug, "mgmt: ", NULL); + if (argc > 0) { struct cmd_info *c; |