Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Lo <[email protected]>
  • Loading branch information
N-Nagorny and lo-simon authored Mar 13, 2024
1 parent d33fdfa commit 3fa4720
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 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 @@ -970,7 +970,7 @@ void node_implementation_init(nmos::node_model& model, nmos::experimental::contr
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
utility::string_t edid(edid_bytes, edid_bytes + sizeof(edid_bytes));

const auto input_id = impl::make_id(seed_id, nmos::types::input);
const auto sender_ids = impl::make_ids(seed_id, nmos::types::sender, { impl::ports::video, impl::ports::audio });

Expand Down Expand Up @@ -2234,6 +2234,6 @@ nmos::experimental::node_implementation make_node_implementation(nmos::node_mode
.on_set_effective_edid(set_effective_edid) // may be omitted if not required
.on_active_constraints_changed(make_node_implementation_streamcompatibility_active_constraints_handler(model, gate))
.on_validate_sender_resources_against_active_constraints(make_node_implementation_streamcompatibility_sender_validator()) // may be omitted if the default is sufficient
.on_validate_receiver_against_transport_file(make_node_implementation_streamcompatibility_receiver_validator())
.on_validate_receiver_against_transport_file(make_node_implementation_streamcompatibility_receiver_validator()) // may be omitted if the default is sufficient
.on_control_protocol_property_changed(make_node_implementation_control_protocol_property_changed_handler(gate)); // may be omitted if IS-12 not required
}
2 changes: 1 addition & 1 deletion Development/nmos/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace nmos
// IS-11 senders, receivers, inputs and outputs for this node
// see nmos/streamcompatibility_resources.h
nmos::resources streamcompatibility_resources;

// IS-12 resources for this node
// see nmos/control_protocol_resources.h
nmos::resources control_protocol_resources;
Expand Down
2 changes: 1 addition & 1 deletion Development/nmos/node_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace nmos
load_authorization_clients_handler load_authorization_clients;
save_authorization_client_handler save_authorization_client;
request_authorization_code_handler request_authorization_code;

nmos::experimental::details::streamcompatibility_base_edid_handler base_edid_changed;
nmos::experimental::details::streamcompatibility_effective_edid_setter set_effective_edid;
nmos::experimental::details::streamcompatibility_active_constraints_handler active_constraints_changed;
Expand Down
2 changes: 1 addition & 1 deletion Development/nmos/streamcompatibility_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ namespace nmos

utility::string_t updated_timestamp;

modify_resource(resources, resourceId, [&effective_edid_setter, &updated_timestamp](nmos::resource& input)
modify_resource(resources, resourceId, [&updated_timestamp](nmos::resource& input)
{
input.data[nmos::fields::endpoint_base_edid] = make_streamcompatibility_dummy_edid_endpoint();

Expand Down
7 changes: 3 additions & 4 deletions Development/nmos/streamcompatibility_behaviour.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "nmos/streamcompatibility_behaviour.h"
#include "nmos/streamcompatibility_state.h"
#include "nmos/streamcompatibility_utils.h"

#include <vector>
#include <boost/range/adaptor/filtered.hpp>
Expand All @@ -16,6 +14,8 @@
#include "nmos/resources.h"
#include "nmos/sdp_utils.h"
#include "nmos/slog.h"
#include "nmos/streamcompatibility_state.h"
#include "nmos/streamcompatibility_utils.h"
#include "sdp/sdp.h"

namespace nmos
Expand Down Expand Up @@ -214,8 +214,7 @@ namespace nmos
auto receiver = find_resource(node_resources, receiver_id_type);
if (node_resources.end() == receiver) throw std::logic_error("Matching IS-04 receiver not found");

updated = most_recent_update < nmos::fields::version(receiver->data);

updated = most_recent_update < receiver->updated;
if (updated)
{
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Receiver " << receiver_id << " has been updated recently and Status of Receiver is being updated as well";
Expand Down

0 comments on commit 3fa4720

Please sign in to comment.