ericsson.c 726 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2004-2011 Marcel Holtmann <marcel@holtmann.org>
  7. *
  8. *
  9. */
  10. #ifdef HAVE_CONFIG_H
  11. #include <config.h>
  12. #endif
  13. #define _GNU_SOURCE
  14. #include <stdio.h>
  15. #include <errno.h>
  16. #include "parser.h"
  17. void ericsson_dump(int level, struct frame *frm)
  18. {
  19. uint8_t event = p_get_u8(frm);
  20. uint8_t *buf = (uint8_t *) frm->ptr;
  21. if (event != 0x10) {
  22. p_indent(level, frm);
  23. printf("Ericsson: event 0x%2.2x\n", event);
  24. raw_dump(level, frm);
  25. }
  26. frm->central = !(buf[0] & 0x01);
  27. frm->handle = buf[1] | (buf[2] << 8);
  28. buf[5] = (buf[5] << 1) | (buf[3] & 0x01);
  29. frm->ptr += 5;
  30. frm->len -= 5;
  31. lmp_dump(level, frm);
  32. }