X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fxapp-asn%2Fe2sm%2Fe2sm_indication.hpp;h=4d820b7b9e6b769186d696c53f19610c32d4278e;hb=28b894594573ab1e7087ed8fb50b208d7b135b07;hp=a7fcdd751740c7ed33c5ea03b8cd82cd2cffb2eb;hpb=6d677813b02deda27db8039ec0de86a5332caa1f;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..4d820b7 100644 --- a/src/xapp-asn/e2sm/e2sm_indication.hpp +++ b/src/xapp-asn/e2sm/e2sm_indication.hpp @@ -26,9 +26,7 @@ /* 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 @@ -38,38 +36,62 @@ #include #include #include - -class e2sm_indication { +class HWIndicationHeader { public: - e2sm_indication(void); - ~e2sm_indication(void); + HWIndicationHeader(void); + HWIndicationHeader(unsigned char*, size_t *, bool&); + ~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 &); +private: - bool get_fields(E2SM_HelloWorld_IndicationHeader_t *, e2sm_indication_helper &); - bool get_fields(E2SM_HelloWorld_IndicationMessage_t *, e2sm_indication_helper &); + long int _hw_header; + E2SM_HelloWorld_IndicationHeader_t * _header; // used for encoding + E2SM_HelloWorld_IndicationHeader_Format1_t _header_fmt1; - bool encode_indication_header(unsigned char *, size_t *, e2sm_indication_helper &); - bool encode_indication_message(unsigned char*, size_t *, e2sm_indication_helper &); + bool setfields(E2SM_HelloWorld_IndicationHeader_t *); + size_t _errbuf_len = 128; + char _errbuf[128]; + std::string _error_string; +}; +class HWIndicationMessage { +public: + HWIndicationMessage(void); + HWIndicationMessage(unsigned char*, size_t *, bool&); + ~HWIndicationMessage(void); - std::string get_error (void) const {return error_string ;}; + 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(unsigned char* msg, size_t *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; + 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_ */