43#ifndef LIBE3_PY_E3_DAPP_SESSION_HPP
44#define LIBE3_PY_E3_DAPP_SESSION_HPP
181 int64_t
subscribe(uint32_t ran_function_id,
182 std::vector<uint32_t> telemetry_ids,
183 std::vector<uint32_t> control_ids,
205 int64_t
send_control(uint32_t ran_function_id, uint32_t control_id,
206 std::vector<uint8_t> action_data,
207 uint32_t sequence_id = 0,
208 bool request_ack =
false);
220 int64_t
send_report(uint32_t ran_function_id, std::vector<uint8_t> report_data,
221 uint32_t sequence_id);
237 int response_code,
int cause, std::string detail,
238 std::vector<uint8_t> outcome);
253 std::vector<E3Event>
poll_events(std::size_t max_batch,
int timeout_ms);
260 std::unique_ptr<Impl> impl_;
uint32_t setup_ran_function_id(std::size_t i) const
RAN function id of an advertised entry.
int send_control_response(uint32_t request_id, uint32_t ran_function_id, uint32_t control_id, int response_code, int cause, std::string detail, std::vector< uint8_t > outcome)
Answer an xApp control that has request_ack (E3_EVENT_XAPP_CONTROL).
int setup_response_code() const
SetupResponse code.
int unsubscribe(uint32_t ran_function_id)
Delete a previously created subscription.
std::vector< E3Event > poll_events(std::size_t max_batch, int timeout_ms)
Drain up to max_batch inbound events, waiting up to timeout_ms for the first.
std::vector< uint8_t > setup_ran_function_data(std::size_t i) const
Opaque ranFunctionData bytes of an advertised entry.
std::vector< uint32_t > setup_ran_function_telemetry(std::size_t i) const
Telemetry ids of an advertised entry.
std::string ran_identifier() const
RAN identifier from the SetupResponse.
unsigned long long dropped_events() const
Total inbound events dropped due to ring overflow (backpressure).
void stop()
Stop the agent and shut down the ring so a blocked poll_events returns an empty batch (i....
int release()
Send a ReleaseMessage (session keeps running until stop).
DAppSession & operator=(const DAppSession &)=delete
DAppSession(const DAppSession &)=delete
int send_message_ack(uint32_t request_id, int response_code)
Acknowledge a request. DEPRECATED TO BE REMOVED: answer an xApp control with send_control_response.
int start()
Start the agent, re-arming the inbound ring so a stop()->start() cycle works again.
int wait_for_setup(int timeout_ms)
Block until the setup handshake completes.
~DAppSession()
Stops the agent and drops the queue.
int64_t send_report(uint32_t ran_function_id, std::vector< uint8_t > report_data, uint32_t sequence_id)
Send a dApp report to the RAN.
int64_t send_control(uint32_t ran_function_id, uint32_t control_id, std::vector< uint8_t > action_data, uint32_t sequence_id=0, bool request_ack=false)
Send a dApp control action to the RAN.
long dapp_id() const
dApp id assigned at setup.
int64_t subscribe(uint32_t ran_function_id, std::vector< uint32_t > telemetry_ids, std::vector< uint32_t > control_ids, int sub_time_ms, int periodicity)
Subscribe to a RAN function (after a positive setup).
std::size_t setup_ran_function_count() const
Number of RAN functions advertised in the SetupResponse.
DAppSession(libe3::E3Config config, std::size_t queue_capacity=8192)
Construct the session and register all inbound handlers.
std::vector< uint32_t > setup_ran_function_control(std::size_t i) const
Control ids of an advertised entry.
E3EventKind
Discriminator for libe3::py::E3Event.
@ E3_EVENT_NONE
placeholder (never enqueued)
@ E3_EVENT_SUBSCRIPTION_RESPONSE
RAN → dApp SubscriptionResponse.
@ E3_EVENT_SETUP_RESPONSE
RAN → dApp SetupResponse.
@ E3_EVENT_INDICATION
RAN → dApp IndicationMessage.
@ E3_EVENT_DISCONNECT
the RAN is gone; see E3Event::disconnect_reason
@ E3_EVENT_XAPP_CONTROL
xApp → dApp XAppControlAction
@ E3_EVENT_CONTROL_RESPONSE
RAN → dApp ControlResponse.
@ E3_EVENT_MESSAGE_ACK
RAN → dApp MessageAck. DEPRECATED TO BE REMOVED: libe3 does not send one.
Configuration for E3Agent.
What a DAppSession holds: the agent, the event queue and the setup snapshot.
One inbound E3AP event, POD-flat for a clean SWIG crossing.
uint32_t ran_function_id
RAN function (indication / xApp control / subscription response).
uint32_t sequence_id
loop correlation id (xApp control); echo it on the control you re-issue
int kind
one of E3EventKind
uint32_t dapp_id
dApp identifier the message targets
std::vector< uint32_t > control_granted
granted control ids
bool has_outcome
control response: payload is the Service Model's outcome
std::vector< uint32_t > telemetry_granted
granted telemetry ids
uint32_t request_id
request/message id (subscription response / control response / xApp control); for a control response,...
int disconnect_reason
disconnect: 0=released by RAN, 1=connection lost, -1=n/a
long periodicity
least microseconds the RAN keeps between two indications (subscription response), -1 = not reported
uint32_t subscription_id
subscription id (subscription response)
int response_code
0=positive, 1=negative, -1=n/a
bool has_control_granted
control_granted was reported
uint64_t trace_seq
set when queued; keys the [latrec] LQ-stage records
std::vector< uint8_t > payload
opaque E3SM bytes (indication / xApp control)
int cause
why a negative response (setup, subscription or control) was refused, a libe3::Cause value 0 to 14; -...
bool request_ack
xApp control: the RAN wants a control response; answer it with send_control_response
bool has_telemetry_granted
telemetry_granted was reported
uint32_t control_id
control identifier (control response)
std::string detail
the RAN's text for the refusal; empty = none given
E3AP Protocol Types - Vendor-neutral type definitions.