libe3 0.6.1
C++ library for E3AP RAN vendor integration
Loading...
Searching...
No Matches
libe3::E3Agent Class Reference

E3Agent - Main façade for RAN vendor integration. More...

#include <e3_agent.hpp>

Classes

struct  Impl
 E3Agent implementation details. More...

Public Member Functions

 E3Agent (E3Config config=E3Config{})
 Construct an E3Agent with configuration.
 ~E3Agent ()
 Destructor - ensures clean shutdown.
 E3Agent (const E3Agent &)=delete
E3Agent & operator= (const E3Agent &)=delete
 E3Agent (E3Agent &&) noexcept
 Move constructor.
E3Agent & operator= (E3Agent &&) noexcept
 Move assignment.
ErrorCode init ()
 Initialize the agent.
ErrorCode start ()
 Start the agent.
void stop ()
 Stop the agent.
AgentState state () const noexcept
 Get current agent state.
bool is_running () const noexcept
 Check if agent is running.
ErrorCode register_sm (std::unique_ptr< ServiceModel > sm)
 Register a Service Model.
std::vector< uint32_t > get_available_ran_functions () const
 Get available RAN function IDs.
void set_dapp_report_handler (DAppReportHandler handler)
 Set callback for incoming dApp reports (dApp → RAN). Call before start(). When a dApp sends a DApp report, this callback is invoked.
void set_dapp_status_changed_handler (DAppStatusChangedHandler handler)
 Set callback for dApp status changes. Called when a dApp connects, disconnects, subscribes, or unsubscribes. Call before start().
ErrorCode send_indication (uint32_t dapp_id, uint32_t ran_function_id, const std::vector< uint8_t > &data)
 Send an indication message to a specific dApp.
ErrorCode send_xapp_control (uint32_t dapp_id, uint32_t ran_function_id, const std::vector< uint8_t > &control_data, uint32_t sequence_id, uint32_t *out_message_id=nullptr, bool request_ack=false)
 Send an xApp control action to a specific dApp coming from the E2SM-DAPP.
ErrorCode send_message_ack (uint32_t request_id, ResponseCode response_code)
 Send a message acknowledgment.
void set_setup_response_handler (SetupResponseHandler handler)
void set_subscription_response_handler (SubscriptionResponseHandler handler)
void set_indication_handler (IndicationHandler handler)
void set_xapp_control_handler (XAppControlHandler handler)
void set_message_ack_handler (MessageAckHandler handler)
void set_control_response_handler (ControlResponseHandler handler)
void set_disconnect_handler (DisconnectHandler handler)
std::optional< uint32_t > dapp_id () const noexcept
 dApp identifier assigned by the RAN in SetupResponse.
std::vector< uint32_t > subscribed_ran_functions () const
std::vector< uint32_t > active_subscription_ids () const
ErrorCode wait_for_setup (std::chrono::milliseconds timeout)
 Block until the dApp setup handshake completes.
ErrorCode subscribe (uint32_t ran_function_id, std::vector< uint32_t > telemetry_ids, std::vector< uint32_t > control_ids, std::optional< uint32_t > sub_time=std::nullopt, std::optional< uint32_t > periodicity=std::nullopt, uint32_t *out_request_id=nullptr)
 Subscribe to a RAN function. Must be called after a positive setup.
ErrorCode unsubscribe (uint32_t ran_function_id)
ErrorCode send_control (uint32_t ran_function_id, uint32_t control_id, std::vector< uint8_t > action_data, uint32_t sequence_id=0, uint32_t *out_message_id=nullptr, bool request_ack=false)
 Send a dApp control action to the RAN.
ErrorCode send_control_response (uint32_t request_id, uint32_t ran_function_id, uint32_t control_id, const ControlResult &result)
 Answer an xApp control that asked for an answer (XAppControlAction::request_ack).
ErrorCode send_report (uint32_t ran_function_id, std::vector< uint8_t > report_data, uint32_t sequence_id, uint32_t *out_message_id=nullptr)
 Send a dApp report to the RAN.
ErrorCode release ()
std::vector< uint32_t > get_registered_dapps () const
 Get list of registered dApp IDs.
