diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2020-05-13 00:39:15 +0300 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2020-05-13 00:46:00 +0300 |
commit | ecfb0d68d79e8f121acfddf2ecb06a0955e46604 (patch) | |
tree | 5f0dd9f4f00d7e754b3d5d27d0af7210d472867e /include | |
parent | fdfe25b1056c51bdd8710de37b6d9aa3df950522 (diff) |
gsm0808_utils: Fix gsm0808_cause_class() function
Cause class is in bits 5-7 of the cause value.
For the cause value 0x52 old version returned 0xa instead of
a correct 0x5.
See section 3.2.2.5 Cause of TS 08.08 for the details.
Change-Id: I46646740c5daaafe20123e709f26dd1d2c1b6f8d
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/gsm/gsm0808_utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 1cdca8c6..a8852e4a 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -145,7 +145,7 @@ int gsm48_mr_cfg_from_gsm0808_sc_cfg(struct gsm48_multi_rate_conf *cfg, uint16_t /*! \returns 3GPP TS 08.08 §3.2.2.5 Class of a given Cause */ static inline enum gsm0808_cause_class gsm0808_cause_class(enum gsm0808_cause cause) { - return (cause << 1) >> 4; + return (cause >> 4) & 0x7; } /*! \returns true if 3GPP TS 08.08 §3.2.2.5 Class has extended bit set */ |