From fe9abb96a127dfc6aaf11c44c6b62b8e9c9ba184 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 11 Jan 2024 17:17:25 -0500 Subject: [PATCH] Revert "Remove unknown as a state, as string lookup has to start at 0 and this breaks api." This reverts commit e0a90319e7c5bc5de3fc572e6a7ad98a279bc55f. --- src/zm_monitor.cpp | 5 +++-- src/zm_monitor.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 697452980..0c4105201 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -114,6 +114,7 @@ std::string CameraType_Strings[] = { }; std::string State_Strings[] = { + "Unknown", "IDLE", "PREALARM", "ALARM", @@ -3428,7 +3429,6 @@ int Monitor::Play() { } return 1; } - int Monitor::Close() { Pause(); @@ -3448,7 +3448,8 @@ int Monitor::Close() { _wsnt__Unsubscribe wsnt__Unsubscribe; _wsnt__UnsubscribeResponse wsnt__UnsubscribeResponse; const char *RequestMessageID = soap_wsa_rand_uuid(soap); - if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "UnsubscribeRequest") == SOAP_OK) { + if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "UnsubscribeRequest") == SOAP_OK) + { proxyEvent.Unsubscribe(response.SubscriptionReference.Address, NULL, &wsnt__Unsubscribe, wsnt__UnsubscribeResponse); } else { Error("Couldn't set wsa headers RequestMessageID=%s; TO= %s; Request=UnsubscribeRequest .... ! Error %i %s, %s", diff --git a/src/zm_monitor.h b/src/zm_monitor.h index 8934451a6..d6626c443 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -154,6 +154,7 @@ public: } Deinterlace; typedef enum { + UNKNOWN = -1, IDLE, PREALARM, ALARM,