mirror of
https://github.com/jjshoots/RemoteIDSpoofer.git
synced 2026-02-03 23:42:44 +00:00
Merge pull request #3 from jjshoots/dev
Fix issue where only 1/4 of drones were getting through
This commit is contained in:
@@ -16,6 +16,6 @@ void setup() {
|
||||
void loop() {
|
||||
for (int i = 0; i < num_spoofers; i++) {
|
||||
spoofers[i].update();
|
||||
delay(10);
|
||||
delay(500 / num_spoofers);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +69,12 @@ ID_OpenDrone::ID_OpenDrone() {
|
||||
#if ID_OD_WIFI
|
||||
|
||||
// scrambled, not poached
|
||||
for (int i = 0; i < 6; i++) {
|
||||
WiFi_mac_addr[i] = (uint8_t) (rand() % 16);
|
||||
// Nodemcu doesn't like certain mac addresses
|
||||
// setting the first value to 0 seems to solve this
|
||||
WiFi_mac_addr[i] = 0;
|
||||
for (int i = 1; i < 6; i++) {
|
||||
// WiFi_mac_addr[i] = (uint8_t) (rand() % 100 + 100);
|
||||
WiFi_mac_addr[i] = (uint8_t) (rand() % 256);
|
||||
}
|
||||
|
||||
memset(ssid,0,sizeof(ssid));
|
||||
@@ -575,8 +579,6 @@ int ID_OpenDrone::transmit(struct UTM_data *utm_data) {
|
||||
|
||||
// Pack and transmit the WiFi data.
|
||||
|
||||
static uint8_t wifi_toggle = 1;
|
||||
|
||||
if ((msecs - last_wifi) >= beacon_interval) {
|
||||
|
||||
last_wifi = msecs;
|
||||
@@ -783,9 +785,7 @@ int ID_OpenDrone::transmit_wifi(struct UTM_data *utm_data,int prepacked) {
|
||||
odid_message_build_pack(&UAS_data,beacon_payload,beacon_max_packed);
|
||||
|
||||
if (length > 0) {
|
||||
|
||||
*beacon_length = length + 5;
|
||||
|
||||
wifi_status = transmit_wifi2(beacon_frame,len2 = beacon_offset + length);
|
||||
}
|
||||
|
||||
@@ -916,4 +916,4 @@ int ID_OpenDrone::transmit_ble(uint8_t *odid_msg,int length) {
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
*/
|
||||
@@ -137,6 +137,7 @@ private:
|
||||
int auth_page = 0, auth_page_count = 0, key_length = 0, iv_length = 0;
|
||||
char *UAS_operator;
|
||||
uint8_t msg_counter[16];
|
||||
uint8_t wifi_toggle = 1;
|
||||
uint16_t wifi_interval = 0, ble_interval = 0;
|
||||
uint32_t last_ble = 0, last_wifi = 0, msecs = 0, last_msecs = 2000;
|
||||
Stream *Debug_Serial = NULL;
|
||||
|
||||
@@ -161,7 +161,6 @@ int transmit_wifi2(uint8_t *buffer,int length) {
|
||||
#if ID_OD_WIFI
|
||||
|
||||
if (length) {
|
||||
|
||||
wifi_send_pkt_freedom(buffer,length,1);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@ Spoofer::Spoofer() {
|
||||
}
|
||||
|
||||
void Spoofer::update() {
|
||||
if ((millis() - last_update) < 200) {
|
||||
// FAA says minimum rate is 1 Hz, we do 2 Hz here
|
||||
if ((millis() - last_update) < 500) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user