- char *strMsg = "Subscription Request from HelloWorld XApp\0";
- strncpy((char *)data,strMsg,strlen(strMsg));
- data_size = strlen(strMsg);
+ // char *strMsg = "Subscription Request from HelloWorld XApp\0";
+ // strncpy((char *)data,strMsg,strlen(strMsg));
+ // data_size = strlen(strMsg);
+
+ subscription_helper din;
+ subscription_helper dout;
+
+ subscription_request sub_req;
+ subscription_request sub_recv;
+
+ unsigned char buf[BUFFER_SIZE];
+ size_t buf_size = BUFFER_SIZE;
+ bool res;
+
+
+ //Random Data for request
+ int request_id = 1;
+ int function_id = 0;
+ std::string event_def = "HelloWorld Event Definition";
+
+ din.set_request(request_id);
+ din.set_function_id(function_id);
+ din.set_event_def(event_def.c_str(), event_def.length());
+
+ std::string act_def = "HelloWorld Action Definition";
+
+ din.add_action(1,1,(void*)act_def.c_str(), act_def.length(), 0);
+
+ res = sub_req.encode_e2ap_subscription(&buf[0], &buf_size, din);