Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: jonathan-r-thorpe <[email protected]>
  • Loading branch information
lo-simon and jonathan-r-thorpe authored Feb 27, 2024
1 parent 9406d81 commit 8794dd4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Development/nmos-cpp-node/node_implementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ void node_implementation_run(nmos::node_model& model, slog::base_gate& gate)

if (resources.end() != found)
{
const auto propertry_changed_event = nmos::make_propertry_changed_event(nmos::fields::nc::oid(found->data),
const auto property_changed_event = nmos::make_property_changed_event(nmos::fields::nc::oid(found->data),
{
{ {3, 1}, nmos::nc_property_change_type::type::value_changed, web::json::value(temp.scaled_value()) }
});
Expand All @@ -1374,7 +1374,7 @@ void node_implementation_run(nmos::node_model& model, slog::base_gate& gate)
{
resource.data[temperature] = temp.scaled_value();

}, propertry_changed_event);
}, property_changed_event);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Development/nmos/control_protocol_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace nmos

// hmm, maybe updating connectionStatusMessage, payloadStatus, and payloadStatusMessage too

const auto propertry_changed_event = make_propertry_changed_event(nmos::fields::nc::oid(found->data),
const auto property_changed_event = make_property_changed_event(nmos::fields::nc::oid(found->data),
{
{ nc_receiver_monitor_connection_status_property_id, nc_property_change_type::type::value_changed, value }
});
Expand Down
8 changes: 4 additions & 4 deletions Development/nmos/control_protocol_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace nmos
property_changed(resource, nmos::fields::nc::name(property), -1);
}

}, make_propertry_changed_event(nmos::fields::nc::oid(resource.data), { { property_id_, nc_property_change_type::type::value_changed, val } }));
}, make_property_changed_event(nmos::fields::nc::oid(resource.data), { { property_id_, nc_property_change_type::type::value_changed, val } }));

return make_control_protocol_message_response(handle, { is_deprecated ? nmos::nc_method_status::method_deprecated : nmos::fields::nc::is_deprecated(property) ? nc_method_status::property_deprecated : nc_method_status::ok });
}
Expand Down Expand Up @@ -184,7 +184,7 @@ namespace nmos
property_changed(resource, nmos::fields::nc::name(property), index);
}

}, make_propertry_changed_event(nmos::fields::nc::oid(resource.data), { { property_id_, nc_property_change_type::type::sequence_item_changed, val, nc_id(index) } }));
}, make_property_changed_event(nmos::fields::nc::oid(resource.data), { { property_id_, nc_property_change_type::type::sequence_item_changed, val, nc_id(index) } }));

return make_control_protocol_message_response(handle, { is_deprecated ? nmos::nc_method_status::method_deprecated : nmos::fields::nc::is_deprecated(property) ? nc_method_status::property_deprecated : nc_method_status::ok });
}
Expand Down Expand Up @@ -260,7 +260,7 @@ namespace nmos
property_changed(resource, nmos::fields::nc::name(property), (int)sequence.as_array().size()-1);
}

}, make_propertry_changed_event(nmos::fields::nc::oid(resource.data), { { property_id_, nc_property_change_type::type::sequence_item_added, val, sequence_item_index } }));
}, make_property_changed_event(nmos::fields::nc::oid(resource.data), { { property_id_, nc_property_change_type::type::sequence_item_added, val, sequence_item_index } }));

return make_control_protocol_message_response(handle, { is_deprecated ? nmos::nc_method_status::method_deprecated : nmos::fields::nc::is_deprecated(property) ? nc_method_status::property_deprecated : nc_method_status::ok }, sequence_item_index);
}
Expand Down Expand Up @@ -309,7 +309,7 @@ namespace nmos
auto& sequence = resource.data[nmos::fields::nc::name(property)].as_array();
sequence.erase(index);

}, make_propertry_changed_event(nmos::fields::nc::oid(resource.data), { { details::parse_nc_property_id(property_id), nc_property_change_type::type::sequence_item_removed, nc_id(index) } }));
}, make_property_changed_event(nmos::fields::nc::oid(resource.data), { { details::parse_nc_property_id(property_id), nc_property_change_type::type::sequence_item_removed, nc_id(index) } }));

return make_control_protocol_message_response(handle, { is_deprecated ? nmos::nc_method_status::method_deprecated : nmos::fields::nc::is_deprecated(property) ? nc_method_status::property_deprecated : nc_method_status::ok });
}
Expand Down
2 changes: 1 addition & 1 deletion Development/nmos/control_protocol_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ namespace nmos
// property changed notification event
// See https://specs.amwa.tv/ms-05-01/branches/v1.0.x/docs/Core_Mechanisms.html#the-propertychanged-event
// See https://specs.amwa.tv/ms-05-02/branches/v1.0.x/docs/NcObject.html#propertychanged-event
web::json::value make_propertry_changed_event(nc_oid oid, const std::vector<nc_property_changed_event_data>& property_changed_event_data_list)
web::json::value make_property_changed_event(nc_oid oid, const std::vector<nc_property_changed_event_data>& property_changed_event_data_list)
{
using web::json::value;

Expand Down
2 changes: 1 addition & 1 deletion Development/nmos/control_protocol_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ namespace nmos
// property changed notification event
// See https://specs.amwa.tv/ms-05-01/branches/v1.0.x/docs/Core_Mechanisms.html#the-propertychanged-event
// See https://specs.amwa.tv/ms-05-02/branches/v1.0.x/docs/NcObject.html#propertychanged-event
web::json::value make_propertry_changed_event(nc_oid oid, const std::vector<nc_property_changed_event_data>& property_changed_event_data_list);
web::json::value make_property_changed_event(nc_oid oid, const std::vector<nc_property_changed_event_data>& property_changed_event_data_list);

// error message
// See https://specs.amwa.tv/is-12/branches/v1.0.x/docs/Protocol_messaging.html#error-messages
Expand Down
4 changes: 2 additions & 2 deletions Development/nmos/control_protocol_typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace nmos
property_deprecated = 298, // Method call was successful but targeted property is deprecated
method_deprecated = 299, // Method call was successful but method is deprecated
bad_command_format = 400, // Badly-formed command
unathorized = 401, // Client is not authorized
unauthorized = 401, // Client is not authorized
bad_oid = 404, // Command addresses a nonexistent object
read_only = 405, // Attempt to change read-only state
invalid_request = 406, // Method call is invalid in current operating context
Expand Down Expand Up @@ -146,7 +146,7 @@ namespace nmos
// See https://specs.amwa.tv/ms-05-02/branches/v1.0.x/docs/Framework.html#nceventid
typedef nc_element_id nc_event_id;
// NcEventIds for NcObject
// SEe https://specs.amwa.tv/ms-05-02/branches/v1.0.x/docs/Framework.html#ncobject
// See https://specs.amwa.tv/ms-05-02/branches/v1.0.x/docs/Framework.html#ncobject
const nc_event_id nc_object_property_changed_event_id(1, 1);

// NcMethodId
Expand Down

0 comments on commit 8794dd4

Please sign in to comment.