Skip to content

Commit

Permalink
Switch to svpcom official repository now that it's compatible with an…
Browse files Browse the repository at this point in the history
…droid. Fix issue with crash on startup in 0.14 on devices sdk version > 28
  • Loading branch information
gehee committed Apr 25, 2024
1 parent 794c0c2 commit c370b26
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
[submodule "app/wfbngrtl8812/src/main/cpp/wfb-ng"]
path = app/wfbngrtl8812/src/main/cpp/wfb-ng
url = https://github.com/gehee/wfb-ng.git
branch = android-compat
branch = master

8 changes: 7 additions & 1 deletion app/src/main/java/com/geehe/fpvue/VideoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.graphics.Color;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceView;
Expand All @@ -19,6 +20,7 @@
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import com.geehe.fpvue.databinding.ActivityVideoBinding;
Expand Down Expand Up @@ -96,7 +98,11 @@ public void onReceive(Context context, Intent intent) {
filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
filter.addAction(ACTION_USB_PERMISSION);
registerReceiver(usbReceiver, filter);
if (Build.VERSION.SDK_INT >= 33) {
registerReceiver(usbReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(usbReceiver, filter);
}
}

protected void onStop() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">FPVue Alpha 0.14</string>
<string name="app_name">FPVue Alpha 0.14.1</string>
<string-array name="channels">
<item>1</item>
<item>2</item>
Expand Down
98 changes: 52 additions & 46 deletions app/wfbngrtl8812/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,68 +1,74 @@

cmake_minimum_required(VERSION 3.22.1)


project("WfbngRtl8812")

include_directories(include)

add_library(${CMAKE_PROJECT_NAME} SHARED
devourer/hal/Hal8812PhyReg.h
devourer/hal/Hal8812PwrSeq.c
devourer/hal/Hal8812PwrSeq.h
devourer/hal/basic_types.h
devourer/hal/hal8812a_fw.c
devourer/hal/hal8812a_fw.h
devourer/hal/hal_com_reg.h
devourer/hal/rtl8812a_hal.h
devourer/hal/rtl8812a_recv.h
devourer/hal/rtl8812a_spec.h
add_library(wfb-ng STATIC
${CMAKE_SOURCE_DIR}/wfb-ng/src/fec.c
${CMAKE_SOURCE_DIR}/wfb-ng/src/fec.h
${CMAKE_SOURCE_DIR}/wfb-ng/src/ieee80211_radiotap.h
${CMAKE_SOURCE_DIR}/wfb-ng/src/radiotap.c
${CMAKE_SOURCE_DIR}/wfb-ng/src/rx.cpp
${CMAKE_SOURCE_DIR}/wfb-ng/src/rx.hpp
${CMAKE_SOURCE_DIR}/wfb-ng/src/wifibroadcast.hpp
${CMAKE_SOURCE_DIR}/wfb-ng/src/wifibroadcast.cpp)
set_target_properties(wfb-ng PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/wfb-ng)
target_include_directories(wfb-ng PUBLIC ${CMAKE_SOURCE_DIR}/wfb-ng)
target_compile_definitions(wfb-ng PRIVATE __WFB_RX_SHARED_LIBRARY__)

devourer/src/EepromManager.cpp
devourer/src/EepromManager.h
devourer/src/Firmware.h
devourer/src/FirmwareManager.cpp
devourer/src/FirmwareManager.h
devourer/src/FrameParser.cpp
devourer/src/FrameParser.h
devourer/src/HalModule.cpp
devourer/src/HalModule.h
devourer/src/ParsedRadioPacket.cpp
devourer/src/RadioManagementModule.cpp
devourer/src/RadioManagementModule.h
devourer/src/Rtl8812aDevice.cpp
devourer/src/Rtl8812aDevice.h
devourer/src/RtlUsbAdapter.cpp
devourer/src/RtlUsbAdapter.h
devourer/src/SelectedChannel.h
devourer/src/WiFiDriver.cpp
devourer/src/WiFiDriver.h
devourer/src/registry_priv.h
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/basic_types.h
${CMAKE_SOURCE_DIR}/devourer/hal/hal8812a_fw.c
${CMAKE_SOURCE_DIR}/devourer/hal/hal8812a_fw.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
${CMAKE_SOURCE_DIR}/devourer/hal/rtl8812a_spec.h

wfb-ng/src/fec.c
wfb-ng/src/fec.h
wfb-ng/src/ieee80211_radiotap.h
wfb-ng/src/radiotap.c
wfb-ng/src/rx.cpp
wfb-ng/src/rx.hpp
wfb-ng/src/wifibroadcast.hpp
wfb-ng/src/wifibroadcast.cpp
${CMAKE_SOURCE_DIR}/devourer/src/EepromManager.cpp
${CMAKE_SOURCE_DIR}/devourer/src/EepromManager.h
${CMAKE_SOURCE_DIR}/devourer/src/Firmware.h
${CMAKE_SOURCE_DIR}/devourer/src/FirmwareManager.cpp
${CMAKE_SOURCE_DIR}/devourer/src/FirmwareManager.h
${CMAKE_SOURCE_DIR}/devourer/src/FrameParser.cpp
${CMAKE_SOURCE_DIR}/devourer/src/FrameParser.h
${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/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/RtlUsbAdapter.cpp
${CMAKE_SOURCE_DIR}/devourer/src/RtlUsbAdapter.h
${CMAKE_SOURCE_DIR}/devourer/src/SelectedChannel.h
${CMAKE_SOURCE_DIR}/devourer/src/WiFiDriver.cpp
${CMAKE_SOURCE_DIR}/devourer/src/WiFiDriver.h
${CMAKE_SOURCE_DIR}/devourer/src/registry_priv.h)
set_target_properties(devourer PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/devourer)
target_include_directories(devourer PUBLIC ${CMAKE_SOURCE_DIR}/devourer)
target_include_directories(devourer PUBLIC ${CMAKE_SOURCE_DIR}/devourer/hal)
set_property(TARGET devourer PROPERTY CXX_STANDARD 20)

# WFB-NG RTL8812 library
add_library(${CMAKE_PROJECT_NAME} SHARED
RxFrame.h
RxFrame.cpp
WfbngLink.cpp)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE devourer/hal)

target_link_libraries(${CMAKE_PROJECT_NAME}
# List libraries link to the target library
devourer
wfb-ng
android
log
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libusb1.0.so
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libsodium.so
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libpcap.a )

${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libpcap.a )

#set(CMAKE_CXX_STANDARD 20)
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 20)
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -fno-omit-frame-pointer)
2 changes: 1 addition & 1 deletion app/wfbngrtl8812/src/main/cpp/wfb-ng

0 comments on commit c370b26

Please sign in to comment.