in sample_app/onvif_camera_mock/artifacts/onvif_srvd/src/ServicePTZ.cpp [245:279]
int PTZBindingService::GotoHomePosition(_tptz__GotoHomePosition *tptz__GotoHomePosition, _tptz__GotoHomePositionResponse &tptz__GotoHomePositionResponse)
{
UNUSED(tptz__GotoHomePosition);
UNUSED(tptz__GotoHomePositionResponse);
DEBUG_MSG("PTZ: %s\n", __FUNCTION__);
std::string preset_cmd;
ServiceContext* ctx = (ServiceContext*)this->soap->user;
if (tptz__GotoHomePosition == NULL) {
return SOAP_OK;
}
if (tptz__GotoHomePosition->ProfileToken.c_str() == NULL) {
return SOAP_OK;
}
if (!ctx->get_ptz_node()->get_move_preset().empty()) {
preset_cmd = ctx->get_ptz_node()->get_move_preset().c_str();
} else {
return SOAP_OK;
}
std::string template_str_t("%t");
auto it_t = preset_cmd.find(template_str_t, 0);
if( it_t != std::string::npos ) {
preset_cmd.replace(it_t, template_str_t.size(), "1");
}
system(preset_cmd.c_str());
return SOAP_OK;
}