X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fxapp-asn%2Fe2sm%2Fe2sm_indication.hpp;h=00c2a23968de74823735588411d663df7c295aa1;hb=ea129fa14c89d8f5cedacd9afc1e4dd7a30f1ae4;hp=a7fcdd751740c7ed33c5ea03b8cd82cd2cffb2eb;hpb=0f5c234d5da8897f2f831e02ff03912e582ba6e9;p=ric-app%2Fhw.git diff --git a/src/xapp-asn/e2sm/e2sm_indication.hpp b/src/xapp-asn/e2sm/e2sm_indication.hpp index a7fcdd7..00c2a23 100644 --- a/src/xapp-asn/e2sm/e2sm_indication.hpp +++ b/src/xapp-asn/e2sm/e2sm_indication.hpp @@ -26,50 +26,78 @@ /* Classes to handle E2 service model based on e2sm-HelloWorld-v001.asn */ #ifndef SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_ #define SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_ - #include -#include #include #include - +#include #include #include #include #include #include #include - -class e2sm_indication { +class HWIndicationHeader { public: - e2sm_indication(void); - ~e2sm_indication(void); + HWIndicationHeader(void); + HWIndicationHeader(unsigned char*, size_t *); + ~HWIndicationHeader(void); + std::string get_error (void) const {return _error_string ;}; + + long int get_hw_header(){return this->_hw_header;}; + + HWIndicationHeader& set_ricIndicationHeader(int param_header){ + _hw_header = param_header; return *this; + } + bool decode(unsigned char*, size_t *); + bool encode(unsigned char*, size_t *); - bool set_fields(E2SM_HelloWorld_IndicationHeader_t *, e2sm_indication_helper &); - bool set_fields(E2SM_HelloWorld_IndicationMessage_t *, e2sm_indication_helper &); - bool get_fields(E2SM_HelloWorld_IndicationHeader_t *, e2sm_indication_helper &); - bool get_fields(E2SM_HelloWorld_IndicationMessage_t *, e2sm_indication_helper &); +private: - bool encode_indication_header(unsigned char *, size_t *, e2sm_indication_helper &); - bool encode_indication_message(unsigned char*, size_t *, e2sm_indication_helper &); + long int _hw_header; + E2SM_HelloWorld_IndicationHeader_t * _header; // used for encoding + E2SM_HelloWorld_IndicationHeader_Format1_t _header_fmt1; + bool setfields(E2SM_HelloWorld_IndicationHeader_t *); - std::string get_error (void) const {return error_string ;}; + size_t _errbuf_len = 128; + char _errbuf[128]; + std::string _error_string; +}; +class HWIndicationMessage { +public: + HWIndicationMessage(void); + HWIndicationMessage(unsigned char*, size_t *); + ~HWIndicationMessage(void); + + std::string get_error (void) const {return _error_string ;}; + bool decode(unsigned char*, size_t *); + bool encode(unsigned char*, size_t *); + + size_t get_hw_message_size(){return this->_hw_msg_size;}; + unsigned char* get_hw_message(){return this->_hw_msg;}; + HWIndicationMessage& set_hw_message(std::string msg) + { + _hw_msg_size=strlen(msg.c_str()); + strncpy((char*)_hw_msg,msg.c_str(),_hw_msg_size); + return *this; + } private: - E2SM_HelloWorld_IndicationHeader_t * indication_head; // used for encoding - E2SM_HelloWorld_IndicationMessage_t* indication_msg; - E2SM_HelloWorld_IndicationHeader_Format1_t head_fmt1; - E2SM_HelloWorld_IndicationMessage_Format1_t msg_fmt1; + size_t _hw_msg_size; + unsigned char _hw_msg[30]; + E2SM_HelloWorld_IndicationMessage_t* _message; + E2SM_HelloWorld_IndicationMessage_Format1_t _message_fmt1; - size_t errbuf_len; - char errbuf[128]; - std::string error_string; -}; + bool setfields(E2SM_HelloWorld_IndicationMessage_t *); + size_t _errbuf_len = 128; + char _errbuf[128]; + std::string _error_string; +}; +#endif -#endif /* SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_ */