temp
This commit is contained in:
parent
dd9d15f48c
commit
ec13c4d32b
@ -15,8 +15,8 @@ public:
|
|||||||
void disconnect(); // 断开连接
|
void disconnect(); // 断开连接
|
||||||
|
|
||||||
// 让外部可以访问最新的 gear 和 speed
|
// 让外部可以访问最新的 gear 和 speed
|
||||||
int getGear() const;
|
int getGear();
|
||||||
double getSpeed() const;
|
double getSpeed();
|
||||||
void checkTimeout(std::chrono::seconds timeout);
|
void checkTimeout(std::chrono::seconds timeout);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -128,13 +128,13 @@ void MqttClient::checkTimeout(std::chrono::seconds timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int MqttClient::getGear() const
|
int MqttClient::getGear()
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(dataMutex);
|
std::lock_guard<std::mutex> lock(dataMutex);
|
||||||
return gear;
|
return gear;
|
||||||
}
|
}
|
||||||
|
|
||||||
double MqttClient::getSpeed() const
|
double MqttClient::getSpeed()
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(dataMutex);
|
std::lock_guard<std::mutex> lock(dataMutex);
|
||||||
return speed;
|
return speed;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user