Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF-Simple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
CommunityXG
OpenXG-SMF-Simple
Commits
c293b6d8
Commit
c293b6d8
authored
Dec 15, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup for N1 functions
parent
539e6168
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
97 deletions
+40
-97
src/common/utils/string.cpp
src/common/utils/string.cpp
+15
-0
src/common/utils/string.hpp
src/common/utils/string.hpp
+1
-0
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+24
-97
No files found.
src/common/utils/string.cpp
View file @
c293b6d8
...
...
@@ -99,3 +99,18 @@ void util::ipv4_to_bstring(struct in_addr ipv4_address, bstring str) {
memcpy
(
str
->
data
,
bitstream_addr
,
sizeof
(
bitstream_addr
));
}
void
util
::
string_to_bstring
(
const
std
::
string
&
str
,
bstring
bstr
)
{
bstr
=
bfromcstralloc
(
str
.
length
(),
"
\0
"
);
bstr
->
slen
=
str
.
length
();
memcpy
((
void
*
)
bstr
->
data
,
(
void
*
)
str
.
c_str
(),
str
.
length
());
/*
std::string s(
(char *)bstr->data,
bstr->slen);
Logger::nrf_app().debug("Str %s", s.c_str());
*/
}
src/common/utils/string.hpp
View file @
c293b6d8
...
...
@@ -48,5 +48,6 @@ std::string& trim(std::string &s);
void
ipv4_to_bstring
(
struct
in_addr
ipv4_address
,
bstring
str
);
void
string_to_bstring
(
const
std
::
string
&
str
,
bstring
bstr
);
}
#endif
src/smf_app/smf_n1.cpp
View file @
c293b6d8
This diff is collapsed.
Click to expand it.
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