::grpc::Status ClickElementCommand::execute()
{
ObjectMapper* mObjMap = ObjectMapper::getInstance();
- UiObject* obj = mObjMap->getElement(mRequest->elementid());
+ std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
+ LOG_SCOPE_F(INFO, "ClickElementCommand execute %p", obj);
if (obj) {
obj->click();
::grpc::Status ClickCoordCommand::execute()
{
- UiDevice* obj = UiDevice::getInstance(DeviceType::DEFAULT);
+ std::shared_ptr<UiDevice> obj = UiDevice::getInstance();
const ::aurum::Point& point = mRequest->coordination();
+ LOG_SCOPE_F(INFO, "ClickCoordCommand execute %p @ (%d, %d)", obj.get(), point.x(), point.y());
obj->click(point.x(), point.y());
mResponse->set_status(::aurum::RspStatus::OK);
return grpc::Status::OK;
::grpc::Status ClickAtspiCommand::execute()
{
- return grpc::Status::CANCELLED;
+ ObjectMapper* mObjMap = ObjectMapper::getInstance();
+ std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
+
+ LOG_SCOPE_F(INFO, "ClickAtspiCommand execute %p", obj);
+
+ if (obj) {
+ if (obj->DoAtspiActivate()) mResponse->set_status(::aurum::RspStatus::OK);
+ else mResponse->set_status(::aurum::RspStatus::ERROR);
+ } else {
+ mResponse->set_status(::aurum::RspStatus::ERROR);
+ }
+
+ return grpc::Status::OK;
}