2 ==================================================================================
4 Copyright (c) 2019-2020 AT&T Intellectual Property.
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================================
22 * Created on: Apr, 2020
23 * Author: Shraboni Jana
26 /* Classes to handle E2 service model based on e2sm-HelloWorld-v001.asn */
27 #ifndef SRC_XAPP_ASN_E2SM_E2SM_CONTROL_HPP_
28 #define SRC_XAPP_ASN_E2SM_E2SM_CONTROL_HPP_
31 #include <mdclog/mdclog.h>
34 #include <E2SM-HelloWorld-ControlHeader.h>
35 #include <E2SM-HelloWorld-ControlMessage.h>
36 #include <E2SM-HelloWorld-ControlHeader-Format1.h>
37 #include <E2SM-HelloWorld-ControlMessage-Format1.h>
38 #include <HW-Header.h>
39 #include <HW-Message.h>
41 class HWControlHeader {
43 HWControlHeader(void);
44 HWControlHeader(unsigned char*, size_t *, bool&);
45 ~HWControlHeader(void);
46 std::string get_error (void) const {return _error_string ;};
48 long int get_hw_header(){return this->_hw_header;};
50 HWControlHeader& set_ricControlHeader(int param_header){
51 _hw_header = param_header; return *this;
55 bool decode(unsigned char*, size_t *);
56 bool encode(unsigned char*, size_t *);
62 E2SM_HelloWorld_ControlHeader_t * _header; // used for encoding
63 E2SM_HelloWorld_ControlHeader_Format1_t _header_fmt1;
65 bool setfields(E2SM_HelloWorld_ControlHeader_t *);
67 size_t _errbuf_len = 128;
69 std::string _error_string;
73 class HWControlMessage {
75 HWControlMessage(void);
76 HWControlMessage(unsigned char*, size_t *, bool&);
77 ~HWControlMessage(void);
79 std::string get_error (void) const {return _error_string ;};
80 bool decode(unsigned char*, size_t *);
81 bool encode(unsigned char*, size_t *);
84 size_t get_hw_message_size(){return this->_hw_msg_size;};
85 unsigned char* get_hw_message(){return this->_hw_msg;};
87 HWControlMessage& set_ricControlMessage(std::string msg){
88 _hw_msg_size = strlen(msg.c_str());
89 strncpy((char*)_hw_msg,msg.c_str(),_hw_msg_size);
96 unsigned char _hw_msg[128];
98 E2SM_HelloWorld_ControlMessage_t* _message;
99 E2SM_HelloWorld_ControlMessage_Format1_t _message_fmt1;
101 bool setfields(E2SM_HelloWorld_ControlMessage_t *);
103 size_t _errbuf_len = 128;
105 std::string _error_string;
108 #endif /* SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_ */