libe3 0.2.5
C++ library for E3AP RAN vendor integration
Loading...
Searching...
No Matches
libe3::ServiceModel Class Referenceabstract

Abstract Service Model interface. More...

#include <sm_interface.hpp>

Inheritance diagram for libe3::ServiceModel:
e3_service_model_handle_s

Public Member Functions

virtual ~ServiceModel ()=default
virtual std::string name () const =0
 Get SM name.
virtual uint32_t version () const =0
 Get SM version.
virtual uint32_t ran_function_id () const =0
 Get RAN function ID for this SM.
virtual std::vector< uint32_t > telemetry_ids () const =0
 Get telemetry IDs supported by this SM.
virtual std::vector< uint32_t > control_ids () const =0
 Get control IDs supported by this SM.
virtual std::vector< uint8_t > ran_function_data () const
 RAN-function-specific opaque data (required, 1..32768 bytes).
virtual ErrorCode init ()=0
 Initialize the SM.
virtual void destroy ()=0
 Destroy the SM and release resources.
virtual ErrorCode start ()=0
 Start the SM processing.
virtual void stop ()=0
 Stop the SM processing.
virtual bool is_running () const =0
 Check if SM is currently running.
virtual ErrorCode handle_control_action (uint32_t request_message_id, const DAppControlAction &action)=0
 Process a control action from a dApp.

Protected Member Functions

 ServiceModel ()=default
ErrorCode emit_outbound (Pdu &&pdu)
 Emit an outbound PDU produced by the SM.
std::vector< uint32_t > get_subscribers () const
 Get currently subscribed dApps for this SM's RAN function.
void set_outbound_emitter (std::function< ErrorCode(Pdu &&)> emitter)
 Set the outbound PDU emitter callback (used by E3Interface).
void set_subscribers_provider (std::function< std::vector< uint32_t >()> provider)
 Set subscriber provider callback (used by E3Interface).

Static Protected Member Functions

static Pdu make_message_ack_pdu (uint32_t request_message_id, ResponseCode response_code)
 Build a MessageAck PDU for a control/request message.
static Pdu make_indication_pdu (uint32_t dapp_id, uint32_t ran_function_id, std::vector< uint8_t > protocol_data)
 Build an IndicationMessage PDU.

Friends

class E3Interface

Detailed Description

Abstract Service Model interface.

This is the extension point for RAN vendors to implement their Service Models. The E3 agent treats E3SM as opaque - all SM-specific encoding/decoding happens in the implementations of this interface.

RAN vendors should:

  1. Derive from this class for each supported SM
  2. Implement the required virtual methods
  3. Register their SMs with the E3Agent

Definition at line 41 of file sm_interface.hpp.

Constructor & Destructor Documentation

◆ ~ServiceModel()

virtual libe3::ServiceModel::~ServiceModel ( )
virtualdefault

◆ ServiceModel()

libe3::ServiceModel::ServiceModel ( )
protecteddefault

Member Function Documentation

◆ control_ids()

virtual std::vector< uint32_t > libe3::ServiceModel::control_ids ( ) const
pure virtual

Get control IDs supported by this SM.

Implemented in e3_service_model_handle_s.

◆ destroy()

virtual void libe3::ServiceModel::destroy ( )
pure virtual

Destroy the SM and release resources.

Called when the SM is being unregistered.

Implemented in e3_service_model_handle_s.

◆ emit_outbound()

ErrorCode libe3::ServiceModel::emit_outbound ( Pdu && pdu)
inlineprotected

Emit an outbound PDU produced by the SM.

Definition at line 178 of file sm_interface.hpp.

◆ get_subscribers()

std::vector< uint32_t > libe3::ServiceModel::get_subscribers ( ) const
inlineprotected

Get currently subscribed dApps for this SM's RAN function.

Definition at line 188 of file sm_interface.hpp.

◆ handle_control_action()

virtual ErrorCode libe3::ServiceModel::handle_control_action ( uint32_t request_message_id,
const DAppControlAction & action )
pure virtual

Process a control action from a dApp.

Called by the E3 interface when a DAppControlAction is received for this service model. Implementations can emit outbound PDUs (e.g. MessageAck, IndicationMessage) via emit_outbound().

