libe3 0.6.1
C++ library for E3AP RAN vendor integration
Loading...
Searching...
No Matches
e3_service_model_handle_s Struct Reference

What e3_service_model_handle_t points to: a ServiceModel that calls back into C. More...

Inheritance diagram for e3_service_model_handle_s:
libe3::ServiceModel

Public Member Functions

 e3_service_model_handle_s (const e3_c_service_model_desc_t &desc)
 Copy a descriptor.
std::string name () const override
 Get SM name.
uint32_t version () const override
 Get SM version.
uint32_t ran_function_id () const override
 Get RAN function ID for this SM.
std::vector< uint32_t > telemetry_ids () const override
 Get telemetry IDs supported by this SM.
std::vector< uint32_t > control_ids () const override
 Get control IDs supported by this SM.
std::vector< uint8_t > ran_function_data () const override
 RAN-function-specific opaque data (required, 1..32768 bytes).
ErrorCode init () override
 Initialize the SM.
void destroy () override
 Destroy the SM and release resources.
ErrorCode start () override
 Start the SM processing.
void stop () override
 Stop the SM processing.
bool is_running () const override
 Check if SM is currently running.
std::optional< uint32_t > granted_periodicity (uint32_t requested_us) const override
 The least time between two indications that this SM keeps for a subscription.
ErrorCode handle_control_action (uint32_t request_message_id, const DAppControlAction &action) override
 Process a control action from a dApp.
ErrorCode emit_pdu (Pdu &&pdu)
 Queue a PDU the SM emits.
ErrorCode answer_control (uint32_t dapp_id, uint32_t request_id, const ControlResult &result)
 Answer a dApp control.
Public Member Functions inherited from libe3::ServiceModel
virtual ~ServiceModel ()=default

Public Attributes

std::string name_s
 Service Model name.
uint32_t version_s
 Service Model version.
uint32_t ran_function_id_s
 RAN function identifier.
std::vector< uint32_t > telemetry_ids_s
 Telemetry identifiers it supports.
std::vector< uint32_t > control_ids_s
 Control identifiers it supports.
std::vector< uint8_t > ran_function_data_s
 Opaque RAN function data.
e3_sm_init_cb sm_init = nullptr
 Called on registration.
e3_sm_destroy_cb sm_destroy = nullptr
 Called on destruction.
e3_sm_start_cb sm_start = nullptr
 Called when the SM should start.
e3_sm_stop_cb sm_stop = nullptr
 Called when the SM should stop.
e3_sm_is_running_cb sm_is_running = nullptr
 Called to ask whether the SM runs.
e3_sm_process_control_cb sm_process_control = nullptr
 Called for each control action.
e3_sm_granted_periodicity_cb sm_granted_periodicity = nullptr
 Asked for the interval it keeps.
void * sm_context = nullptr
 Passed to every callback.
bool transferred_to_agent = false
 Whether ownership was transferred to an agent.

Additional Inherited Members

Protected Member Functions inherited from libe3::ServiceModel
 ServiceModel ()=default
ErrorCode respond_to_control (uint32_t dapp_id, uint32_t request_message_id, const ControlResult &result)
 Answer a dApp control.
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_control_responder (std::function< ErrorCode(uint32_t, uint32_t, const ControlResult &)> responder)
 Set the control responder 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 inherited from libe3::ServiceModel
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.

Detailed Description

What e3_service_model_handle_t points to: a ServiceModel that calls back into C.

Definition at line 32 of file c_api.cpp.

Constructor & Destructor Documentation

◆ e3_service_model_handle_s()

e3_service_model_handle_s::e3_service_model_handle_s ( const e3_c_service_model_desc_t & desc)
inlineexplicit

Copy a descriptor.

Parameters
descWhat the C caller described

Definition at line 58 of file c_api.cpp.

Member Function Documentation

◆ answer_control()

ErrorCode e3_service_model_handle_s::answer_control ( uint32_t dapp_id,
uint32_t request_id,
const ControlResult & result )
inline

Answer a dApp control.

Parameters
dapp_iddApp that sent the control
request_idMessage id of the control
resultThe answer
Returns
What ServiceModel::respond_to_control returns

Definition at line 148 of file c_api.cpp.

◆ control_ids()

std::vector< uint32_t > e3_service_model_handle_s::control_ids ( ) const
inlineoverridevirtual

Get control IDs supported by this SM.

Returns
The control identifiers the SM supports

Implements libe3::ServiceModel.

Definition at line 86 of file c_api.cpp.

◆ destroy()

void e3_service_model_handle_s::destroy ( )
inlineoverridevirtual

Destroy the SM and release resources.

Called when the SM is being unregistered.

Implements libe3::ServiceModel.

Definition at line 92 of file c_api.cpp.

◆ emit_pdu()

ErrorCode e3_service_model_handle_s::emit_pdu ( Pdu && pdu)
inline

Queue a PDU the SM emits.

Parameters
pduThe PDU
Returns
ErrorCode::SUCCESS if it was queued

Definition at line 137 of file c_api.cpp.

◆ granted_periodicity()

std::optional< uint32_t > e3_service_model_handle_s::granted_periodicity ( uint32_t requested_us) const
inlineoverridevirtual

The least time between two indications that this SM keeps for a subscription.

Sent to the dApp as the granted periodicity of its SubscriptionResponse. Override it only when the SM itself keeps its indications at least that far apart. The base implementation reports nothing, so the response then carries no periodicity ("not reported").

Parameters
requested_usPeriodicity the dApp asked for, in microseconds. 0 when it asked for none or for one indication per event.
Returns
Microseconds between two indications. std::nullopt or 0 when the SM keeps no interval or does not say; the response then has none.

Reimplemented from libe3::ServiceModel.

Definition at line 107 of file c_api.cpp.