std::vector< uint32_t > get_dapp_subscriptions (uint32_t dapp_id) const
 Get subscriptions for a dApp.
std::vector< uint32_t > get_ran_function_subscribers (uint32_t ran_function_id) const
 Get subscribers for a RAN function.
std::vector< uint32_t > get_active_ran_functions () const
 Get the RAN functions that currently have at least one subscriber.
uint32_t get_subscription_periodicity (uint32_t dapp_id, uint32_t ran_function_id) const
 Get the reporting periodicity a dApp requested for a RAN function.
std::vector< uint32_t > get_subscription_telemetry_ids (uint32_t dapp_id, uint32_t ran_function_id) const
 Get the telemetry IDs a dApp requested for a RAN function.
std::vector< uint32_t > get_subscription_control_ids (uint32_t dapp_id, uint32_t ran_function_id) const
 Get the control IDs a dApp requested for a RAN function.
const E3Config & config () const noexcept
 Get current configuration.
size_t dapp_count () const
 Get number of registered dApps.
size_t subscription_count () const
 Get total number of active subscriptions.
 E3Agent (E3Config config)
 Build the agent.
 ~E3Agent ()
ErrorCode init ()
 Prepare the agent.
ErrorCode start ()
 Start the agent.
void stop ()
 Stop the agent and join its threads.
AgentState state () const noexcept
bool is_running () const noexcept
ErrorCode send_indication (uint32_t dapp_id, uint32_t ran_function_id, const std::vector< uint8_t > &data)
ErrorCode send_message_ack (uint32_t request_id, ResponseCode response_code)
ErrorCode unsubscribe (uint32_t ran_function_id)
ErrorCode send_control (uint32_t ran_function_id, uint32_t control_id, std::vector< uint8_t > action_data, uint32_t sequence_id=0)
ErrorCode send_report (uint32_t ran_function_id, std::vector< uint8_t > report_data, uint32_t sequence_id)
ErrorCode release ()
 Release this dApp (dApp role).
std::vector< uint32_t > subscribed_ran_functions () const
std::vector< uint32_t > active_subscription_ids () const
const E3Config & config () const noexcept
size_t dapp_count () const
size_t subscription_count () const

Detailed Description

E3Agent - Main façade for RAN vendor integration.

This class is the primary entry point for integrating E3AP functionality into a RAN function (DU, CU-CP, CU-UP). It provides:

  • Simple lifecycle management (init, start, stop, destroy)
  • Service Model registration
  • Automatic routing of control actions to the correct Service Model
  • Thread-safe operation

Usage Example:

// Create agent with configuration
// Set custom ports if needed
config.setup_port = 9990;
config.subscriber_port = 9999;
config.publisher_port = 9991;
// Register Service Models
agent.register_sm(std::make_unique<MySpectrumSM>());
// Start the agent
if (agent.start() != libe3::ErrorCode::SUCCESS) {
// Handle error
}
// ... agent runs, handling dApp connections and messages ...
// Shutdown
agent.stop();
E3Agent - Main façade for RAN vendor integration.
Definition e3_agent.hpp:94
const E3Config & config() const noexcept
Get current configuration.
Definition e3_agent.cpp:341
@ IPC
Unix Domain Sockets / IPC.
Definition types.hpp:88
@ ZMQ
ZeroMQ-based transport.
Definition types.hpp:63
@ JSON
JSON encoding (for development/debugging).
Definition types.hpp:55
Configuration for E3Agent.
Definition types.hpp:506

Thread Safety: All public methods are thread-safe. The agent manages its own internal threads for protocol handling.

Definition at line 94 of file e3_agent.hpp.

Constructor & Destructor Documentation

◆ E3Agent() [1/4]

libe3::E3Agent::E3Agent ( E3Config config = E3Config{})
explicit

Construct an E3Agent with configuration.

Parameters
configAgent configuration

Definition at line 47 of file e3_agent.cpp.

◆ ~E3Agent() [1/2]

libe3::E3Agent::~E3Agent ( )

Destructor - ensures clean shutdown.

Definition at line 53 of file e3_agent.cpp.

◆ E3Agent() [2/4]

libe3::E3Agent::E3Agent ( const E3Agent & )
delete

