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 ==================================================================================
20 * e2sm_subscription.hpp
22 * Created on: Jun 30, 2020
26 #ifndef XAPP_ASN_REFACTOR_E2SM_SUBSCRIPTION_HPP_
27 #define XAPP_ASN_REFACTOR_E2SM_SUBSCRIPTION_HPP_
35 #include <mdclog/mdclog.h>
37 #include <E2SM-HelloWorld-EventTriggerDefinition.h>
38 #include <E2SM-HelloWorld-ActionDefinition.h>
39 #include <E2SM-HelloWorld-EventTriggerDefinition-Format1.h>
40 #include <E2SM-HelloWorld-ActionDefinition-Format1.h>
41 #include <HW-TriggerNature.h>
42 #include <RANparameter-Item.h>
43 #include <ProtocolIE-Field.h>
45 class HWEventTriggerDefinition {
47 HWEventTriggerDefinition(void);
48 ~HWEventTriggerDefinition(void);
50 bool encode(unsigned char *, size_t *);
51 std::string get_error (void) const {return _error_string ;};
52 int get_triggerNature(){return this->_triggerNature;};
53 HWEventTriggerDefinition& set_triggerNature(int trigger){ this->_triggerNature = trigger; return *this;};
57 E2SM_HelloWorld_EventTriggerDefinition_t * _event_trigger; // used for encoding
58 E2SM_HelloWorld_EventTriggerDefinition_Format1_t _event_fmt1;
61 size_t _errbuf_len = 128;
63 std::string _error_string;
67 class HWActionDefinition {
70 HWActionDefinition(void);
71 ~HWActionDefinition(void);
76 unsigned char _param_name[20];
77 size_t _param_name_size;
79 unsigned char _param_value[20];
80 size_t _param_value_size;
82 RANParamIEs(void):_param_id(0),_param_name_size(0), _param_test(0),_param_value_size(0){};
83 RANParamIEs& set_param_id(int param_id) {_param_id = param_id; return *this;};
84 RANParamIEs& set_param_name(std::string param_name) { _param_name_size = strlen(param_name.c_str());
85 strncpy((char*)_param_name,param_name.c_str(),_param_name_size); return *this;};
86 RANParamIEs& set_param_test(int param_test) {_param_test = param_test; return *this;};
87 RANParamIEs& set_param_value(std::string param_value) {_param_value_size = strlen(param_value.c_str());
88 strncpy((char*)_param_value,param_value.c_str(),_param_value_size); return *this;};
90 int get_param_id(){return this->_param_id;};
91 int get_param_test(){return this->_param_test;};
92 unsigned char* get_param_name(){return this->_param_name;};
93 int get_param_name_size(){return this->_param_name_size;};
94 unsigned char* get_param_value(){return this->_param_value;};
95 int get_param_value_size(){return this->_param_value_size;};
99 std::vector<RANParamIEs> * get_list() const {return _param_list.get();};
100 int get_list_count() const {return _count_list;};
101 bool encode(unsigned char *, size_t *);
102 std::string get_error (void) const {return _error_string ;};
103 void add(RANParamIEs ie_obj){
104 _param_list.get()->push_back(ie_obj);
109 std::unique_ptr<std::vector<RANParamIEs>> _param_list;
111 E2SM_HelloWorld_ActionDefinition_t* _action_defn;
112 E2SM_HelloWorld_ActionDefinition_Format1_t _action_fmt1;
113 RANparameter_Item_t* _ranparam_ie;
115 size_t _errbuf_len = 128;
117 std::string _error_string;
119 bool setfields(E2SM_HelloWorld_ActionDefinition_t *);
125 #endif /* XAPP_ASN_REFACTOR_E2SM_SUBSCRIPTION_HPP_ */