ble_gatt_client
|
set of utility functions More...
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <limits.h>
#include <string.h>
#include "util.h"
Go to the source code of this file.
Functions | |
void | util_debug (util_debug_func_t function, void *user_data, const char *format,...) |
void | util_hexdump (const char dir, const unsigned char *buf, size_t len, util_debug_func_t function, void *user_data) |
unsigned char | util_get_dt (const char *parent, const char *name) |
uint8_t | util_get_uid (unsigned int *bitmap, uint8_t max) |
void | util_clear_uid (unsigned int *bitmap, uint8_t id) |
set of utility functions
Definition in file util.c.
void util_clear_uid | ( | unsigned int * | bitmap, |
uint8_t | id | ||
) |
void util_debug | ( | util_debug_func_t | function, |
void * | user_data, | ||
const char * | format, | ||
... | |||
) |
create a str debug message using format and then call function(str,user_data)
function | function to call |
user_data | data for the "function" |
format | format string template of str string |
Definition at line 56 of file util.c.
References timeout_data::user_data.
Referenced by bt_gatt_client_prepare_write(), can_read_data(), can_write_data(), disconnect_cb(), discover_chrcs_cb(), discover_descs(), discover_descs_cb(), discover_incl_cb(), discover_primary_cb(), discover_secondary_cb(), encode_pdu(), exchange_mtu_cb(), handle_conf(), handle_error_rsp(), handle_rsp(), handle_signed(), init_complete(), process_service_changed(), service_changed_cb(), service_changed_complete(), service_changed_register_cb(), and timeout_cb().
unsigned char util_get_dt | ( | const char * | parent, |
const char * | name | ||
) |
uint8_t util_get_uid | ( | unsigned int * | bitmap, |
uint8_t | max | ||
) |
void util_hexdump | ( | const char | dir, |
const unsigned char * | buf, | ||
size_t | len, | ||
util_debug_func_t | function, | ||
void * | user_data | ||
) |
hexadecimal dump utility: create the str hex string and then call function(str,user_data)
dir | first char of str |
buf | buffer to convert to hex (str) |
len | size of buffer (should be less than or equal to 16) |
function | function to call with (str,user_data) |
user_data | pointer to pass to function |
Definition at line 81 of file util.c.
References timeout_data::user_data.
Referenced by can_read_data(), and can_write_data().