mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-18 03:31:31 +12:00
PoC
This commit is contained in:
parent
e6d62217a3
commit
0bdc7f6882
3 changed files with 39 additions and 0 deletions
|
@ -271,6 +271,10 @@ if(ENABLE_LUAJIT AND NOT ANDROID)
|
||||||
|
|
||||||
add_subdirectory(third_party/libuv)
|
add_subdirectory(third_party/libuv)
|
||||||
target_link_libraries(AlberCore PRIVATE uv_a)
|
target_link_libraries(AlberCore PRIVATE uv_a)
|
||||||
|
|
||||||
|
include_directories(third_party/open-bp-cpp/include)
|
||||||
|
add_subdirectory(third_party/open-bp-cpp)
|
||||||
|
target_link_libraries(AlberCore PRIVATE buttplugCpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_QT_GUI)
|
if(ENABLE_QT_GUI)
|
||||||
|
|
|
@ -1,7 +1,41 @@
|
||||||
#include "panda_sdl/frontend_sdl.hpp"
|
#include "panda_sdl/frontend_sdl.hpp"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <chrono>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <thread>
|
||||||
|
#include "buttplugclient.h"
|
||||||
|
|
||||||
|
void callbackFunction(const mhl::Messages msg) {
|
||||||
|
switch (msg.messageType) {
|
||||||
|
case mhl::MessageTypes::DeviceList: printf("Device List callback\n"); break;
|
||||||
|
case mhl::MessageTypes::DeviceAdded: printf("Device List callback\n"); break;
|
||||||
|
case mhl::MessageTypes::ServerInfo: printf("Server info callback\n"); break;
|
||||||
|
case mhl::MessageTypes::DeviceRemoved: printf("Device Removed callback\n"); break;
|
||||||
|
case mhl::MessageTypes::SensorReading: printf("Sensor reading callback\n"); break;
|
||||||
|
default: printf("Unknown message")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
FrontendSDL app;
|
FrontendSDL app;
|
||||||
|
std::string url = "ws://127.0.0.1";
|
||||||
|
Client client(url, 12345, "test.txt");
|
||||||
|
client.connect(callbackFunction);
|
||||||
|
client.requestDeviceList();
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
client.startScan();
|
||||||
|
|
||||||
|
std::vector<DeviceClass> myDevices = client.getDevices();
|
||||||
|
if (myDevices.size() > 0) {
|
||||||
|
client.sendScalar(myDevices[0], 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||||
|
client.stopScan();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
auto romPath = std::filesystem::current_path() / argv[1];
|
auto romPath = std::filesystem::current_path() / argv[1];
|
||||||
|
|
1
third_party/open-bp-cpp/CMakeLists.txt
vendored
1
third_party/open-bp-cpp/CMakeLists.txt
vendored
|
@ -22,6 +22,7 @@ file(GLOB SRC_FILES
|
||||||
add_library(buttplugCpp STATIC ${SRC_FILES})
|
add_library(buttplugCpp STATIC ${SRC_FILES})
|
||||||
|
|
||||||
set(USE_ZLIB FALSE)
|
set(USE_ZLIB FALSE)
|
||||||
|
target_include_directories(buttplugCpp PUBLIC third_party/IXWebSocket/ixwebsocket)
|
||||||
add_subdirectory(third_party/IXWebSocket)
|
add_subdirectory(third_party/IXWebSocket)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue