|
libe3 0.2.5
C++ library for E3AP RAN vendor integration
|
Abstract Service Model interface. More...
#include <sm_interface.hpp>
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 |
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:
Definition at line 41 of file sm_interface.hpp.
|
virtualdefault |
|
protecteddefault |
|
pure virtual |
Get control IDs supported by this SM.
Implemented in e3_service_model_handle_s.
|
pure virtual |
Destroy the SM and release resources.
Called when the SM is being unregistered.
Implemented in e3_service_model_handle_s.
Emit an outbound PDU produced by the SM.
Definition at line 178 of file sm_interface.hpp.
|
inlineprotected |
Get currently subscribed dApps for this SM's RAN function.
Definition at line 188 of file sm_interface.hpp.
|
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.
|
pure virtual |
Initialize the SM.
Called when the SM is first registered.
Implemented in e3_service_model_handle_s.
|
pure virtual |
Check if SM is currently running.
Implemented in e3_service_model_handle_s.
|
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.
|
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.
|
pure virtual |
Get SM name.
Implemented in e3_service_model_handle_s.
|
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.
|
pure virtual |
Get RAN function ID for this SM.
Implemented in e3_service_model_handle_s.
|
inlineprotected |
Set the outbound PDU emitter callback (used by E3Interface).
Definition at line 198 of file sm_interface.hpp.
|
inlineprotected |
Set subscriber provider callback (used by E3Interface).
Definition at line 205 of file sm_interface.hpp.
|
pure virtual |
Start the SM processing.
Called when the first dApp subscribes to this SM's RAN function.
Implemented in e3_service_model_handle_s.
|
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.
|
pure virtual |
Get telemetry IDs supported by this SM.
Implemented in e3_service_model_handle_s.
|
pure virtual |
Get SM version.
Implemented in e3_service_model_handle_s.
|
friend |
Definition at line 213 of file sm_interface.hpp.