some other version
This commit is contained in:
@@ -43,7 +43,7 @@ void InputSocketHandler::run()
|
||||
std::string str = event.getJsonString();
|
||||
|
||||
auto size = str.size();
|
||||
str = std::to_string(size) + std::to_string(0x02) + str;
|
||||
str = std::to_string(size) + std::string(1, 0x02) + str;
|
||||
|
||||
this->socket().sendBytes(str.c_str(), str.size());
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(this->d_mutex);
|
||||
this->d_condition.wait(lock, [=]
|
||||
{ return !this->p_queue.empty(); });
|
||||
{ return !this->p_queue.empty(); });
|
||||
T rc = *this->p_queue.begin();
|
||||
this->p_queue.pop();
|
||||
return rc;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define FLIPPR_DRIVER_WIRINGPITESTING_H
|
||||
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
|
||||
#define INPUT 0
|
||||
#define OUTPUT 1
|
||||
@@ -23,8 +24,8 @@ void pinMode(int pin, int mode)
|
||||
|
||||
int digitalRead(int pin)
|
||||
{
|
||||
//std::cout << "Reading pin " << pin << std::endl;
|
||||
return 0;
|
||||
//std::cout << "Reading pin " << pin << std::endl
|
||||
return rand()%2 == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
void digitalWrite(int pin, int value)
|
||||
|
||||
Reference in New Issue
Block a user