Skip to content

Commit

Permalink
Merge pull request #199 from rerdavies/BufferSizeExperiment
Browse files Browse the repository at this point in the history
PiPedal v1.2.51 Release
  • Loading branch information
rerdavies authored Sep 21, 2024
2 parents a753061 + 419f510 commit 3fa51db
Show file tree
Hide file tree
Showing 132 changed files with 9,947 additions and 1,618 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build/

#VS Code config files.
.vscode/
# .vscode/ Sort this out later. .gitignore-ing an already tracked file doesn't actually work.
#settings

Testing/
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
url = https://github.com/rerdavies/pipedal_p2pd
[submodule "modules/websocketpp"]
path = modules/websocketpp
url = https://github.com/zaphoyd/websocketpp.git
url = https://github.com/rerdavies/websocketpp.git
branch = develop
68 changes: 65 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,33 @@
"version": "0.2.0",
"configurations": [

{
"name": "Attach to Edge",
"port": 9222,
"request": "attach",
"type": "msedge",
"webRoot": "${workspaceFolder}"
},
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "enter program name, for example ${workspaceFolder}/a.out",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},




Expand Down Expand Up @@ -40,6 +67,32 @@
}
]
},
{
"name": "(gdb) makeRelease",
"type": "cppdbg",
"request": "launch",
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
"args": [ ],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/../..",
"environment": [
{
"name": "PATH",
"value": "$PATH:${command:cmake.launchTargetDirectory}"
}
],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},

{
"name": "(gdb) pipedal_nm_p2pd",
"type": "cppdbg",
Expand Down Expand Up @@ -96,7 +149,13 @@
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Add alsa source directories.",
"text": "directory $cd:$cwd:/usr/src/alsa-lib-1.2.8",
"ignoreFailures": true
}

]
},

Expand Down Expand Up @@ -179,7 +238,7 @@
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",

"args": [ "Nam_Profile", "--no-profile","-w" ],
"args": [ "ToobNam_Profile", "--no-profile","-w" ],

"stopAtEntry": false,
"cwd": "${workspaceFolder}",
Expand Down Expand Up @@ -289,10 +348,13 @@
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
"args": [
"--prefix",
"/usr/sbin",
"--nosudo", // run without sudo (which will fail because of perms, but allow us to debug deeper into install code.)
"--prefix", "/usr",
//"--get-current-port"
"--install"

//"--get-current-port"
//"--install"
//"--enable-p2p" , "CA", "PiPedalTest","12345678","14"
//"--list-p2p-channels"
],
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
"nm-device-wifi-p2p.h": "c",
"strstream": "cpp",
"p2p_i.h": "c",
"p2p.h": "c"
"p2p.h": "c",
"hash_set": "cpp"
},
"cSpell.words": [
"Guitarix",
Expand Down
36 changes: 22 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
cmake_minimum_required(VERSION 3.16.0)
project(pipedal
VERSION 1.2.47
VERSION 1.2.51
DESCRIPTION "PiPedal Guitar Effect Pedal For Raspberry Pi"
HOMEPAGE_URL "https://rerdavies.github.io/pipedal"
)
set (DISPLAY_VERSION "PiPedal v1.2.47-Release")
set (DISPLAY_VERSION "PiPedal v1.2.51-Release")
set (PACKAGE_ARCHITECTURE "arm64")
set (CMAKE_INSTALL_PREFIX "/usr/")

include(CTest)
enable_testing()

add_subdirectory("submodules/pipedal_p2pd")
#add_subdirectory("submodules/pipedal_p2pd")

add_subdirectory("PiPedalCommon")

add_subdirectory("react")

add_subdirectory("src")

add_subdirectory("NetworkManagerP2P")
# Replaced with hotspot.
#add_subdirectory("NetworkManagerP2P")

# install (TARGETS pipedal_p2pd DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin
# )

install (TARGETS pipedal_p2pd DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin
)

install (TARGETS pipedal_nm_p2pd DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin
)
# install (TARGETS pipedal_nm_p2pd DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin
# )

# select LV2 source directory for the current build architecture

Expand All @@ -50,6 +50,13 @@ install(
install(
FILES ${PROJECT_SOURCE_DIR}/debian/copyright DESTINATION /usr/share/doc/pipedal
)
#install (
# DIRECTORY ${PROJECT_SOURCE_DIR}/src/polkit-1/rules/10-pipedal-networkmanager.rule DESTINATION /var/lib/polkit-1/localauthority/
#)

install (
FILES ${PROJECT_SOURCE_DIR}/src/polkit-1/rules/10-pipedal-networkmanager.rules DESTINATION /etc/polkit-1/rules.d/
)
install (
DIRECTORY ${REACT_BUILD_DIRECTORY} DESTINATION /etc/pipedal/react
)
Expand All @@ -75,30 +82,31 @@ install(CODE
EXECUTABLES
${CMAKE_INSTALL_PREFIX}/sbin/pipedaladmind
${CMAKE_INSTALL_PREFIX}/sbin/pipedald
${CMAKE_INSTALL_PREFIX}/sbin/pipedal_nm_p2pd
${CMAKE_INSTALL_PREFIX}/sbin/pipedal_p2pd
${CMAKE_INSTALL_PREFIX}/sbin/pipedal_update
#${CMAKE_INSTALL_PREFIX}/sbin/pipedal_nm_p2pd
#${CMAKE_INSTALL_PREFIX}/sbin/pipedal_p2pd
${CMAKE_INSTALL_PREFIX}/bin/pipedalconfig
)
]]
)


set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Robin Davies<rerdavies@gmail.com>") # required
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Robin E. R. Davies<rerdavies@gmail.com>") # required
set(CPACK_PACKAGE_VENDOR "Robin Davies")
set(CPACK_PACKAGE_DESCRIPTION "IoT guitar effect pedal for Raspberry Pi, with phone-friendly web interface.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IoT guitar effect pedal for Raspberry Pi")
set(CPACK_DEBIAN_PACKAGE_SECTION sound)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
#set(CPACK_DEBIAN_PACKAGE_DEPENDS "jackd2, hostapd, dhcpcd, dnsmasq" )
set(CPACK_DEBIAN_PACKAGE_DEPENDS "lv2-dev, hostapd, dhcpcd,dnsmasq, authbind, gpg" )
set(CPACK_DEBIAN_PACKAGE_DEPENDS "lv2-dev, authbind, gpg" )
#set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
set(CPACK_PACKAGING_INSTALL_PREFIX /usr)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set (CPACK_STRIP_FILES ON)
set (CPACK_STRIP_FILES true)

set(CPACK_DEBIAN_PACKAGE_SIGN_ALGORITHM "detached")
set(CPACK_DEBIAN_PACKAGE_SIGN_TYPE "origin")
Expand Down
5 changes: 5 additions & 0 deletions NetworkManagerP2P/src/DBusLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ void LogTrace(const std::string&path,const char*method,const std::string&message
}
}

void SetDBusLogger(std::unique_ptr<IDBusLogger> && logger)
{
loggers.clear();
loggers.push_back(std::move(logger));
}

void SetDBusConsoleLogger()
{
Expand Down
1 change: 1 addition & 0 deletions NetworkManagerP2P/src/DBusLog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void SetDBusConsoleLogger();
void AddDBusConsoleLogger();
void SetDBusSystemdLogger();
void SetDBusFileLogger(const std::filesystem::path &path);
void SetDBusLogger(std::unique_ptr<IDBusLogger>&&logger);

extern void LogError(const std::string&path,const char*method,const std::string&message);
extern void LogInfo(const std::string&path,const char*method,const std::string&message);
Expand Down
32 changes: 19 additions & 13 deletions NetworkManagerP2P/src/NMP2pSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,27 +193,33 @@ void P2pSettings::Load()

}

static void openWithPerms(
static void openWithRestrictedPerms(
pipedal::ofstream_synced &f,
const std::filesystem::path &path,
std::filesystem::perms perms =
std::filesystem::perms::owner_read | std::filesystem::perms::owner_write |
std::filesystem::perms::group_read | std::filesystem::perms::group_write)
{
auto directory = path.parent_path();
std::filesystem::create_directories(directory);
// open and close to make an existing empty file.
// close it.
if (!std::filesystem::exists(directory))
{
std::ofstream f;
f.open(path);
f.close();
std::filesystem::create_directories(directory);
// open and close to make an existing empty file.
// close it.
{
std::ofstream f;
f.open(path);
f.close();
}
try {
// set the perms.
std::filesystem::permissions(
path,
perms,
std::filesystem::perm_options::replace);
} catch (const std::exception&) {
}
}
// set the perms.
std::filesystem::permissions(
path,
perms,
std::filesystem::perm_options::replace);

// open for re3al.
f.open(path);
Expand All @@ -223,7 +229,7 @@ void P2pSettings::Save()
auto filename = config_filename();
try {
pipedal::ofstream_synced f;
openWithPerms(f,filename);
openWithRestrictedPerms(f,filename);

if (!f.is_open())
{
Expand Down
30 changes: 29 additions & 1 deletion PiPedalCommon/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,34 @@ message(STATUS "NMPIPEDAL CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")

# Use the sdbus-c++ target in SDBusCpp namespace
add_library(PiPedalCommon STATIC
include/dbus/org.freedesktop.NetworkManager.Device.Statistics.hpp
include/dbus/org.freedesktop.NetworkManager.Settings.Connection.hpp
include/dbus/org.freedesktop.NetworkManager.IP6Config.hpp
include/dbus/org.freedesktop.NetworkManager.Connection.Active.hpp
include/dbus/org.freedesktop.NetworkManager.DnsManager.hpp
include/dbus/org.freedesktop.NetworkManager.IP4Config.hpp
include/dbus/org.freedesktop.NetworkManager.Settings.hpp
include/dbus/org.freedesktop.NetworkManager.Device.hpp
include/dbus/org.freedesktop.NetworkManager.DHCP6Config.hpp
include/dbus/org.freedesktop.NetworkManager.AccessPoint.hpp
include/dbus/org.freedesktop.NetworkManager.Device.WifiP2P.hpp
include/dbus/org.freedesktop.NetworkManager.WifiP2PPeer.hpp
include/dbus/org.freedesktop.NetworkManager.hpp
include/dbus/org.freedesktop.NetworkManager.Device.Wireless.hpp
include/dbus/org.freedesktop.NetworkManager.DHCP4Config.hpp

NetworkManagerInterfaces.cpp
include/NetworkManagerInterfaces.hpp
Lv2Log.cpp include/Lv2Log.hpp
DBusEvent.cpp
DBusVariantHelper.cpp
DBusLog.cpp
DBusDispatcher.cpp
include/DBusDispatcher.hpp
include/DBusEvent.hpp
include/DBusLog.hpp
include/DBusVariantHelper.hpp

ofstream_synced.cpp include/ofstream_synced.hpp
ConfigSerializer.cpp include/ConfigSerializer.hpp
WifiRegs.cpp include/WifiRegs.hpp
Expand All @@ -66,7 +94,7 @@ add_library(PiPedalCommon STATIC
ss.hpp
)
target_include_directories(PiPedalCommon PUBLIC "include" ${LIBNL3_INCLUDE_DIRS})
target_link_libraries(PiPedalCommon PUBLIC ${LIBNL3_LIBRARIES} )
target_link_libraries(PiPedalCommon PUBLIC ${LIBNL3_LIBRARIES} SDBusCpp::sdbus-c++ )



4 changes: 2 additions & 2 deletions PiPedalCommon/src/ChannelInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ static std::vector<OpClassChannels> opClasses = {
* care of removing invalid channels.
*/

// WiFi 5.
// Wi-Fi 5.
// {WifiMode::IEEE80211A, 128, 36, 177, 4, WifiBandwidth::BW80, true},
// {WifiMode::IEEE80211A, 129, 36, 177, 4, WifiBandwidth::BW160, true},
// {WifiMode::IEEE80211A, 130, 36, 177, 4, WifiBandwidth::BW80P80, true},

// WiFi 6.
// Wi-Fi 6.
// {WifiMode::IEEE80211AX, 131, 1, 233, 4, WifiBandwidth::BW20, true},
// {WifiMode::IEEE80211AX, 132, 1, 233, 8, WifiBandwidth::BW40PLUS, true},
// {WifiMode::IEEE80211AX, 133, 1, 233, 16, WifiBandwidth::BW80, true},
Expand Down
Loading

0 comments on commit 3fa51db

Please sign in to comment.