Skip to content
Snippets Groups Projects
Commit ee5daf29 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen
Browse files

Merge branch 'fix_sd_value' into 'develop'

Use the same SD format in all NFs

See merge request oai/cn5g/oai-cn5g-common-src!61
parents a1ef2f2c ce3819f5
No related branches found
No related tags found
1 merge request!61Use the same SD format in all NFs
......@@ -40,7 +40,7 @@ const uint8_t SD_LENGTH = 3;
typedef struct s_nssai // section 28.4, TS23.003
{
uint8_t sst;
std::string sd;
std::string sd = oai::model::common::SD_DEFAULT_VALUE;
// s_nssai(const uint8_t& m_sst, const uint32_t m_sd) : sst(m_sst), sd(m_sd)
// {}
s_nssai(const uint8_t& m_sst, const std::string& m_sd)
......@@ -88,6 +88,19 @@ typedef struct s_nssai // section 28.4, TS23.003
this->sd = json_data["sd"].get<std::string>();
}
[[nodiscard]] uint32_t get_sd_int() const {
try {
return std::stoul(sd, nullptr, 16);
} catch (const std::exception& e) {
oai::logger::logger_registry::get_logger(LOGGER_COMMON)
.error(
"Error when converting from string to int for S-NSSAI SD, error: "
"%s",
e.what());
return SD_NO_VALUE;
}
}
} snssai_t;
typedef struct plmn_s {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment