]> git.sesse.net Git - wardrive/commitdiff
Add vibration on packet counters.
authorsgunderson@bigfoot.com <>
Sat, 10 Feb 2007 00:25:23 +0000 (01:25 +0100)
committersgunderson@bigfoot.com <>
Sat, 10 Feb 2007 00:25:23 +0000 (01:25 +0100)
bt-remote.c
protocol.txt

index 54345701cae7996f5e112d36c20325480bcacdf4..359648e770c47b67126966936426299741006781 100644 (file)
@@ -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;
                                }
                        }
index ad8859a1fdea684bb867278c3b20ce03e3f994d4..ff08d47acf2b8e5723c4b7c6fd2b479e160f1a10 100644 (file)
@@ -40,6 +40,7 @@ vibrate: \000\016
        <length-hi> <length-lo> <text2>
 
 0 14:  vibrate
+       <len in ms?>