Skip to content

Commit

Permalink
Merge branch 'fbu31-foscam'
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Jan 1, 2022
2 parents 7fb589b + 04719be commit 54f3dfd
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/bin/calaos_server/IPCam/Foscam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ Foscam::Foscam(Params &p):
{
ioDoc->descriptionBaseSet(_("Foscam IP Camera/Encoder. Camera can be viewed directly inside calaos and used in rules."));
ioDoc->paramAdd("ptz", _("Set to true if camera has PTZ support"), IODoc::TYPE_BOOL, false, "false");
ioDoc->paramAdd("zoom_step", "", IODoc::TYPE_STRING, false,"1");
ioDoc->paramAdd("username", _("Username for accessing the camera"), IODoc::TYPE_STRING, true);
ioDoc->paramAdd("password", _("Password for user"), IODoc::TYPE_STRING, true);
ioDoc->paramAdd("host", _("IP Address"), IODoc::TYPE_STRING, true);
ioDoc->paramAdd("port", _("Port number"), IODoc::TYPE_STRING, true,"88");

if (param["ptz"] == "1" || param["ptz"] == "true")
caps.Add("ptz", "true");

}

std::string Foscam::getVideoUrl()
Expand Down Expand Up @@ -95,12 +101,16 @@ void Foscam::activateCapabilities(std::string cap, std::string cmd, std::string
urlStop = "http://" + param["host"] + ":" + param["port"];
urlStop += "/cgi-bin/CGIProxy.fcgi";
if (valcmd.compare(0, 4, "zoom") == 0)
urlStop += "?cmd=zoomstop" ;
urlStop += "?cmd=zoomStop" ;
else
urlStop += "?cmd=ptzStopRun";
urlStop += "&usr=" + param["username"] + "&pwd=" + param["password"];

Timer::singleShot(0.500, [=]()

//Commande d'arrêt du mouvement pour simuler du pas à pas
int zstep = 0;
Utils::from_string(param["zoom_step"], zstep);
float moveDelay = 0.100 * (1 + zstep);
Timer::singleShot(moveDelay, [=]()
{
UrlDownloader::get(urlStop);
});
Expand Down

0 comments on commit 54f3dfd

Please sign in to comment.