From: sgunderson@bigfoot.com <> Date: Sat, 10 Feb 2007 00:25:23 +0000 (+0100) Subject: Add vibration on packet counters. X-Git-Url: https://git.sesse.net/?p=wardrive;a=commitdiff_plain;h=2d8bc0c5b94de90cdab4af759b0a41a1815d4ac5 Add vibration on packet counters. --- diff --git a/bt-remote.c b/bt-remote.c index 5434570..359648e 100644 --- a/bt-remote.c +++ b/bt-remote.c @@ -24,6 +24,7 @@ int parse_packet(unsigned char *buf, unsigned bytes, int sock) printf("Couldn't parse NETWORK packet\n"); } else { if (strcmp(bssid, "00:0D:54:A0:27:7F") == 0) { + static int last_crypted = 0; char str1[64], str2[64], str3[64], str4[64]; short len; sprintf(str1, "Crypted: %d", crypted); @@ -50,7 +51,19 @@ int parse_packet(unsigned char *buf, unsigned bytes, int sock) len = htons(strlen(str4)); write(sock, (char*)&len, 2); write(sock, str4, strlen(str4)); + + // vibrate 250ms for every 10k packets + if (crypted/10000 != last_crypted/10000) { + write(sock, "\000\016\000\002\000\372", 6); + } + // vibrate 1750ms extra for every 100k packets + if (crypted/100000 != last_crypted/100000) { + write(sock, "\000\016\000\002\006\326", 6); + } + + last_crypted = crypted; + ret = 1; } } diff --git a/protocol.txt b/protocol.txt index ad8859a..ff08d47 100644 --- a/protocol.txt +++ b/protocol.txt @@ -40,6 +40,7 @@ vibrate: \000\016 0 14: vibrate +