a7fcdd751740c7ed33c5ea03b8cd82cd2cffb2eb
[ric-app/hw.git] / src / xapp-asn / e2sm / e2sm_indication.hpp
1 /*
2 ==================================================================================
3
4         Copyright (c) 2019-2020 AT&T Intellectual Property.
5
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
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
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 ==================================================================================
18 */
19 /*
20  * e2sm_indication.hpp
21  *
22  *  Created on: Apr, 2020
23  *      Author: Shraboni Jana
24  */
25
26 /* Classes to handle E2 service model based on e2sm-HelloWorld-v001.asn */
27 #ifndef SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_
28 #define SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_
29
30 #include <sstream>
31 #include <e2sm_helpers.hpp>
32 #include <mdclog/mdclog.h>
33 #include <vector>
34
35 #include <E2SM-HelloWorld-IndicationHeader.h>
36 #include <E2SM-HelloWorld-IndicationMessage.h>
37 #include <E2SM-HelloWorld-IndicationHeader-Format1.h>
38 #include <E2SM-HelloWorld-IndicationMessage-Format1.h>
39 #include <HW-Header.h>
40 #include <HW-Message.h>
41
42 class e2sm_indication {
43 public:
44         e2sm_indication(void);
45   ~e2sm_indication(void);
46
47   bool set_fields(E2SM_HelloWorld_IndicationHeader_t *, e2sm_indication_helper &);
48   bool set_fields(E2SM_HelloWorld_IndicationMessage_t *, e2sm_indication_helper &);
49
50   bool get_fields(E2SM_HelloWorld_IndicationHeader_t *, e2sm_indication_helper &);
51   bool get_fields(E2SM_HelloWorld_IndicationMessage_t *, e2sm_indication_helper &);
52
53   bool encode_indication_header(unsigned char *, size_t *, e2sm_indication_helper &);
54   bool encode_indication_message(unsigned char*, size_t *, e2sm_indication_helper &);
55
56
57   std::string  get_error (void) const {return error_string ;};
58
59 private:
60
61   E2SM_HelloWorld_IndicationHeader_t * indication_head; // used for encoding
62   E2SM_HelloWorld_IndicationMessage_t* indication_msg;
63   E2SM_HelloWorld_IndicationHeader_Format1_t head_fmt1;
64   E2SM_HelloWorld_IndicationMessage_Format1_t msg_fmt1;
65
66
67   size_t errbuf_len;
68   char errbuf[128];
69   std::string error_string;
70 };
71
72
73
74
75 #endif /* SRC_XAPP_ASN_E2SM_E2SM_INDICATION_HPP_ */