Commit b9a2436f authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for SMF Event

parent e2e61fe2
......@@ -25,13 +25,13 @@ void SmfEvent::validate() {
// TODO: implement validation
}
void SmfEvent::set_value(uint8_t value) {
void SmfEvent::set_value(std::string value) {
this->value = value;
}
void SmfEvent::get_value(uint8_t& value) const {
void SmfEvent::get_value(std::string& value) const {
value = this->value;
}
uint8_t SmfEvent::get_value() const {
std::string SmfEvent::get_value() const {
return value;
}
......@@ -40,7 +40,7 @@ void to_json(nlohmann::json& j, const SmfEvent& o) {
}
void from_json(const nlohmann::json& j, SmfEvent& o) {
o.set_value(j.get<int>());
o.set_value(j.get<std::string>());
}
} // namespace model
......
......@@ -39,9 +39,9 @@ class SmfEvent {
void validate();
void set_value(uint8_t value);
void get_value(uint8_t& value) const;
uint8_t get_value() const;
void set_value(std::string value);
void get_value(std::string& value) const;
std::string get_value() const;
/////////////////////////////////////////////
/// SmfEvent members
......@@ -50,7 +50,7 @@ class SmfEvent {
protected:
private:
uint8_t value;
std::string value;
};
} // namespace model
......
......@@ -465,8 +465,29 @@ void xgpp_conv::smf_event_exposure_notification_from_openapi(
for (auto e : event_subcription_api) {
// EventSubscription: TODO
event_subscription_t event_subscription = {};
event_subscription.smf_event =
static_cast<smf_event_t>(e.getEvent().get_value());
uint8_t event_id_enum = 0;
std::string event_id = e.getEvent().get_value();
if (event_id.compare("AC_TY_CH") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_AC_TY_CH;
} else if (event_id.compare("UP_PATH_CH") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_UP_PATH_CH;
} else if (event_id.compare("PDU_SES_REL") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_PDU_SES_REL;
} else if (event_id.compare("PLMN_CH") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_PLMN_CH;
} else if (event_id.compare("UE_IP_CH") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_UE_IP_CH;
} else if (event_id.compare("DDDS") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_DDDS;
} else if (event_id.compare("FLEXCN") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_FLEXCN;
} else {
Logger::smf_api_server().debug("Unknown SMF Event %s", event_id.c_str());
break;
}
// event_subscription.smf_event =
// static_cast<smf_event_t>(e.getEvent().get_value());
// TODO: dnaiChType (for event UP path change)
// TODO: dddTraDes/ddsStati (for event downlink data delivery status)
// TODO: altNotifIpv4Addrs, altNotifIpv6Addrs, serviceName, ImmeRep,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment