mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
Add external libraries
This commit is contained in:
parent
70f443b06e
commit
e8dc11cc31
17 changed files with 2010 additions and 0 deletions
51
third_party/open-bp-cpp/example/buttplugCpp.cpp
vendored
Normal file
51
third_party/open-bp-cpp/example/buttplugCpp.cpp
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
// buttplugCpp.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "buttplugCpp.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
void callbackFunction(const mhl::Messages msg) {
|
||||
if (msg.messageType == mhl::MessageTypes::DeviceList) {
|
||||
cout << "Device List callback" << endl;
|
||||
}
|
||||
if (msg.messageType == mhl::MessageTypes::DeviceAdded) {
|
||||
cout << "Device Added callback" << endl;
|
||||
}
|
||||
if (msg.messageType == mhl::MessageTypes::ServerInfo) {
|
||||
cout << "Server Info callback" << endl;
|
||||
}
|
||||
if (msg.messageType == mhl::MessageTypes::DeviceRemoved) {
|
||||
cout << "Device Removed callback" << endl;
|
||||
}
|
||||
if (msg.messageType == mhl::MessageTypes::SensorReading) {
|
||||
cout << "Sensor Reading callback" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string url = "ws://127.0.0.1";
|
||||
std::cout << "\n";
|
||||
Client client(url, 12345, "test.txt");
|
||||
client.connect(callbackFunction);
|
||||
client.requestDeviceList();
|
||||
client.startScan();
|
||||
while (1) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||
client.stopScan();
|
||||
break;
|
||||
}
|
||||
//std::vector<DeviceClass> myDevices = client.getDevices();
|
||||
//client.sendScalar(myDevices[0], 0.5);
|
||||
//client.sendScalar(myDevices[1], 0.5);
|
||||
//client.sensorSubscribe(myDevices[0], 0);
|
||||
//std::this_thread::sleep_for(std::chrono::milliseconds(20000));
|
||||
//client.sensorUnsubscribe(myDevices[0], 0);
|
||||
//client.stopAllDevices();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
9
third_party/open-bp-cpp/example/buttplugCpp.h
vendored
Normal file
9
third_party/open-bp-cpp/example/buttplugCpp.h
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
// buttplugCpp.h : Include file for standard system include files,
|
||||
// or project specific include files.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include "../include/buttplugclient.h"
|
||||
|
||||
// TODO: Reference additional headers your program requires here.
|
Loading…
Add table
Add a link
Reference in a new issue