Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/com/openipc/pixelpilot/UsbDeviceFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public static List<UsbDeviceFilter> parseXml(Context context, int resourceId)
String vendorIdString = parser.getAttributeValue(null, "vendor-id");
String productIdString = parser.getAttributeValue(null, "product-id");

int vendorId = Integer.parseInt(vendorIdString, 16);
int productId = Integer.parseInt(productIdString, 16);
int vendorId = Integer.decode(vendorIdString);
int productId = Integer.decode(productIdString);

UsbDeviceFilter device = new UsbDeviceFilter(vendorId, productId);
devices.add(device);
Expand Down
129 changes: 107 additions & 22 deletions app/src/main/res/xml/usb_device_filter.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device
product-id="8812"
vendor-id="0BDA" /> <!-- RTL8812AU -->
product-id="0x8812"
vendor-id="0x0BDA" /> <!-- RTL8812AU -->
<usb-device
product-id="881A"
vendor-id="0BDA" /> <!-- RTL8812AU-VS -->
product-id="0x881A"
vendor-id="0x0BDA" /> <!-- RTL8812AU-VS -->
<usb-device
product-id="881B"
vendor-id="0BDA" /> <!-- RTL8812AU-VL -->
product-id="0x881B"
vendor-id="0x0BDA" /> <!-- RTL8812AU-VL -->
<usb-device
product-id="0101"
vendor-id="2357" /> <!-- Archer T4U -->
product-id="0x0101"
vendor-id="0x2357" /> <!-- Archer T4U -->
<usb-device
product-id="0103"
vendor-id="2357" /> <!-- Archer T4UH -->
product-id="0x0103"
vendor-id="0x2357" /> <!-- Archer T4UH -->
<usb-device
product-id="010D"
vendor-id="2357" /> <!-- Archer T4U V2 -->
product-id="0x010D"
vendor-id="0x2357" /> <!-- Archer T4U V2 -->
<usb-device
product-id="010E"
vendor-id="2357" /> <!-- Archer T4UH V2 -->
product-id="0x010E"
vendor-id="0x2357" /> <!-- Archer T4UH V2 -->
<usb-device
product-id="17D2"
vendor-id="0B05" /> <!-- Asus AC56 -->
product-id="0x17D2"
vendor-id="0x0B05" /> <!-- Asus AC56 -->
<usb-device
product-id="0012"
vendor-id="2604" /> <!-- Tenda U12 -->
product-id="0x0012"
vendor-id="0x2604" /> <!-- Tenda U12 -->
<usb-device
product-id="0408"
vendor-id="0409" /> <!-- NEC AtermWL900U -->
product-id="0x0408"
vendor-id="0x0409" /> <!-- NEC AtermWL900U -->
<usb-device
product-id="3426"
vendor-id="0586" /> <!-- ZyXel 6605 -->
product-id="0x3426"
vendor-id="0x0586" /> <!-- ZyXel 6605 -->

<!-- RTL8811AU -->
<usb-device
product-id="0x0811"
vendor-id="0x0BDA" /> <!-- 0BDA:0811 -->
<usb-device
product-id="0xA811"
vendor-id="0x0BDA" /> <!-- 0BDA:A811 -->
<usb-device
product-id="0xB811"
vendor-id="0x0BDA" /> <!-- 0BDA:B811 -->

