MCPcopy Create free account
hub / github.com/cifertech/nRFBox / jammer

Function jammer

VScode Platformio/src/jammer.cpp:72–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void jammer() {
73 int methode = 1;
74
75 const char text[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55,
76 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 };
77
78 if (methode = 0) {
79 for (int i = ((channels * 5) + 1); i < ((channels * 5) + 23); i++) {
80 radioSetChannel(i);
81 bool resultA = radioA.write(&text, sizeof(text));
82 bool resultB = radioB.write(&text, sizeof(text));
83 bool resultC = radioC.write(&text, sizeof(text));
84
85 delay(10);
86 }
87 }
88
89 if (methode = 1) {
90 for (int i = 0; i < 22; i++) { // Jam across 22 channels
91 int channelA = ((channels * 5) + 1) + i;
92 int channelB = ((channels * 5) + 1) + i + 1;
93 int channelC = ((channels * 5) + 1) + i + 2;
94
95 // Set each radio to a different channel
96 radioA.setChannel(channelA);
97 radioB.setChannel(channelB);
98 radioC.setChannel(channelC);
99
100 // Transmit payload on all three channels simultaneously
101 radioA.write(&text, sizeof(text));
102 radioB.write(&text, sizeof(text));
103 radioC.write(&text, sizeof(text));
104
105 delay(10); // Delay before hopping to the next set of channels
106 }
107 }
108}
109
110void pressBt01() {
111 static unsigned long last_interrupt_time = 0;

Callers 1

jammerLoopFunction · 0.70

Calls 1

radioSetChannelFunction · 0.70

Tested by

no test coverage detected