◆ handle_control_action()

ErrorCode e3_service_model_handle_s::handle_control_action ( uint32_t request_message_id,
const DAppControlAction & action )
inlineoverridevirtual

Process a control action from a dApp.

Called by the E3 interface when a DAppControlAction is received for this service model. Implementations answer it with respond_to_control() and can emit outbound PDUs (e.g. IndicationMessage) via emit_outbound().

Parameters
request_message_idMessage identifier of the DAppControlAction
actionThe control action
Returns
ErrorCode::SUCCESS if the SM took the action

Implements libe3::ServiceModel.

Definition at line 112 of file c_api.cpp.

◆ init()

ErrorCode e3_service_model_handle_s::init ( )
inlineoverridevirtual

Initialize the SM.

Called when the SM is first registered.

Returns
ErrorCode::SUCCESS on success

Implements libe3::ServiceModel.

Definition at line 88 of file c_api.cpp.

◆ is_running()

bool e3_service_model_handle_s::is_running ( ) const
inlineoverridevirtual

Check if SM is currently running.

Returns
True while the SM is processing

Implements libe3::ServiceModel.

Definition at line 102 of file c_api.cpp.

◆ name()

std::string e3_service_model_handle_s::name ( ) const
inlineoverridevirtual

Get SM name.

Returns
The name of the SM

Implements libe3::ServiceModel.

Definition at line 82 of file c_api.cpp.

◆ ran_function_data()

std::vector< uint8_t > e3_service_model_handle_s::ran_function_data ( ) const
inlineoverridevirtual

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..262144)), limited to 32768 bytes – 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.

Returns
The bytes advertised for this RAN function; registration fails if the vector is empty or oversized.

Reimplemented from libe3::ServiceModel.

Definition at line 87 of file c_api.cpp.

◆ ran_function_id()

uint32_t e3_service_model_handle_s::ran_function_id ( ) const
inlineoverridevirtual

Get RAN function ID for this SM.

Returns
The RAN function this SM serves

Implements libe3::ServiceModel.

Definition at line 84 of file c_api.cpp.

◆ start()

ErrorCode e3_service_model_handle_s::start ( )
inlineoverridevirtual

Start the SM processing.

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

Returns
ErrorCode::SUCCESS on success

Implements libe3::ServiceModel.

Definition at line 95 of file c_api.cpp.

◆ stop()

void e3_service_model_handle_s::stop ( )
inlineoverridevirtual

Stop the SM processing.

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

Implements libe3::ServiceModel.

Definition at line 99 of file c_api.cpp.

◆ telemetry_ids()

std::vector< uint32_t > e3_service_model_handle_s::telemetry_ids ( ) const
inlineoverridevirtual

Get telemetry IDs supported by this SM.

Returns
The telemetry identifiers the SM supports

Implements libe3::ServiceModel.

Definition at line 85 of file c_api.cpp.

◆ version()

uint32_t e3_service_model_handle_s::version ( ) const
inlineoverridevirtual

Get SM version.

Returns
The version number of the SM

Implements libe3::ServiceModel.

Definition at line 83 of file c_api.cpp.

Member Data Documentation

◆ control_ids_s

std::vector<uint32_t> e3_service_model_handle_s::control_ids_s

Control identifiers it supports.

Definition at line 38 of file c_api.cpp.

◆ name_s

std::string e3_service_model_handle_s::name_s

Service Model name.

Definition at line 34 of file c_api.cpp.

◆ ran_function_data_s

std::vector<uint8_t> e3_service_model_handle_s::ran_function_data_s

Opaque RAN function data.

Definition at line 39 of file c_api.cpp.

◆ ran_function_id_s

uint32_t e3_service_model_handle_s::ran_function_id_s

RAN function identifier.

Definition at line 36 of file c_api.cpp.

◆ sm_context

void* e3_service_model_handle_s::sm_context = nullptr

Passed to every callback.

Definition at line 49 of file c_api.cpp.

◆ sm_destroy

e3_sm_destroy_cb e3_service_model_handle_s::sm_destroy = nullptr

Called on destruction.

Definition at line 43 of file c_api.cpp.

◆ sm_granted_periodicity

e3_sm_granted_periodicity_cb e3_service_model_handle_s::sm_granted_periodicity = nullptr

Asked for the interval it keeps.

Definition at line 48 of file c_api.cpp.

◆ sm_init

e3_sm_init_cb e3_service_model_handle_s::sm_init = nullptr

Called on registration.

Definition at line 42 of file c_api.cpp.

◆ sm_is_running

e3_sm_is_running_cb e3_service_model_handle_s::sm_is_running = nullptr

Called to ask whether the SM runs.

Definition at line 46 of file c_api.cpp.

◆ sm_process_control

e3_sm_process_control_cb e3_service_model_handle_s::sm_process_control = nullptr

Called for each control action.

Definition at line 47 of file c_api.cpp.

◆ sm_start

e3_sm_start_cb e3_service_model_handle_s::sm_start = nullptr

Called when the SM should start.

Definition at line 44 of file c_api.cpp.

◆ sm_stop

e3_sm_stop_cb e3_service_model_handle_s::sm_stop = nullptr

Called when the SM should stop.

Definition at line 45 of file c_api.cpp.

◆ telemetry_ids_s

std::vector<uint32_t> e3_service_model_handle_s::telemetry_ids_s

Telemetry identifiers it supports.

Definition at line 37 of file c_api.cpp.

◆ transferred_to_agent

bool e3_service_model_handle_s::transferred_to_agent = false

Whether ownership was transferred to an agent.

Definition at line 52 of file c_api.cpp.

◆ version_s

uint32_t e3_service_model_handle_s::version_s

Service Model version.

Definition at line 35 of file c_api.cpp.


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