Skip to content

Commit 198b197

Browse files
committed
Update Receiver-Monitor connection activation example
1 parent bc05492 commit 198b197

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Development/nmos/control_protocol_handlers.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,24 @@ namespace nmos
7777
auto found = find_control_protocol_resource(resources, nmos::types::nc_receiver_monitor, connection_resource.id);
7878
if (resources.end() != found && nc_receiver_monitor_class_id == details::parse_nc_class_id(nmos::fields::nc::class_id(found->data)))
7979
{
80-
// update receiver-monitor's connectionStatus propertry
80+
// update receiver-monitor's connectionStatus and payloadStatus propertries
8181

8282
const auto active = nmos::fields::master_enable(nmos::fields::endpoint_active(connection_resource.data));
83-
const web::json::value value = active ? nc_connection_status::connected : nc_connection_status::disconnected;
83+
const web::json::value connection_status = active ? nc_connection_status::connected : nc_connection_status::disconnected;
84+
const web::json::value payload_status = active ? nc_payload_status::payload_ok : nc_payload_status::undefined;
8485

85-
// hmm, maybe updating connectionStatusMessage, payloadStatus, and payloadStatusMessage too
86+
// hmm, maybe updating connectionStatusMessage and payloadStatusMessage too
8687

8788
const auto property_changed_event = make_property_changed_event(nmos::fields::nc::oid(found->data),
8889
{
89-
{ nc_receiver_monitor_connection_status_property_id, nc_property_change_type::type::value_changed, value }
90+
{ nc_receiver_monitor_connection_status_property_id, nc_property_change_type::type::value_changed, connection_status },
91+
{ nc_receiver_monitor_payload_status_property_id, nc_property_change_type::type::value_changed, payload_status }
9092
});
9193

9294
modify_control_protocol_resource(resources, found->id, [&](nmos::resource& resource)
9395
{
94-
resource.data[nmos::fields::nc::connection_status] = value;
96+
resource.data[nmos::fields::nc::connection_status] = connection_status;
97+
resource.data[nmos::fields::nc::payload_status] = payload_status;
9598

9699
}, property_changed_event);
97100
}

0 commit comments

Comments
 (0)