◆ E3Agent() [3/4]

libe3::E3Agent::E3Agent ( E3Agent && )
defaultnoexcept

Move constructor.

◆ E3Agent() [4/4]

libe3::E3Agent::E3Agent ( E3Config config)

Build the agent.

Parameters
configRole, links, encoding and limits, as for libe3::E3Agent

◆ ~E3Agent() [2/2]

libe3::E3Agent::~E3Agent ( )

Member Function Documentation

◆ active_subscription_ids() [1/2]

std::vector< uint32_t > libe3::E3Agent::active_subscription_ids ( ) const

Subscription IDs this dApp currently holds.

Returns
The subscription IDs

Definition at line 434 of file e3_agent.cpp.

◆ active_subscription_ids() [2/2]

std::vector< uint32_t > libe3::E3Agent::active_subscription_ids ( ) const
Returns
The subscription identifiers the RAN granted and that have not ended

◆ config() [1/2]

const E3Config & libe3::E3Agent::config ( ) const
noexcept

Get current configuration.

Returns
The configuration the agent was created with

Definition at line 341 of file e3_agent.cpp.

◆ config() [2/2]

const E3Config & libe3::E3Agent::config ( ) const
noexcept
Returns
The configuration the agent was built with

◆ dapp_count() [1/2]

size_t libe3::E3Agent::dapp_count ( ) const

Get number of registered dApps.

Returns
The number of dApps

Definition at line 349 of file e3_agent.cpp.

◆ dapp_count() [2/2]

size_t libe3::E3Agent::dapp_count ( ) const
Returns
The dApps registered with this RAN

◆ dapp_id()

std::optional< uint32_t > libe3::E3Agent::dapp_id ( ) const
noexcept

dApp identifier assigned by the RAN in SetupResponse.

Returns
nullopt until setup completes (or on RAN-role agents).

Definition at line 424 of file e3_agent.cpp.

◆ get_active_ran_functions()

std::vector< uint32_t > libe3::E3Agent::get_active_ran_functions ( ) const

Get the RAN functions that currently have at least one subscriber.

RAN role only. Unlike get_available_ran_functions() (which lists every registered Service Model), this returns only the RAN functions a dApp is actively subscribed to.

Returns
List of RAN function IDs with one or more subscribers

Definition at line 303 of file e3_agent.cpp.

◆ get_available_ran_functions()

std::vector< uint32_t > libe3::E3Agent::get_available_ran_functions ( ) const

Get available RAN function IDs.

Returns the RAN function IDs from all registered Service Models.

Returns
The RAN function IDs

Definition at line 184 of file e3_agent.cpp.

◆ get_dapp_subscriptions()

std::vector< uint32_t > libe3::E3Agent::get_dapp_subscriptions ( uint32_t dapp_id) const

Get subscriptions for a dApp.

Parameters
dapp_iddApp identifier
Returns
List of RAN function IDs the dApp is subscribed to

Definition at line 289 of file e3_agent.cpp.

◆ get_ran_function_subscribers()

std::vector< uint32_t > libe3::E3Agent::get_ran_function_subscribers ( uint32_t ran_function_id) const

Get subscribers for a RAN function.

Parameters
ran_function_idRAN function identifier
Returns
List of dApp IDs subscribed to this RAN function

Definition at line 296 of file e3_agent.cpp.

◆ get_registered_dapps()

std::vector< uint32_t > libe3::E3Agent::get_registered_dapps ( ) const

Get list of registered dApp IDs.

Returns
The dApp IDs

Definition at line 282 of file e3_agent.cpp.

◆ get_subscription_control_ids()

std::vector< uint32_t > libe3::E3Agent::get_subscription_control_ids ( uint32_t dapp_id,
uint32_t ran_function_id ) const

Get the control IDs a dApp requested for a RAN function.

Returns
vector of control IDs (empty if none requested or subscription not found)
Parameters
dapp_idThe dApp
ran_function_idThe RAN function

Definition at line 328 of file e3_agent.cpp.

◆ get_subscription_periodicity()

uint32_t libe3::E3Agent::get_subscription_periodicity ( uint32_t dapp_id,
uint32_t ran_function_id ) const

Get the reporting periodicity a dApp requested for a RAN function.

Returns
periodicity in microseconds, 0 if not set or subscription not found
Parameters
dapp_idThe dApp
ran_function_idThe RAN function

Definition at line 310 of file e3_agent.cpp.

◆ get_subscription_telemetry_ids()

std::vector< uint32_t > libe3::E3Agent::get_subscription_telemetry_ids ( uint32_t dapp_id,
uint32_t ran_function_id ) const

Get the telemetry IDs a dApp requested for a RAN function.

Returns
vector of telemetry IDs (empty if none requested or subscription not found)
Parameters
dapp_idThe dApp
ran_function_idThe RAN function

Definition at line 319 of file e3_agent.cpp.

◆ init() [1/2]

ErrorCode libe3::E3Agent::init ( )

Initialize the agent.

Initializes internal components but does not start processing. Must be called before start().

Returns
ErrorCode::SUCCESS on success
ErrorCode::ALREADY_INITIALIZED if already initialized

Definition at line 65 of file e3_agent.cpp.

◆ init() [2/2]

ErrorCode libe3::E3Agent::init ( )

Prepare the agent.

Returns
ErrorCode::SUCCESS on success

◆ is_running() [1/2]

bool libe3::E3Agent::is_running ( ) const
noexcept

Check if agent is running.

Returns
true while the agent is running

Definition at line 156 of file e3_agent.cpp.

◆ is_running() [2/2]

bool libe3::E3Agent::is_running ( ) const
noexcept
Returns
True while the agent runs

◆ operator=() [1/2]

E3Agent & libe3::E3Agent::operator= ( const E3Agent & )
delete

◆ operator=() [2/2]

E3Agent & libe3::E3Agent::operator= ( E3Agent && )
defaultnoexcept

Move assignment.

Returns
This agent

◆ register_sm()

ErrorCode libe3::E3Agent::register_sm ( std::unique_ptr< ServiceModel > sm)

Register a Service Model.

Service Models must be registered before start() is called. Each SM handles one or more RAN function IDs.

Parameters
smService Model to register (ownership transferred)
Returns
ErrorCode::SUCCESS on success
ErrorCode::SM_ALREADY_REGISTERED if RAN function already has SM
ErrorCode::STATE_ERROR if agent is already running

Definition at line 164 of file e3_agent.cpp.

◆ release() [1/2]

ErrorCode libe3::E3Agent::release ( )

Send a ReleaseMessage. The dApp stays running until stop() is called.

Returns
ErrorCode::SUCCESS if the release was queued, an error code otherwise

Definition at line 495 of file e3_agent.cpp.

◆ release() [2/2]

ErrorCode libe3::E3Agent::release ( )

Release this dApp (dApp role).

Returns
ErrorCode::SUCCESS once queued

◆ send_control() [1/2]

ErrorCode libe3::E3Agent::send_control ( uint32_t ran_function_id,
uint32_t control_id,
std::vector< uint8_t > action_data,
uint32_t sequence_id = 0 )

Send a dApp control (dApp role).

Parameters
ran_function_idRAN function the control is for
control_idcontrol identifier granted by the RAN
action_dataopaque Service Model payload
sequence_idcorrelation id of the xApp procedure this control re-issues, or 0
Returns
ErrorCode::SUCCESS once queued

◆ send_control() [2/2]

ErrorCode libe3::E3Agent::send_control ( uint32_t ran_function_id,
uint32_t control_id,
std::vector< uint8_t > action_data,
uint32_t sequence_id = 0,
uint32_t * out_message_id = nullptr,
bool request_ack = false )

Send a dApp control action to the RAN.

Parameters
ran_function_idRAN function the control is for
control_idcontrol identifier granted by the RAN
action_dataopaque E3SM control payload
sequence_idcorrelation id of the xApp procedure this control re-issues; leave 0 for a control the dApp decided on its own.
out_message_idwhen non-null, receives the assigned E3-MessageID on success: the request_id of the ControlResponse that answers it.
request_acktrue to ask the RAN for a ControlResponse when the control has been dealt with. Without it the RAN answers only a control that it refuses itself (no setup, unknown function or control, no subscription).
Returns
ErrorCode::SUCCESS if the control was queued, an error code otherwise

