O-RAN notes(7)---Bronze RICPLT xApp Deployment(2)

本文介绍了O-RAN中的xApp框架(XFW),该框架用Go、C++和Python实现,重点讨论C++版本。XFW通过RMR(RIC Message Router)实现在不知道对端IP和端口的情况下,基于消息类型进行xApp间的通信。文章以C++为例,解析了xApp如何作为Messenger子类运行,以及如何添加消息回调、监听和发送消息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(continued)

I will introduce several aspects related to xApps in following posts:

(1) xApp framework introduction

(2) HOW-TO: manually build xApps based on Gerrit sources

(3) HOW-TO: introduce policy types and policy instances

(4) HOW-TO: delete xApps and re-deploy xApps

 

Let's begin with 'xApp framework'( which will be abbreviated as XFW). XFW is implemented in three different programming languages: Go, C++ and Python. I will focus on Cpp version.

Xapp is simply a subclass of Messenger, and it provides the Run method to execute the main message loop.

// part of xapp.hpp
class Xapp : public Messenger {
	public:
		Xapp( char* listen_port, bool wait4rt );	// builder
		void Run( int nthreads );					// message listen driver
};

// part of xapp.cpp
/*
	If wait4table is true, then the construction of the object does not
	complete until the underlying transport has a new copy of the route
	table.

	If port is nil, then the default port is used (4560).
*/
Xapp::Xapp( char* port, bool wait4table ) : Messenger( port, wait4table ) {
	// nothing to do; all handled in Messenger constructor
}


Below is a typical xapp implementation: you create an Xapp instance, add message callbacks and call Run.

// part of ts_xapp.cpp
extern int main( int argc, char** argv ) {
  int nthreads = 1;
  char*	port = (char *) "4560";

  xfw = std::unique_ptr<Xapp>( new Xapp( port, true ) ); 
  
  xfw->Add_msg_cb( 20010, policy_callback, NULL );
  xfw->Add_msg_cb( 30002, prediction_callback, NULL );

  xfw->Run( nthreads );  
}

Let's take a look at the su

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值