in sample_app/onvif_camera_mock/artifacts/onvif_srvd/src/ServicePTZ.cpp [322:360]
int PTZBindingService::RelativeMove(_tptz__RelativeMove *tptz__RelativeMove, _tptz__RelativeMoveResponse &tptz__RelativeMoveResponse)
{
UNUSED(tptz__RelativeMoveResponse);
DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
ServiceContext* ctx = (ServiceContext*)this->soap->user;
if (tptz__RelativeMove == NULL) {
return SOAP_OK;
}
if (tptz__RelativeMove->Translation == NULL) {
return SOAP_OK;
}
if (tptz__RelativeMove->Translation->PanTilt == NULL) {
return SOAP_OK;
}
if (tptz__RelativeMove->Translation->PanTilt->x > 0) {
system(ctx->get_ptz_node()->get_move_right().c_str());
usleep(300000);
system(ctx->get_ptz_node()->get_move_stop().c_str());
} else if (tptz__RelativeMove->Translation->PanTilt->x < 0) {
system(ctx->get_ptz_node()->get_move_left().c_str());
usleep(300000);
system(ctx->get_ptz_node()->get_move_stop().c_str());
}
if (tptz__RelativeMove->Translation->PanTilt->y > 0) {
system(ctx->get_ptz_node()->get_move_up().c_str());
usleep(300000);
system(ctx->get_ptz_node()->get_move_stop().c_str());
} else if (tptz__RelativeMove->Translation->PanTilt->y < 0) {
system(ctx->get_ptz_node()->get_move_down().c_str());
usleep(300000);
system(ctx->get_ptz_node()->get_move_stop().c_str());
}
return SOAP_OK;
}