Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed offset that was clipping first letter of name #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions experiments/scantest.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#ifdef USE_CURSES
#include <curses.h>
#else
#include <stdarg.h>
#include <stdio.h>
#define TRUE 1
#define FALSE 0
#endif
#include <stdlib.h>
#include <errno.h>
#include <curses.h>
#include <unistd.h>
#include <sys/ioctl.h>

Expand All @@ -27,6 +34,17 @@ struct hci_state {
#define EIR_NAME_COMPLETE 0x09
#define EIR_MANUFACTURE_SPECIFIC 0xFF

#ifndef USE_CURSES
void wprintf(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
}
#endif


struct hci_state open_default_hci_device()
{
struct hci_state current_hci_state = {0};
Expand Down Expand Up @@ -141,7 +159,7 @@ void process_data(uint8_t *data, size_t data_len, le_advertising_info *info)
size_t name_len = data_len - 1;
char *name = malloc(name_len + 1);
memset(name, 0, name_len + 1);
memcpy(name, &data[2], name_len);
memcpy(name, &data[1], name_len);

char addr[18];
ba2str(&info->bdaddr, addr);
Expand Down