<!-- RTL8821AU -->
<usb-device
product-id="0x0820"
vendor-id="0x0BDA" /> <!-- 0BDA:0820 -->
<usb-device
product-id="0x0821"
vendor-id="0x0BDA" /> <!-- 0BDA:0821 -->
<usb-device
product-id="0x0823"
vendor-id="0x0BDA" /> <!-- 0BDA:0823 -->
<usb-device
product-id="0x8822"
vendor-id="0x0BDA" /> <!-- 0BDA:8822 -->
<usb-device
product-id="0x0242"
vendor-id="0x0411" /> <!-- 0411:0242 -->
<usb-device
product-id="0x029B"
vendor-id="0x0411" /> <!-- 0411:029B -->
<usb-device
product-id="0x0953"
vendor-id="0x04BB" /> <!-- 04BB:0953 -->
<usb-device
product-id="0x4007"
vendor-id="0x056E" /> <!-- 056E:4007 -->
<usb-device
product-id="0x400E"
vendor-id="0x056E" /> <!-- 056E:400E -->
<usb-device
product-id="0x400F"
vendor-id="0x056E" /> <!-- 056E:400F -->
<usb-device
product-id="0x9052"
vendor-id="0x0846" /> <!-- 0846:9052 -->
<usb-device
product-id="0x0023"
vendor-id="0x0E66" /> <!-- 0E66:0023 -->
<usb-device
product-id="0x3314"
vendor-id="0x2001" /> <!-- 2001:3314 -->
<usb-device
product-id="0x3318"
vendor-id="0x2001" /> <!-- 2001:3318 -->
<usb-device
product-id="0xAB32"
vendor-id="0x2019" /> <!-- 2019:AB32 -->
<usb-device
product-id="0x804B"
vendor-id="0x20F4" /> <!-- 20F4:804B -->
<usb-device
product-id="0x011E"
vendor-id="0x2357" /> <!-- 2357:011E -->
<usb-device
product-id="0x0120"
vendor-id="0x2357" /> <!-- 2357:0120 -->
<usb-device
product-id="0x0122"
vendor-id="0x2357" /> <!-- 2357:0122 -->
<usb-device
product-id="0x6249"
vendor-id="0x3823" /> <!-- 3823:6249 -->
<usb-device
product-id="0xA811"
vendor-id="0x7392" /> <!-- 7392:A811 -->
<usb-device
product-id="0xA812"
vendor-id="0x7392" /> <!-- 7392:A812 -->
<usb-device
product-id="0xA813"
vendor-id="0x7392" /> <!-- 7392:A813 -->
<usb-device
product-id="0xB611"
vendor-id="0x7392" /> <!-- 7392:B611 -->
</resources>
22 changes: 20 additions & 2 deletions app/wfbngrtl8812/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,23 @@ add_library(devourer STATIC
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8812PhyReg.h
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8812PwrSeq.c
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8812PwrSeq.h
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8814PhyCfg.h
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8814PhyReg.h
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8814PwrSeq.c
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8814PwrSeq.h
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8814_PostFwdlReplay.h
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8821APwrSeq.c
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8821APwrSeq.h
${CMAKE_SOURCE_DIR}/devourer/hal/Hal8821PhyReg.h
${CMAKE_SOURCE_DIR}/devourer/hal/basic_types.h
${CMAKE_SOURCE_DIR}/devourer/hal/hal8812a_fw.c
${CMAKE_SOURCE_DIR}/devourer/hal/hal8812a_fw.h
${CMAKE_SOURCE_DIR}/devourer/hal/hal8814a_fw.c
${CMAKE_SOURCE_DIR}/devourer/hal/hal8814a_fw.h
${CMAKE_SOURCE_DIR}/devourer/hal/hal8821a_fw.c
${CMAKE_SOURCE_DIR}/devourer/hal/hal8821a_fw.h
${CMAKE_SOURCE_DIR}/devourer/hal/phydm/rtl8814a/Hal8814_PhyTables.c
${CMAKE_SOURCE_DIR}/devourer/hal/phydm/rtl8814a/Hal8814_PhyTables.h
${CMAKE_SOURCE_DIR}/devourer/hal/hal_com_reg.h
${CMAKE_SOURCE_DIR}/devourer/hal/rtl8812a_hal.h
${CMAKE_SOURCE_DIR}/devourer/hal/rtl8812a_recv.h
Expand All @@ -52,10 +66,12 @@ add_library(devourer STATIC
${CMAKE_SOURCE_DIR}/devourer/src/HalModule.cpp
${CMAKE_SOURCE_DIR}/devourer/src/HalModule.h
${CMAKE_SOURCE_DIR}/devourer/src/ParsedRadioPacket.cpp
${CMAKE_SOURCE_DIR}/devourer/src/PhyTableLoader.cpp
${CMAKE_SOURCE_DIR}/devourer/src/PhyTableLoader.h
${CMAKE_SOURCE_DIR}/devourer/src/RadioManagementModule.cpp
${CMAKE_SOURCE_DIR}/devourer/src/RadioManagementModule.h
${CMAKE_SOURCE_DIR}/devourer/src/Rtl8812aDevice.cpp
${CMAKE_SOURCE_DIR}/devourer/src/Rtl8812aDevice.h
${CMAKE_SOURCE_DIR}/devourer/src/RtlJaguarDevice.cpp
${CMAKE_SOURCE_DIR}/devourer/src/RtlJaguarDevice.h
${CMAKE_SOURCE_DIR}/devourer/src/RtlUsbAdapter.cpp
${CMAKE_SOURCE_DIR}/devourer/src/RtlUsbAdapter.h
${CMAKE_SOURCE_DIR}/devourer/src/SelectedChannel.h
Expand All @@ -67,6 +83,8 @@ set_target_properties(devourer PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_

target_include_directories(devourer PUBLIC ${CMAKE_SOURCE_DIR}/devourer)
target_include_directories(devourer PUBLIC ${CMAKE_SOURCE_DIR}/devourer/hal)
target_include_directories(devourer PUBLIC ${CMAKE_SOURCE_DIR}/devourer/hal/phydm)
target_include_directories(devourer PUBLIC ${CMAKE_SOURCE_DIR}/devourer/hal/phydm/rtl8814a)
set_property(TARGET devourer PROPERTY CXX_STANDARD 20)

# WFB-NG RTL8812 library
Expand Down
8 changes: 4 additions & 4 deletions app/wfbngrtl8812/src/main/cpp/TxFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "sodium/crypto_aead_chacha20poly1305.h"
#include "sodium/crypto_box.h"
#include "sodium/randombytes.h"
#include "src/Rtl8812aDevice.h"
#include "src/RtlJaguarDevice.h"
#include "src/wifibroadcast.hpp"
#include "src/zfex.h"

Expand Down Expand Up @@ -422,7 +422,7 @@ UsbTransmitter::UsbTransmitter(int k,
uint8_t *radiotapHeader,
size_t radiotapHeaderLen,
uint8_t frameType,
Rtl8812aDevice *device)
RtlJaguarDevice *device)
: Transmitter(k, n, keypair, epoch, channelId), channelId_(channelId), currentOutput_(0), ieee80211Sequence_(0),
radiotapHeader_(radiotapHeader), radiotapHeaderLen_(radiotapHeaderLen), frameType_(frameType),
rtlDevice_(device) {
Expand Down Expand Up @@ -795,7 +795,7 @@ void TxFrame::dataSource(
}
}

void TxFrame::run(Rtl8812aDevice *rtlDevice, TxArgs *arg) {
void TxFrame::run(RtlJaguarDevice *rtlDevice, TxArgs *arg) {
// Decide if using VHT
if (arg->bandwidth >= 80) {
arg->vht_mode = true;
Expand Down Expand Up @@ -964,4 +964,4 @@ void TxFrame::run(Rtl8812aDevice *rtlDevice, TxArgs *arg) {
std::fprintf(stderr, "Error in TxFrame::run: %s\n", ex.what());
#endif
}
}
}
10 changes: 5 additions & 5 deletions app/wfbngrtl8812/src/main/cpp/TxFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extern "C" {
#include "wfb-ng/src/zfex.h" // FEC library
}

#include "devourer/src/Rtl8812aDevice.h" // Rtl8812aDevice definition
#include "devourer/src/RtlJaguarDevice.h" // RtlJaguarDevice definition
#include "wfb-ng/src/wifibroadcast.hpp" // Wifibroadcast definitions

// -- System / C++ Includes --
Expand Down Expand Up @@ -294,7 +294,7 @@ class UsbTransmitter : public Transmitter {
uint8_t *radiotapHeader,
size_t radiotapHeaderLen,
uint8_t frameType,
Rtl8812aDevice *device);
RtlJaguarDevice *device);

~UsbTransmitter() override = default;

Expand All @@ -314,7 +314,7 @@ class UsbTransmitter : public Transmitter {
uint8_t *radiotapHeader_;
size_t radiotapHeaderLen_;
uint8_t frameType_;
Rtl8812aDevice *rtlDevice_;
RtlJaguarDevice *rtlDevice_;
};

//-------------------------------------------------------------
Expand Down Expand Up @@ -379,10 +379,10 @@ class TxFrame {

/**
* @brief Configures and runs the transmitter with the given arguments.
* @param rtlDevice The Rtl8812aDevice pointer (if using USB).
* @param rtlDevice The RtlJaguarDevice pointer (if using USB).
* @param arg TxArgs structure with user parameters.
*/
void run(Rtl8812aDevice *rtlDevice, TxArgs *arg);
void run(RtlJaguarDevice *rtlDevice, TxArgs *arg);

/**
* @brief Signals that the main loop should stop.
Expand Down
6 changes: 3 additions & 3 deletions app/wfbngrtl8812/src/main/cpp/WfbngLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ std::string generate_random_string(size_t length) {
WfbngLink::WfbngLink(JNIEnv *env, jobject context)
: current_fd(-1), adaptive_link_enabled(true), adaptive_tx_power(30) {
initAgg();
Logger_t log;
log = std::make_shared<Logger>();
wifi_driver = std::make_unique<WiFiDriver>(log);
}

Expand Down Expand Up @@ -218,7 +218,7 @@ int WfbngLink::run(JNIEnv *env, jobject context, jint wifiChannel, jint bw, jint
__android_log_print(
ANDROID_LOG_ERROR, TAG, "radio link ID %d, radio PORT %d", args->link_id, args->radio_port);

Rtl8812aDevice *current_device = rtl_devices.at(fd).get();
RtlJaguarDevice *current_device = rtl_devices.at(fd).get();
if (!usb_tx_thread) {
init_thread(usb_tx_thread, [&]() {
return std::make_unique<std::thread>([this, current_device, args] {
Expand Down Expand Up @@ -588,4 +588,4 @@ extern "C" JNIEXPORT void JNICALL Java_com_openipc_wfbngrtl8812_WfbNgLink_native
link->fec_recovered_to_3 = recTo3;
link->fec_recovered_to_2 = recTo2;
link->fec_recovered_to_1 = recTo1;
}
}
2 changes: 1 addition & 1 deletion app/wfbngrtl8812/src/main/cpp/WfbngLink.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class WfbngLink {
bool ldpc_enabled{true};
bool stbc_enabled{true};

std::map<int, std::shared_ptr<Rtl8812aDevice>> rtl_devices;
std::map<int, std::shared_ptr<RtlJaguarDevice>> rtl_devices;
std::unique_ptr<std::thread> link_quality_thread{nullptr};
bool should_clear_stats{false};
FecChangeController fec;
Expand Down
2 changes: 1 addition & 1 deletion app/wfbngrtl8812/src/main/cpp/devourer
Submodule devourer updated 80 files
+22 −2 CMakeLists.txt
+137 −5 README.md
+110 −9 demo/main.cpp
+250 −0 hal/Hal8814PhyCfg.h
+863 −0 hal/Hal8814PhyReg.h
+87 −0 hal/Hal8814PwrSeq.c
+231 −0 hal/Hal8814PwrSeq.h
+4,495 −0 hal/Hal8814_PostFwdlReplay.h
+86 −0 hal/Hal8821APwrSeq.c
+200 −0 hal/Hal8821APwrSeq.h
+1,312 −0 hal/Hal8821PhyReg.h
+19,633 −0 hal/hal8814a_fw.c
+43 −0 hal/hal8814a_fw.h
+13,780 −0 hal/hal8821a_fw.c
+40 −0 hal/hal8821a_fw.h
+24,870 −0 hal/phydm/halrf/rtl8814a/halhwimg8814a_rf.c
+394 −0 hal/phydm/halrf/rtl8814a/halhwimg8814a_rf.h
+15,284 −0 hal/phydm/rtl8814a/Hal8814_PhyTables.c
+60 −0 hal/phydm/rtl8814a/Hal8814_PhyTables.h
+39 −0 hal/phydm/rtl8814a/hal8814areg_odm.h
+8,041 −0 hal/phydm/rtl8814a/halhwimg8814a_bb.c
+177 −0 hal/phydm/rtl8814a/halhwimg8814a_bb.h
+326 −0 hal/phydm/rtl8814a/halhwimg8814a_mac.c
+42 −0 hal/phydm/rtl8814a/halhwimg8814a_mac.h
+244 −0 hal/phydm/rtl8814a/phydm_regconfig8814a.c
+47 −0 hal/phydm/rtl8814a/phydm_regconfig8814a.h
+254 −0 hal/phydm/rtl8814a/phydm_rtl8814a.c
+26 −0 hal/phydm/rtl8814a/phydm_rtl8814a.h
+34 −0 hal/phydm/rtl8814a/version_rtl8814a.h
+942 −0 hal/rtl8814a/rtl8814a_cmd.c
+300 −0 hal/rtl8814a/rtl8814a_dm.c
+4,496 −0 hal/rtl8814a/rtl8814a_hal_init.c
+2,353 −0 hal/rtl8814a/rtl8814a_phycfg.c
+182 −0 hal/rtl8814a/rtl8814a_rf6052.c
+60 −0 hal/rtl8814a/rtl8814a_rxdesc.c
+106 −0 hal/rtl8814a/rtl8814a_sreset.c
+524 −0 hal/rtl8814a/rtl8814a_xmit.c
+143 −0 hal/rtl8814a/usb/rtl8814au_led.c
+28 −0 hal/rtl8814a/usb/rtl8814au_recv.c
+1,066 −0 hal/rtl8814a/usb/rtl8814au_xmit.c
+2,047 −0 hal/rtl8814a/usb/usb_halinit.c
+233 −0 hal/rtl8814a/usb/usb_ops_linux.c
+166 −0 hal/rtl8814a_cmd.h
+23 −0 hal/rtl8814a_dm.h
+331 −0 hal/rtl8814a_hal.h
+36 −0 hal/rtl8814a_led.h
+182 −0 hal/rtl8814a_recv.h
+28 −0 hal/rtl8814a_rf.h
+648 −0 hal/rtl8814a_spec.h
+24 −0 hal/rtl8814a_sreset.h
+311 −0 hal/rtl8814a_xmit.h
+31 −0 inventory/cf938ac_macos.txt
+184 −11 src/EepromManager.cpp
+13 −0 src/EepromManager.h
+33 −4 src/Firmware.h
+672 −16 src/FirmwareManager.cpp
+16 −2 src/FirmwareManager.h
+10 −0 src/FrameParser.cpp
+5 −2 src/FrameParser.h
+976 −49 src/HalModule.cpp
+27 −0 src/HalModule.h
+105 −0 src/PhyTableLoader.cpp
+44 −0 src/PhyTableLoader.h
+201 −57 src/RadioManagementModule.cpp
+3 −0 src/RadioManagementModule.h
+2 −0 src/RfPath.h
+30 −25 src/RtlJaguarDevice.cpp
+15 −5 src/RtlJaguarDevice.h
+143 −8 src/RtlUsbAdapter.cpp
+24 −0 src/RtlUsbAdapter.h
+4 −4 src/WiFiDriver.cpp
+2 −2 src/WiFiDriver.h
+46 −3 src/logger.h
+279 −0 tests/README.md
+212 −0 tests/inject_beacon.py
+1,475 −0 tests/regress.py
+192 −0 tests/setup_vm.sh
+310 −0 tests/sniff_air.py
+124 −0 tools/extract_8814a_phy_tables.py
+243 −66 txdemo/main.cpp