Definition at line 464 of file e3_agent.cpp.

◆ send_control_response()

ErrorCode libe3::E3Agent::send_control_response ( uint32_t request_id,
uint32_t ran_function_id,
uint32_t control_id,
const ControlResult & result )

Answer an xApp control that asked for an answer (XAppControlAction::request_ack).

Parameters
request_idXAppControlAction::message_id of the control being answered
ran_function_idRAN function of the control
control_idcontrol the dApp applied, from the list the RAN advertised for the function
resultWhether the dApp applied the control, why not, and what it reports about it
Returns
ErrorCode::SUCCESS if the answer was queued; STATE_ERROR on a RAN-role agent; NOT_INITIALIZED if the agent is not running or setup has not completed; INVALID_PARAM if the outcome is over MAX_CONTROL_OUTCOME_SIZE

Definition at line 476 of file e3_agent.cpp.

◆ send_indication() [1/2]

ErrorCode libe3::E3Agent::send_indication ( uint32_t dapp_id,
uint32_t ran_function_id,
const std::vector< uint8_t > & data )

Send an indication message to a specific dApp.

Parameters
dapp_idTarget dApp identifier
ran_function_idRAN function identifier
dataE3SM-encoded indication data
Returns
ErrorCode::SUCCESS on success

Definition at line 209 of file e3_agent.cpp.

◆ send_indication() [2/2]

ErrorCode libe3::E3Agent::send_indication ( uint32_t dapp_id,
uint32_t ran_function_id,
const std::vector< uint8_t > & data )

Send an indication to one dApp (RAN role).

Parameters
dapp_iddApp the indication is for
ran_function_idRAN function it comes from
dataopaque Service Model payload
Returns
ErrorCode::SUCCESS once queued

◆ send_message_ack() [1/2]

ErrorCode libe3::E3Agent::send_message_ack ( uint32_t request_id,
ResponseCode response_code )

Send a message acknowledgment.

DEPRECATED TO BE REMOVED. The answer to a control is a ControlResponse, which a Service Model sends with ServiceModel::respond_to_control(). A libe3 RAN does not read a MessageAck from a dApp.

Parameters
request_idID of the request being acknowledged
response_codeResponseCode::POSITIVE (0) or NEGATIVE (1)
Returns
ErrorCode::SUCCESS on success

Definition at line 269 of file e3_agent.cpp.

◆ send_message_ack() [2/2]

ErrorCode libe3::E3Agent::send_message_ack ( uint32_t request_id,
ResponseCode response_code )

Send a message acknowledgment. DEPRECATED TO BE REMOVED.

Parameters
request_idrequest being acknowledged
response_codePOSITIVE or NEGATIVE
Returns
ErrorCode::SUCCESS once queued

◆ send_report() [1/2]

ErrorCode libe3::E3Agent::send_report ( uint32_t ran_function_id,
std::vector< uint8_t > report_data,
uint32_t sequence_id )

Send a dApp report (dApp role).

Parameters
ran_function_idRAN function the report is for
report_dataopaque Service Model payload
sequence_idcorrelation id the dApp assigns to the detection, not 0
Returns
ErrorCode::SUCCESS once queued

◆ send_report() [2/2]

ErrorCode libe3::E3Agent::send_report ( uint32_t ran_function_id,
std::vector< uint8_t > report_data,
uint32_t sequence_id,
uint32_t * out_message_id = nullptr )

Send a dApp report to the RAN.

Parameters
ran_function_idRAN function the report is for
report_dataopaque E3SM report payload
sequence_idcorrelation id the dApp assigns to this detection. It is the head of the loop's chain and is mandatory on the wire.
out_message_idwhen non-null, receives the assigned E3-MessageID on success, so the caller can correlate a later ack/response back to this send.
Returns
ErrorCode::SUCCESS if the report was queued, an error code otherwise

Definition at line 485 of file e3_agent.cpp.

◆ send_xapp_control()

