summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Geoffrey Kruse2021-03-07 15:54:07 -0800
committerGravatar Nikias Bassen2022-05-05 19:00:09 +0200
commitef94d2370063b6a409ff338dc87c06c2bb6d22c2 (patch)
tree71fc5008b04aafac77c07486e2dbff94e94a238e /tools
parent881d76c753846d38f7207fc992ea7fd1fd4692ed (diff)
downloadlibimobiledevice-ef94d2370063b6a409ff338dc87c06c2bb6d22c2.tar.gz
libimobiledevice-ef94d2370063b6a409ff338dc87c06c2bb6d22c2.tar.bz2
idevicebtlogger: Minor cleanup
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicebtlogger.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/idevicebtlogger.c b/tools/idevicebtlogger.c
index 7e1c0b0..b73d958 100644
--- a/tools/idevicebtlogger.c
+++ b/tools/idevicebtlogger.c
@@ -66,6 +66,9 @@ typedef enum {
RECV_ACL_DATA = 0x03
} PacketLoggerPacketType;
+/**
+ * Callback from the packet logger service to handle packets and log to pcap
+ */
static void bt_packet_logger_callback(uint8_t * data, uint16_t len, void *user_data)
{
bt_packet_logger_header_t * header = (bt_packet_logger_header_t *)data;
@@ -128,6 +131,9 @@ static void bt_packet_logger_callback(uint8_t * data, uint16_t len, void *user_d
}
}
+/**
+ * Disable HCI log capture
+ */
static void stop_logging(void)
{
fflush(NULL);
@@ -143,6 +149,9 @@ static void stop_logging(void)
}
}
+/**
+ * Enable HCI log capture
+ */
static int start_logging(void)
{
idevice_error_t ret = idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX);
@@ -180,6 +189,9 @@ static int start_logging(void)
return 0;
}
+/**
+ * Callback for device events
+ */
static void device_event_cb(const idevice_event_t* event, void* userdata)
{
if (use_network && event->conn_type != CONNECTION_NETWORK) {
@@ -218,6 +230,9 @@ static void clean_exit(int sig)
quit_flag++;
}
+/**
+ * print usage information
+ */
static void print_usage(int argc, char **argv, int is_error)
{
char *name = NULL;
@@ -240,6 +255,9 @@ static void print_usage(int argc, char **argv, int is_error)
);
}
+/**
+ * Program entry
+ */
int main(int argc, char *argv[])
{
int c = 0;