Commit 538ba20f authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix issue to create Edge from UPF info

parent e78d8e49
...@@ -441,7 +441,7 @@ typedef struct snssai_upf_info_item_s { ...@@ -441,7 +441,7 @@ typedef struct snssai_upf_info_item_s {
std::string to_string() const { std::string to_string() const {
std::string s = {}; std::string s = {};
s.append("SNSSAI Info: " + snssai.toString() + ","); s.append("SNSSAI Info: " + snssai.toString() + ", ");
if (dnn_upf_info_list.size() > 0) { if (dnn_upf_info_list.size() > 0) {
s.append("DNN UPF Info list: {"); s.append("DNN UPF Info list: {");
......
...@@ -52,9 +52,20 @@ edge edge::from_upf_info(const upf_info_t& upf_info) { ...@@ -52,9 +52,20 @@ edge edge::from_upf_info(const upf_info_t& upf_info) {
"Edge from UPF info, UPF info %s", upf_info.to_string().c_str()); "Edge from UPF info, UPF info %s", upf_info.to_string().c_str());
for (const auto& snssai : upf_info.snssai_upf_info_list) { for (const auto& snssai : upf_info.snssai_upf_info_list) {
snssai_item.snssai = snssai.snssai; snssai_item.snssai = snssai.snssai;
snssai_item.dnn_upf_info_list = snssai.dnn_upf_info_list; bool found = false;
e.snssai_dnns.insert(snssai_item); for (auto& item : e.snssai_dnns) {
if (item.snssai == snssai.snssai) {
// update item
found = true;
item.dnn_upf_info_list.insert(snssai.dnn_upf_info_list);
break;
}
}
if (!found) {
snssai_item.dnn_upf_info_list = snssai.dnn_upf_info_list;
e.snssai_dnns.insert(snssai_item);
}
} }
if (!e.snssai_dnns.empty()) { if (!e.snssai_dnns.empty()) {
......
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