Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
8cf2c046
Commit
8cf2c046
authored
Mar 30, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix IMEISV
parent
2d067869
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
src/common/conversions.cpp
src/common/conversions.cpp
+10
-12
No files found.
src/common/conversions.cpp
View file @
8cf2c046
...
...
@@ -527,33 +527,31 @@ std::string conv::get_imsi(
//------------------------------------------------------------------------------
bool
conv
::
string_2_masked_imeisv
(
const
std
::
string
&
str
,
BIT_STRING_t
&
imeisv
)
{
if
(
str
.
length
()
!=
16
)
return
false
;
// Must contain 16 digits
const
std
::
string
&
imeisv_str
,
BIT_STRING_t
&
imeisv
)
{
int
len
=
imeisv_str
.
length
();
if
(
len
!=
16
)
return
false
;
// Must contain 16 digits
imeisv
.
buf
=
(
uint8_t
*
)
calloc
(
8
,
sizeof
(
uint8_t
));
if
(
!
imeisv
.
buf
)
{
return
false
;
}
bstring
b_str
=
{};
std
::
string
imeisv_masked
=
{};
// TODO: last 4 digits of the SNR masked by setting the corresponding bits to
// 1
imeisv_masked
=
str
.
substr
(
0
,
10
)
+
"1111"
+
str
.
substr
(
14
,
2
);
uint8_t
digit_low
=
0
;
uint8_t
digit_high
=
0
;
int
i
=
0
;
int
len
=
imeisv_masked
.
length
();
int
j
=
0
;
int
i
=
0
;
int
j
=
0
;
while
(
i
<
len
)
{
string_to_int8
(
imeisv_
masked
.
substr
(
i
,
1
),
digit_low
);
string_to_int8
(
imeisv_
masked
.
substr
(
i
+
1
,
1
),
digit_high
);
string_to_int8
(
imeisv_
str
.
substr
(
i
,
1
),
digit_low
);
string_to_int8
(
imeisv_
str
.
substr
(
i
+
1
,
1
),
digit_high
);
i
=
i
+
2
;
uint8_t
octet
=
(
0xf0
&
(
digit_high
<<
4
))
|
(
digit_low
&
0x0f
);
imeisv
.
buf
[
j
]
=
octet
;
j
++
;
}
// last 4 digits of the SNR masked by setting the corresponding bits to 1
imeisv
.
buf
[
5
]
=
0xff
;
imeisv
.
buf
[
6
]
=
0xff
;
imeisv
.
size
=
8
;
imeisv
.
bits_unused
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment