Merge remote-tracking branch 'remotes/origin/bugfix/58' into development
This commit is contained in:
commit
5e38a11db9
@ -63,7 +63,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
using std::enable_shared_from_this<AndroidAutoEntity>::shared_from_this;
|
using std::enable_shared_from_this<AndroidAutoEntity>::shared_from_this;
|
||||||
void triggerQuit();
|
void triggerQuit();
|
||||||
void ping();
|
void schedulePing();
|
||||||
|
void sendPing();
|
||||||
|
|
||||||
boost::asio::io_service::strand strand_;
|
boost::asio::io_service::strand strand_;
|
||||||
aasdk::messenger::ICryptor::Pointer cryptor_;
|
aasdk::messenger::ICryptor::Pointer cryptor_;
|
||||||
|
@ -65,7 +65,7 @@ void AndroidAutoEntity::start(IAndroidAutoEntityEventHandler& eventHandler)
|
|||||||
|
|
||||||
serviceList_ = serviceFactory_.create(messenger_);
|
serviceList_ = serviceFactory_.create(messenger_);
|
||||||
std::for_each(serviceList_.begin(), serviceList_.end(), std::bind(&IService::start, std::placeholders::_1));
|
std::for_each(serviceList_.begin(), serviceList_.end(), std::bind(&IService::start, std::placeholders::_1));
|
||||||
this->ping();
|
this->schedulePing();
|
||||||
|
|
||||||
auto versionRequestPromise = aasdk::channel::SendPromise::defer(strand_);
|
auto versionRequestPromise = aasdk::channel::SendPromise::defer(strand_);
|
||||||
versionRequestPromise->then([]() {}, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(), std::placeholders::_1));
|
versionRequestPromise->then([]() {}, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(), std::placeholders::_1));
|
||||||
@ -253,16 +253,12 @@ void AndroidAutoEntity::triggerQuit()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidAutoEntity::ping()
|
void AndroidAutoEntity::schedulePing()
|
||||||
{
|
{
|
||||||
auto promise = IPinger::Promise::defer(strand_);
|
auto promise = IPinger::Promise::defer(strand_);
|
||||||
promise->then([this, self = this->shared_from_this()]() {
|
promise->then([this, self = this->shared_from_this()]() {
|
||||||
auto promise = aasdk::channel::SendPromise::defer(strand_);
|
this->sendPing();
|
||||||
promise->then([]() {}, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(), std::placeholders::_1));
|
this->schedulePing();
|
||||||
|
|
||||||
aasdk::proto::messages::PingRequest request;
|
|
||||||
controlServiceChannel_->sendPingRequest(request, std::move(promise));
|
|
||||||
this->ping();
|
|
||||||
},
|
},
|
||||||
[this, self = this->shared_from_this()](auto error) {
|
[this, self = this->shared_from_this()](auto error) {
|
||||||
if(error != aasdk::error::ErrorCode::OPERATION_ABORTED &&
|
if(error != aasdk::error::ErrorCode::OPERATION_ABORTED &&
|
||||||
@ -276,6 +272,15 @@ void AndroidAutoEntity::ping()
|
|||||||
pinger_->ping(std::move(promise));
|
pinger_->ping(std::move(promise));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AndroidAutoEntity::sendPing()
|
||||||
|
{
|
||||||
|
auto promise = aasdk::channel::SendPromise::defer(strand_);
|
||||||
|
promise->then([]() {}, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(), std::placeholders::_1));
|
||||||
|
|
||||||
|
aasdk::proto::messages::PingRequest request;
|
||||||
|
controlServiceChannel_->sendPingRequest(request, std::move(promise));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user