| @@ -9,7 +9,7 @@ |
| 9 | 9 | | #include "wifi_scan.h" |
| 10 | 10 | | #include "wifi_analyzer.h" |
| 11 | 11 | | #include "device_check.h" |
| 12 | | − | #include "blemouse.h" |
| 12 | + | #include "ble_mouse.h" |
| 13 | 13 | | #include "sysinfo.h" |
| 14 | 14 | | #include "BleMouse.h" |
| 15 | 15 | | |
| @@ -36,7 +36,8 @@ Menu mainMenu = {mainMenuItems, sizeof(mainMenuItems) / sizeof(mainMenuItems[0]) |
| 36 | 36 | | // NRF Tools menu |
| 37 | 37 | | const char *nrfToolsItems[] = { |
| 38 | 38 | | "BLE Jammer", |
| 39 | | − | "Bluetooth Jammer" |
| 39 | + | "Bluetooth Jammer", |
| 40 | + | "Wifi Jammer" |
| 40 | 41 | | }; |
| 41 | 42 | | |
| 42 | 43 | | Menu nrfToolsMenu = {nrfToolsItems, sizeof(nrfToolsItems) / sizeof(nrfToolsItems[0])}; |
| @@ -225,15 +226,84 @@ void launchFeature() |
| 225 | 226 | | case 7: |
| 226 | 227 | | device_check_run(); |
| 227 | 228 | | break; |
| 228 | | − | case 8: |
| 229 | | − | u8g2.clearBuffer(); |
| 230 | | − | u8g2.setFont(u8g2_font_6x13_tr); |
| 231 | | − | u8g2.drawStr(30, 30, "Restarting..."); |
| 232 | | − | u8g2.sendBuffer(); |
| 233 | | − | delay(1000); |
| 234 | | − | ESP.restart(); |
| 235 | | − | break; |
| 236 | | − | case 9: |
| 229 | + | case 8: |
| 230 | + | { |
| 231 | + | // wait for button release |
| 232 | + | delay(200); |
| 233 | + | |
| 234 | + | while (btnSelect()) |
| 235 | + | delay(10); |
| 236 | + | bool confirm = false; |
| 237 | + | |
| 238 | + | while (1) |
| 239 | + | { |
| 240 | + | u8g2.clearBuffer(); |
| 241 | + | u8g2.setFont(u8g2_font_6x13_tr); |
| 242 | + | |
| 243 | + | u8g2.drawStr(18, 18, "Restart Device?"); |
| 244 | + | |
| 245 | + | if (confirm) |
| 246 | + | { |
| 247 | + | u8g2.drawBox(10, 35, 45, 15); |
| 248 | + | u8g2.setDrawColor(0); |
| 249 | + | u8g2.drawStr(20, 47, "YES"); |
| 250 | + | u8g2.setDrawColor(1); |
| 251 | + | |
| 252 | + | u8g2.drawStr(75, 47, "NO"); |
| 253 | + | } |
| 254 | + | else |
| 255 | + | { |
| 256 | + | u8g2.drawStr(20, 47, "YES"); |
| 257 | + | |
| 258 | + | u8g2.drawBox(65, 35, 45, 15); |
| 259 | + | u8g2.setDrawColor(0); |
| 260 | + | u8g2.drawStr(78, 47, "NO"); |
| 261 | + | u8g2.setDrawColor(1); |
| 262 | + | } |
| 263 | + | |
| 264 | + | u8g2.sendBuffer(); |
| 265 | + | |
| 266 | + | if (btnLeft() || btnUp()) |
| 267 | + | { |
| 268 | + | confirm = true; |
| 269 | + | delay(150); |
| 270 | + | } |
| 271 | + | |
| 272 | + | if (btnRight() || btnDown()) |
| 273 | + | { |
| 274 | + | confirm = false; |
| 275 | + | delay(150); |
| 276 | + | } |
| 277 | + | |
| 278 | + | if (btnSelect()) |
| 279 | + | { |
| 280 | + | delay(150); |
| 281 | + | |
| 282 | + | if (confirm) |
| 283 | + | { |
| 284 | + | u8g2.clearBuffer(); |
| 285 | + | u8g2.drawStr(28, 30, "Restarting..."); |
| 286 | + | u8g2.sendBuffer(); |
| 287 | + | |
| 288 | + | delay(1000); |
| 289 | + | ESP.restart(); |
| 290 | + | } |
| 291 | + | else |
| 292 | + | { |
| 293 | + | break; |
| 294 | + | } |
| 295 | + | } |
| 296 | + | |
| 297 | + | if (btnBack()) |
| 298 | + | { |
| 299 | + | delay(150); |
| 300 | + | break; |
| 301 | + | } |
| 302 | + | } |
| 303 | + | } |
| 304 | + | break; |
| 305 | + | |
| 306 | + | case 9: |
| 237 | 307 | | // Begin Ble mouse |
| 238 | 308 | | bleMouse.begin(); |
| 239 | 309 | | ble_mouse_run(); |