Commit 4686e7e4 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix issue for 5GMMCapability

parent 734434ca
......@@ -97,8 +97,7 @@ int _5GMMCapability::decodeFromBuffer(uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("Decoding _5GMMCapability IE");
if (is_option) {
DECODE_U8(buf + decoded_size, octet, decoded_size);
iei_ = std::optional<uint8_t>(octet);
DECODE_U8(buf + decoded_size, iei_, decoded_size);
}
DECODE_U8(buf + decoded_size, length, decoded_size);
......
......@@ -22,6 +22,7 @@
#ifndef _5GMM_CAPABILITY_H_
#define _5GMM_CAPABILITY_H_
#include <optional>
#include <stdint.h>
constexpr uint8_t k5gmmCapabilityMinimumLength = 3;
......
......@@ -77,8 +77,7 @@ int Type4NasIe::Encode(uint8_t* buf, const int& len) {
}
//------------------------------------------------------------------------------
int Type4NasIe::Decode(
const uint8_t* const buf, const int& len, bool is_iei = false) {
int Type4NasIe::Decode(const uint8_t* const buf, const int& len, bool is_iei) {
Logger::nas_mm().debug("Decoding %s", GetIeName().c_str());
if (!Validate(len)) return KEncodeDecodeError;
......
......@@ -197,7 +197,8 @@ void RegistrationRequest::set5GMMCapability(uint8_t value) {
//------------------------------------------------------------------------------
bool RegistrationRequest::get5GMMCapability(uint8_t& value) {
if (ie_5g_mm_capability.has_value()) {
value = ie_5g_mm_capability.value().getValue();
value =
ie_5g_mm_capability.value().getOctet3(); // TODO: get multiple octets
return true;
} else
return false;
......
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