Krolyxon
Commit bd12e09

Branches

Tags

Refs →

orion-rfbd12e09

add wifi in nrf jammer

Author
krolyxon
Date
2026-05-07 20:34 +0530
Parent
2922e83
Commit
bd12e096d17dd47b8b7b7399df936a5eab32c2be

+75 −23

1 file changed

  1. M firmware/nrf24.cpp +75 −23
M firmware/nrf24.cpp View
@@ -18,6 +18,12 @@ const byte bluetoothChannels[] = {
1818 74, 76, 78, 80
1919 };
2020
21+const byte wifiChannels[] = {
22+ 12, 17, 22, 27, 32,
23+ 37, 42, 47, 52, 57,
24+ 62, 67, 72
25+};
26+
2127 void initNRF(RF24 &radio)
2228 {
2329 if (!radio.begin(RADIO_SPI)) {
@@ -119,29 +125,66 @@ void startJammer(const char* name, const byte* channels, size_t channelCount)
119125 const char payload[] = "xxxxxxxxxxxxxxxx";
120126
121127 u8g2.clearBuffer();
122− u8g2.drawStr(0, 10, "Jamming:");
123− u8g2.setCursor(60, 10);
124− u8g2.print(name);
128+ u8g2.setFont(u8g2_font_6x10_tr);
129+ u8g2.drawStr(0, 15, "NRF24 Jammer");
130+ u8g2.drawStr(0, 35, name);
131+ u8g2.drawStr(0, 55, "BACK = Exit");
125132 u8g2.sendBuffer();
126133
127− while (true)
128− {
129− for (size_t i = 0; i < channelCount; i++)
130− {
131− radio1.setChannel(channels[i]);
132− radio1.write(&payload, sizeof(payload));
133−
134− // Optional second NRF
135− // radio2.setChannel(channels[i]);
136− // radio2.write(&payload, sizeof(payload));
137− }
138−
139− if (btnBack())
140− {
141− Serial.println("Jammer stopped");
142− return;
143− }
144− }
134+ while (true)
135+ {
136+ for (size_t i = 0; i < channelCount; i++)
137+ {
138+ //radio1.setChannel(channels[i]);
139+ //radio1.write(&payload, sizeof(payload));
140+
141+ // Optional second NRF
142+ // radio2.setChannel(channels[i]);
143+ // radio2.write(&payload, sizeof(payload));
144+
145+
146+ radio1.setChannel(channels[i]);
147+ radio2.setChannel(channels[(i + 1) % channelCount]);
148+
149+ radio1.writeFast(&payload, sizeof(payload));
150+ radio2.writeFast(&payload, sizeof(payload));
151+ }
152+
153+ if (btnBack())
154+ {
155+ Serial.println("Jammer stopped");
156+ radio1.powerDown();
157+ radio2.powerDown();
158+ return;
159+ }
160+ }
161+
162+ //while (true) {
163+ //for (size_t i = 0; i < channelCount; i++)
164+ //{
165+ // radio1.setChannel(channels[i]);
166+ // radio2.setChannel(channels[(i + 1) % channelCount]);
167+
168+ // radio1.writeFast(&payload, sizeof(payload));
169+ // radio2.writeFast(&payload, sizeof(payload));
170+
171+ // radio1.txStandBy(1);
172+ // radio2.txStandBy(1);
173+
174+ // delayMicroseconds(200);
175+ //}
176+
177+
178+ //if (btnBack())
179+ //{
180+ // Serial.println("Jammer stopped");
181+
182+ // radio1.powerDown();
183+ // radio2.powerDown();
184+
185+ // return;
186+ //}
187+//}
145188 }
146189
147190 void NRFToolsMenu(int index) {
@@ -152,7 +195,7 @@ void NRFToolsMenu(int index) {
152195 startJammer(
153196 "BLE",
154197 bleChannels,
155− sizeof(bleChannels)
198+ sizeof(bleChannels) / sizeof(bleChannels[0])
156199 );
157200
158201 break;
@@ -162,8 +205,17 @@ void NRFToolsMenu(int index) {
162205 startJammer(
163206 "Bluetooth",
164207 bluetoothChannels,
165− sizeof(bluetoothChannels)
208+ sizeof(bluetoothChannels) / sizeof(bluetoothChannels[0])
166209 );
167210 break;
211+
212+ case 2:
213+ startJammer(
214+ "WiFi",
215+ wifiChannels,
216+ sizeof(wifiChannels) / sizeof(wifiChannels[0])
217+ );
218+ break;
219+
168220 }
169221 }