ErrorCode libe3::E3Agent::send_xapp_control ( uint32_t dapp_id,
uint32_t ran_function_id,
const std::vector< uint8_t > & control_data,
uint32_t sequence_id,
uint32_t * out_message_id = nullptr,
bool request_ack = false )

Send an xApp control action to a specific dApp coming from the E2SM-DAPP.

Parameters
dapp_idTarget dApp identifier
ran_function_idRAN function identifier
control_dataE3SM-encoded control payload
sequence_idCorrelation id from the E2SM-DAPP control header, so the dApp can carry it back on the control it re-issues.
out_message_idWhen non-null, receives the E3-MessageID of the control on success: the request_id of the ControlResponse that answers it.
request_ackTrue to ask the dApp for a ControlResponse; it reaches the handler of set_control_response_handler().
Returns
ErrorCode::SUCCESS on success

Definition at line 238 of file e3_agent.cpp.

◆ set_control_response_handler()

void libe3::E3Agent::set_control_response_handler ( ControlResponseHandler handler)

Set callback for incoming ControlResponse, in either role. On a dApp it is the RAN's answer to a control that asked for one, or the RAN's refusal of any control; on a RAN it is a dApp's answer to an xApp control that asked for one.

Parameters
handlerCalled with each response

Definition at line 410 of file e3_agent.cpp.

◆ set_dapp_report_handler()

void libe3::E3Agent::set_dapp_report_handler ( DAppReportHandler handler)

Set callback for incoming dApp reports (dApp → RAN). Call before start(). When a dApp sends a DApp report, this callback is invoked.

Parameters
handlerCalled with each dApp report

Definition at line 191 of file e3_agent.cpp.

◆ set_dapp_status_changed_handler()

void libe3::E3Agent::set_dapp_status_changed_handler ( DAppStatusChangedHandler handler)

Set callback for dApp status changes. Called when a dApp connects, disconnects, subscribes, or unsubscribes. Call before start().

Parameters
handlerCalled after each change

Definition at line 198 of file e3_agent.cpp.

◆ set_disconnect_handler()

void libe3::E3Agent::set_disconnect_handler ( DisconnectHandler handler)

Set callback for the end of the dApp's session with the RAN: a release for this dApp, or a closed or failed connection. Fires once, after dapp_id() has been cleared. Unless E3Config::reconnect_interval_ms is 0 the dApp then registers again by itself, with a new dapp_id() and no subscriptions: subscribe again from the setup response handler. It does not after release() or stop().

Parameters
handlerCalled once per ended session, with the reason

Definition at line 417 of file e3_agent.cpp.

◆ set_indication_handler()

void libe3::E3Agent::set_indication_handler ( IndicationHandler handler)

Set callback for incoming IndicationMessage (RAN → dApp).

Parameters
handlerCalled with each indication

Definition at line 389 of file e3_agent.cpp.

◆ set_message_ack_handler()

void libe3::E3Agent::set_message_ack_handler ( MessageAckHandler handler)

Set callback for incoming MessageAck (RAN → dApp). DEPRECATED TO BE REMOVED: libe3 does not send one; another RAN may.

Parameters
handlerCalled with each acknowledgement

Definition at line 403 of file e3_agent.cpp.

◆ set_setup_response_handler()

void libe3::E3Agent::set_setup_response_handler ( SetupResponseHandler handler)

Set callback for incoming SetupResponse (RAN → dApp).

Parameters
handlerCalled on every setup, so also when the dApp registers again

Definition at line 375 of file e3_agent.cpp.

◆ set_subscription_response_handler()

void libe3::E3Agent::set_subscription_response_handler ( SubscriptionResponseHandler handler)

Set callback for incoming SubscriptionResponse (RAN → dApp).

Parameters
handlerCalled with each response

Definition at line 382 of file e3_agent.cpp.

◆ set_xapp_control_handler()

void libe3::E3Agent::set_xapp_control_handler ( XAppControlHandler handler)

Set callback for incoming XAppControlAction (xApp → dApp via RAN).

Parameters
handlerCalled with each control action

Definition at line 396 of file e3_agent.cpp.

◆ start() [1/2]

ErrorCode libe3::E3Agent::start ( )

Start the agent.

Starts the internal processing threads and begins accepting dApp connections. If not already initialized, calls init() first.

