hci_dump.h (128d6c999a4a7cc321497ddbaddd9cd6c8d1edef) | hci_dump.h (cdc66b5eb8d7f9a749c9003bdeb0f95de0a1be78) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43 * Created by Matthias Ringwald on 5/26/09. 44 */ 45 46#ifndef HCI_DUMP_H 47#define HCI_DUMP_H 48 49#include <stdint.h> 50#include <stdarg.h> // for va_list | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43 * Created by Matthias Ringwald on 5/26/09. 44 */ 45 46#ifndef HCI_DUMP_H 47#define HCI_DUMP_H 48 49#include <stdint.h> 50#include <stdarg.h> // for va_list |
51#include "btstack_bool.h" |
|
51 52#ifdef __AVR__ 53#include <avr/pgmspace.h> 54#endif 55 56#if defined __cplusplus 57extern "C" { 58#endif --- 21 unchanged lines hidden (view full) --- 80 // log message 81 void (*log_message)(const char * format, va_list argptr); 82#ifdef __AVR__ \ 83 // log message - AVR 84 void (*log_message_P)(int log_level, PGM_P * format, va_list argptr); 85#endif 86} hci_dump_t; 87 | 52 53#ifdef __AVR__ 54#include <avr/pgmspace.h> 55#endif 56 57#if defined __cplusplus 58extern "C" { 59#endif --- 21 unchanged lines hidden (view full) --- 81 // log message 82 void (*log_message)(const char * format, va_list argptr); 83#ifdef __AVR__ \ 84 // log message - AVR 85 void (*log_message_P)(int log_level, PGM_P * format, va_list argptr); 86#endif 87} hci_dump_t; 88 |
88/* | 89/** |
89 * @brief Init HCI Dump 90 * @param hci_dump_impl - platform-specific implementation 91 */ 92void hci_dump_init(const hci_dump_t * hci_dump_impl); 93 | 90 * @brief Init HCI Dump 91 * @param hci_dump_impl - platform-specific implementation 92 */ 93void hci_dump_init(const hci_dump_t * hci_dump_impl); 94 |
95/** 96 * @brief Enable packet logging 97 * @param enabled default: true 98 */ 99void hci_dump_enable_packet_log(bool enabled); 100 101/** 102 * @brief 103 */ 104void hci_dump_enable_log_level(int log_level, int enable); 105 |
|
94/* 95 * @brief Set max number of packets - output file might be truncated 96 */ 97void hci_dump_set_max_packets(int packets); // -1 for unlimited 98 | 106/* 107 * @brief Set max number of packets - output file might be truncated 108 */ 109void hci_dump_set_max_packets(int packets); // -1 for unlimited 110 |
99/* | 111/** |
100 * @brief Dump Packet 101 * @param packet_type 102 * @param in is 1 for incoming, 0 for outoing 103 * @param packet 104 * @param len 105 */ 106void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t len); 107 | 112 * @brief Dump Packet 113 * @param packet_type 114 * @param in is 1 for incoming, 0 for outoing 115 * @param packet 116 * @param len 117 */ 118void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t len); 119 |
108/* | 120/** |
109 * @brief Dump Message 110 * @param log_level 111 * @param format 112 */ 113void hci_dump_log(int log_level, const char * format, ...) 114#ifdef __GNUC__ 115__attribute__ ((format (__printf__, 2, 3))) 116#endif --- 27 unchanged lines hidden (view full) --- 144 * @param tv_sec 145 * @param tv_us 146 * @param packet_type 147 * @param in 148 * @param len 149 */ 150void hci_dump_setup_header_bluez(uint8_t * buffer, uint32_t tv_sec, uint32_t tv_us, uint8_t packet_type, uint8_t in, uint16_t len); 151 | 121 * @brief Dump Message 122 * @param log_level 123 * @param format 124 */ 125void hci_dump_log(int log_level, const char * format, ...) 126#ifdef __GNUC__ 127__attribute__ ((format (__printf__, 2, 3))) 128#endif --- 27 unchanged lines hidden (view full) --- 156 * @param tv_sec 157 * @param tv_us 158 * @param packet_type 159 * @param in 160 * @param len 161 */ 162void hci_dump_setup_header_bluez(uint8_t * buffer, uint32_t tv_sec, uint32_t tv_us, uint8_t packet_type, uint8_t in, uint16_t len); 163 |
152/* 153 * @brief 154 */ 155void hci_dump_enable_log_level(int log_level, int enable); 156 | |
157/* API_END */ 158 159 160#if defined __cplusplus 161} 162#endif 163#endif // HCI_DUMP_H | 164/* API_END */ 165 166 167#if defined __cplusplus 168} 169#endif 170#endif // HCI_DUMP_H |