Implemented in e3_service_model_handle_s.

◆ init()

virtual ErrorCode libe3::ServiceModel::init ( )
pure virtual

Initialize the SM.

Called when the SM is first registered.

Returns
ErrorCode::SUCCESS on success

Implemented in e3_service_model_handle_s.

◆ is_running()

virtual bool libe3::ServiceModel::is_running ( ) const
pure virtual

Check if SM is currently running.

Implemented in e3_service_model_handle_s.

◆ make_indication_pdu()

Pdu libe3::ServiceModel::make_indication_pdu ( uint32_t dapp_id,
uint32_t ran_function_id,
std::vector< uint8_t > protocol_data )
inlinestaticprotected

Build an IndicationMessage PDU.

This helper only builds the PDU. Implementations can emit it with emit_outbound() when appropriate.

Definition at line 161 of file sm_interface.hpp.

◆ make_message_ack_pdu()

Pdu libe3::ServiceModel::make_message_ack_pdu ( uint32_t request_message_id,
ResponseCode response_code )
inlinestaticprotected

Build a MessageAck PDU for a control/request message.

This helper only builds the PDU. Implementations can decide whether to emit it with emit_outbound() or suppress it when protocol semantics allow.

Definition at line 143 of file sm_interface.hpp.

◆ name()

virtual std::string libe3::ServiceModel::name ( ) const
pure virtual

Get SM name.

Implemented in e3_service_model_handle_s.

◆ ran_function_data()

virtual std::vector< uint8_t > libe3::ServiceModel::ran_function_data ( ) const
inlinevirtual

RAN-function-specific opaque data (required, 1..32768 bytes).

Returns the byte vector advertised for this RAN function in the SetupResponse (ranFunctionList->ranFunctionData). E3AP declares the field mandatory and non-empty – OCTET STRING (SIZE (1..32768)) – so every SM must override this: even the most minimal SM carries at least its own name. An SM with nothing to advertise is not advertisable at all, since ranFunctionList itself is optional but its entries are not.

Registration fails with ErrorCode::INVALID_PARAM if the returned vector is empty or longer than MAX_PROTOCOL_DATA_SIZE. The base implementation returns an empty vector so that failure is a loud diagnostic rather than a compile error in every existing SM; it is not a usable default.

Reimplemented in e3_service_model_handle_s.

Definition at line 85 of file sm_interface.hpp.

◆ ran_function_id()

virtual uint32_t libe3::ServiceModel::ran_function_id ( ) const
pure virtual

Get RAN function ID for this SM.

Implemented in e3_service_model_handle_s.

◆ set_outbound_emitter()

void libe3::ServiceModel::set_outbound_emitter ( std::function< ErrorCode(Pdu &&)> emitter)
inlineprotected

Set the outbound PDU emitter callback (used by E3Interface).

Definition at line 198 of file sm_interface.hpp.

◆ set_subscribers_provider()

void libe3::ServiceModel::set_subscribers_provider ( std::function< std::vector< uint32_t >()> provider)
inlineprotected

Set subscriber provider callback (used by E3Interface).

Definition at line 205 of file sm_interface.hpp.

◆ start()

virtual ErrorCode libe3::ServiceModel::start ( )
pure virtual

Start the SM processing.

Called when the first dApp subscribes to this SM's RAN function.

Returns
ErrorCode::SUCCESS on success

Implemented in e3_service_model_handle_s.

◆ stop()

virtual void libe3::ServiceModel::stop ( )
pure virtual

Stop the SM processing.

Called when the last dApp unsubscribes from this SM's RAN function.

Implemented in e3_service_model_handle_s.

◆ telemetry_ids()

virtual std::vector< uint32_t > libe3::ServiceModel::telemetry_ids ( ) const
pure virtual

Get telemetry IDs supported by this SM.

Implemented in e3_service_model_handle_s.

◆ version()

virtual uint32_t libe3::ServiceModel::version ( ) const
pure virtual

Get SM version.

Implemented in e3_service_model_handle_s.

◆ E3Interface

friend class E3Interface
friend

Definition at line 213 of file sm_interface.hpp.


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