Returns
ErrorCode::SUCCESS on success

Definition at line 117 of file e3_agent.cpp.

◆ start() [2/2]

ErrorCode libe3::E3Agent::start ( )

Start the agent.

Returns
ErrorCode::SUCCESS on success

◆ state() [1/2]

AgentState libe3::E3Agent::state ( ) const
noexcept

Get current agent state.

Returns
The state the agent is in

Definition at line 149 of file e3_agent.cpp.

◆ state() [2/2]

AgentState libe3::E3Agent::state ( ) const
noexcept
Returns
The state of the agent

◆ stop() [1/2]

void libe3::E3Agent::stop ( )

Stop the agent.

Stops all processing threads and closes connections. The agent can be restarted with start().

Definition at line 139 of file e3_agent.cpp.

◆ stop() [2/2]

void libe3::E3Agent::stop ( )

Stop the agent and join its threads.

◆ subscribe()

ErrorCode libe3::E3Agent::subscribe ( uint32_t ran_function_id,
std::vector< uint32_t > telemetry_ids,
std::vector< uint32_t > control_ids,
std::optional< uint32_t > sub_time = std::nullopt,
std::optional< uint32_t > periodicity = std::nullopt,
uint32_t * out_request_id = nullptr )

Subscribe to a RAN function. Must be called after a positive setup.

Parameters
ran_function_idRAN function to subscribe to
telemetry_idstelemetry identifiers requested
control_idscontrol identifiers requested
sub_timeseconds to keep the subscription. Over ASN.1 the range is 0 to 86400.
periodicitymicroseconds between indications, 0 = every event. Over ASN.1 the range is 0 to 60000000. An OCUDU RAN reads the same number as milliseconds, so pass it what it expects.
out_request_idwhen non-null, receives the assigned E3-MessageID on success, so the caller can correlate the SubscriptionResponse (which echoes request_id) back to this subscribe call.
Returns
SUCCESS once the request is queued; STATE_ERROR on a RAN-role agent; NOT_INITIALIZED if the agent is not running or setup has not completed; otherwise the error from queueing the message.

Definition at line 445 of file e3_agent.cpp.

◆ subscribed_ran_functions() [1/2]

std::vector< uint32_t > libe3::E3Agent::subscribed_ran_functions ( ) const

RAN functions this dApp is currently subscribed to.

Returns
The RAN function IDs

Definition at line 429 of file e3_agent.cpp.

◆ subscribed_ran_functions() [2/2]

std::vector< uint32_t > libe3::E3Agent::subscribed_ran_functions ( ) const
Returns
The RAN functions this dApp holds a subscription to

◆ subscription_count() [1/2]

size_t libe3::E3Agent::subscription_count ( ) const

Get total number of active subscriptions.

Returns
The number of subscriptions

Definition at line 361 of file e3_agent.cpp.

◆ subscription_count() [2/2]

size_t libe3::E3Agent::subscription_count ( ) const
Returns
The subscriptions this RAN holds

◆ unsubscribe() [1/2]

ErrorCode libe3::E3Agent::unsubscribe ( uint32_t ran_function_id)

Send a SubscriptionDelete for a previously subscribed RAN function.

Parameters
ran_function_idRAN function to unsubscribe from
Returns
ErrorCode::SUCCESS if the delete was queued, an error code otherwise

Definition at line 458 of file e3_agent.cpp.

◆ unsubscribe() [2/2]

ErrorCode libe3::E3Agent::unsubscribe ( uint32_t ran_function_id)

Delete a subscription (dApp role).

Parameters
ran_function_idRAN function it was for
Returns
ErrorCode::SUCCESS once queued

◆ wait_for_setup()

ErrorCode libe3::E3Agent::wait_for_setup ( std::chrono::milliseconds timeout)

Block until the dApp setup handshake completes.

Returns
SUCCESS on positive SetupResponse, CONNECTION_FAILED on negative, TIMEOUT if the wait elapses, INVALID_PARAM on RAN-role.
Parameters
timeoutHow long to wait at most

Definition at line 439 of file e3_agent.cpp.


The documentation for this class was generated from the following files: