Skip to content

Commit

Permalink
Added Receiver Monitor Protected and Ident Beacon workers to control_…
Browse files Browse the repository at this point in the history
…protocol_resources
  • Loading branch information
jonathan-r-thorpe committed Feb 27, 2024
1 parent 9c27c40 commit 9406d81
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 5 deletions.
52 changes: 47 additions & 5 deletions Development/nmos/control_protocol_resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,60 @@ namespace nmos
return{ is12_versions::v1_0, types::nc_class_manager, std::move(data), true };
}

// Monitoring feature set control classes
//
namespace details
{
web::json::value make_receiver_monitor(const nc_class_id& class_id, nc_oid oid, nmos::nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints,
nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_payload_status::status payload_status, const utility::string_t& payload_status_message)
{
using web::json::value;

auto data = nmos::details::make_nc_worker(class_id, oid, true, owner, role, value::string(user_label), description, touchpoints, runtime_property_constraints, true);
data[nmos::fields::nc::connection_status] = value::number(connection_status);
data[nmos::fields::nc::connection_status_message] = value::string(connection_status_message);
data[nmos::fields::nc::payload_status] = value::number(payload_status);
data[nmos::fields::nc::payload_status_message] = value::string(payload_status_message);

return data;
}

}
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor
control_protocol_resource make_receiver_monitor(nc_oid oid, nmos::nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints,
nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_payload_status::status payload_status, const utility::string_t& payload_status_message)
{
using web::json::value;

auto data = nmos::details::make_nc_worker(nc_receiver_monitor_class_id, oid, true, owner, role, value::string(user_label), description, touchpoints, runtime_property_constraints, true);
data[nmos::fields::nc::connection_status] = value::number(connection_status);
data[nmos::fields::nc::connection_status_message] = value::string(connection_status_message);
data[nmos::fields::nc::payload_status] = value::number(payload_status);
data[nmos::fields::nc::payload_status_message] = value::string(payload_status_message);
auto data = nmos::details::make_receiver_monitor(nc_receiver_monitor_class_id, oid, owner, role, user_label, description, touchpoints, runtime_property_constraints, connection_status, connection_status_message, payload_status, payload_status_message);

return{ is12_versions::v1_0, types::nc_receiver_monitor, std::move(data), true };
}

// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitorprotected
control_protocol_resource make_receiver_monitor_protected(nc_oid oid, nmos::nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints,
nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_payload_status::status payload_status, const utility::string_t& payload_status_message, bool signal_protection_status)
{
using web::json::value;

auto data = nmos::details::make_receiver_monitor(nc_receiver_monitor_protected_class_id, oid, owner, role, user_label, description, touchpoints, runtime_property_constraints, connection_status, connection_status_message, payload_status, payload_status_message);
data[nmos::fields::nc::signal_protection_status] = value::boolean(signal_protection_status);

return{ is12_versions::v1_0, types::nc_receiver_monitor_protected, std::move(data), true };
}

// Identification feature set control classes
//
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/identification/#ncidentbeacon
control_protocol_resource make_ident_beacon(nc_oid oid, nmos::nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints,
bool active)
{
using web::json::value;

auto data = nmos::details::make_nc_worker(nc_ident_beacon_class_id, oid, true, owner, role, value::string(user_label), description, touchpoints, runtime_property_constraints, true);
data[nmos::fields::nc::active] = value::boolean(active);

return{ is12_versions::v1_0, types::nc_ident_beacon, std::move(data), true };
}

}
18 changes: 18 additions & 0 deletions Development/nmos/control_protocol_resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,31 @@ namespace nmos
// create Class manager resource
control_protocol_resource make_class_manager(nc_oid oid, const nmos::experimental::control_protocol_state& control_protocol_state);

// Monitoring feature set control classes
//
// create Receiver Monitor resource
control_protocol_resource make_receiver_monitor(nc_oid oid, nmos::nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints = web::json::value::null(), const web::json::value& runtime_property_constraints = web::json::value::null(),
nc_connection_status::status connection_status = nc_connection_status::status::undefined,
const utility::string_t& connection_status_message = U(""),
nc_payload_status::status payload_status = nc_payload_status::status::undefined,
const utility::string_t& payload_status_message = U("")
);

// create Receiver Monitor Protected resource
control_protocol_resource make_receiver_monitor_protected(nc_oid oid, nmos::nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints = web::json::value::null(),
nc_connection_status::status connection_status = nc_connection_status::status::undefined,
const utility::string_t& connection_status_message = U(""),
nc_payload_status::status payload_status = nc_payload_status::status::undefined,
const utility::string_t& payload_status_message = U(""),
bool signal_protection_status = true
);

// Identification feature set control classes
//
// create Ident Beacon resource
control_protocol_resource make_ident_beacon(nc_oid oid, nmos::nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints = web::json::value::null(), const web::json::value& runtime_property_constraints = web::json::value::null(),
bool active = false
);
}

#endif
1 change: 1 addition & 0 deletions Development/nmos/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace nmos
const type nc_class_manager{ U("nc_class_manager") };
const type nc_receiver_monitor{ U("nc_receiver_monitor") };
const type nc_receiver_monitor_protected{ U("nc_receiver_monitor_protected") };
const type nc_ident_beacon{ U("nc_ident_beacon") };
}
}

Expand Down

0 comments on commit 9406d81

Please sign in to comment.