diff --git a/Development/nmos/control_protocol_methods.cpp b/Development/nmos/control_protocol_methods.cpp index d67842cad..598d73016 100644 --- a/Development/nmos/control_protocol_methods.cpp +++ b/Development/nmos/control_protocol_methods.cpp @@ -60,12 +60,13 @@ namespace nmos return make_control_protocol_message_response(handle, { nc_method_status::parameter_error }); } - const auto notification = make_control_protocol_notification(nmos::fields::nc::oid(resource->data), nc_object_property_changed_event_id, { parse_nc_property_id(property_id), nc_property_change_type::type::value_changed, val }); + const nc_property_changed_event_data property_changed_event_data{ parse_nc_property_id(property_id), nc_property_change_type::type::value_changed, val }; + const auto notification = make_control_protocol_notification(nmos::fields::nc::oid(resource->data), nc_object_property_changed_event_id, property_changed_event_data); const auto notification_event = make_control_protocol_notification(web::json::value_of({ notification })); modify_resource(resources, resource->id, [&](nmos::resource& resource) { - resource.data[nmos::fields::nc::name(property)] = val; + resource.data[nmos::fields::nc::name(property)] = property_changed_event_data.value; }, notification_event); @@ -146,12 +147,13 @@ namespace nmos if (data.as_array().size() > (size_t)index) { - const auto notification = make_control_protocol_notification(nmos::fields::nc::oid(resource->data), nc_object_property_changed_event_id, { parse_nc_property_id(property_id), nc_property_change_type::type::sequence_item_changed, val, nc_id(index) }); + const nc_property_changed_event_data property_changed_event_data{ parse_nc_property_id(property_id), nc_property_change_type::type::sequence_item_changed, val, nc_id(index) }; + const auto notification = make_control_protocol_notification(nmos::fields::nc::oid(resource->data), nc_object_property_changed_event_id, property_changed_event_data); const auto notification_event = make_control_protocol_notification(web::json::value_of({ notification })); modify_resource(resources, resource->id, [&](nmos::resource& resource) { - resource.data[nmos::fields::nc::name(property)][index] = val; + resource.data[nmos::fields::nc::name(property)][index] = property_changed_event_data.value; }, notification_event); @@ -197,14 +199,15 @@ namespace nmos auto& data = resource->data.at(nmos::fields::nc::name(property)); const nc_id sequence_item_index = data.is_null() ? 0 : nc_id(data.as_array().size()); - const auto notification = make_control_protocol_notification(nmos::fields::nc::oid(resource->data), nc_object_property_changed_event_id, { parse_nc_property_id(property_id), nc_property_change_type::type::sequence_item_added, val, sequence_item_index }); + const nc_property_changed_event_data property_changed_event_data{ parse_nc_property_id(property_id), nc_property_change_type::type::sequence_item_added, val, sequence_item_index }; + const auto notification = make_control_protocol_notification(nmos::fields::nc::oid(resource->data), nc_object_property_changed_event_id, property_changed_event_data); const auto notification_event = make_control_protocol_notification(web::json::value_of({ notification })); modify_resource(resources, resource->id, [&](nmos::resource& resource) { auto& sequence = resource.data[nmos::fields::nc::name(property)]; if (data.is_null()) { sequence = value::array(); } - web::json::push_back(sequence, val); + web::json::push_back(sequence, property_changed_event_data.value); }, notification_event); @@ -243,7 +246,8 @@ namespace nmos if (data.as_array().size() > (size_t)index) { - const auto notification = make_control_protocol_notification(nmos::fields::nc::oid(resource->data), nc_object_property_changed_event_id, { parse_nc_property_id(property_id), nc_property_change_type::type::sequence_item_removed, data.as_array().at(index), nc_id(index)}); + const nc_property_changed_event_data property_changed_event_data{ parse_nc_property_id(property_id), nc_property_change_type::type::sequence_item_removed, data.as_array().at(index), nc_id(index) }; + const auto notification = make_control_protocol_notification(nmos::fields::nc::oid(resource->data), nc_object_property_changed_event_id, property_changed_event_data); const auto notification_event = make_control_protocol_notification(web::json::value_of({ notification })); modify_resource(resources, resource->id, [&](nmos::resource& resource)