Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CyanLight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fxk8y
CyanLight
Commits
950f52db
Commit
950f52db
authored
2 years ago
by
fxk8y
Browse files
Options
Downloads
Patches
Plain Diff
Adding copy and move API
parent
af04fa8b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CLC-qthing/SiliconTorch/NVSExplorer.cpp
+47
-0
47 additions, 0 deletions
CLC-qthing/SiliconTorch/NVSExplorer.cpp
CLC-qthing/SiliconTorch/NVSExplorer.hpp
+7
-0
7 additions, 0 deletions
CLC-qthing/SiliconTorch/NVSExplorer.hpp
with
54 additions
and
0 deletions
CLC-qthing/SiliconTorch/NVSExplorer.cpp
+
47
−
0
View file @
950f52db
...
@@ -1183,6 +1183,53 @@ namespace SiliconTorch {
...
@@ -1183,6 +1183,53 @@ namespace SiliconTorch {
}
}
bool
NVSExplorer
::
copyKey
(
const
str
&
nameSpace
,
const
str
&
keyFrom
,
const
str
&
keyTo
)
{
return
false
;
// TODO: implementation!
}
bool
NVSExplorer
::
copyKey
(
const
str
&
nsFrom
,
const
str
&
keyFrom
,
const
str
&
nsTo
,
const
str
&
keyTo
)
{
nvs_type_t
entryType
=
getType
(
nsFrom
,
keyFrom
);
if
(
entryType
==
NVS_TYPE_ANY
)
// key not found
return
false
;
if
(
entryType
==
NVS_TYPE_BLOB
)
// BLOBs are currently unsupported
return
false
;
u64
intStorage
=
0
;
str
strStorage
=
""
;
return
false
;
}
bool
NVSExplorer
::
moveKey
(
const
str
&
nameSpace
,
const
str
&
keyFrom
,
const
str
&
keyTo
)
{
if
(
!
copyKey
(
nameSpace
,
keyFrom
,
keyTo
)
)
return
false
;
return
removeKey
(
nameSpace
,
keyFrom
);
}
bool
NVSExplorer
::
moveKey
(
const
str
&
nsFrom
,
const
str
&
keyFrom
,
const
str
&
nsTo
,
const
str
&
keyTo
)
{
if
(
!
copyKey
(
nsFrom
,
keyFrom
,
nsTo
,
keyTo
)
)
return
false
;
return
removeKey
(
nsFrom
,
keyFrom
);
}
str
NVSExplorer
::
deviceTopic
(
const
str
&
suffix
)
{
str
NVSExplorer
::
deviceTopic
(
const
str
&
suffix
)
{
return
str
(
DEVICE_NAMESPACE
+
"NVS/"
)
+
suffix
;
return
str
(
DEVICE_NAMESPACE
+
"NVS/"
)
+
suffix
;
}
}
...
...
This diff is collapsed.
Click to expand it.
CLC-qthing/SiliconTorch/NVSExplorer.hpp
+
7
−
0
View file @
950f52db
...
@@ -87,6 +87,13 @@ namespace SiliconTorch {
...
@@ -87,6 +87,13 @@ namespace SiliconTorch {
bool
setString
(
const
str
&
nameSpace
,
const
str
&
key
,
const
str
&
value
);
bool
setString
(
const
str
&
nameSpace
,
const
str
&
key
,
const
str
&
value
);
/* TODO: implement! */
bool
copyKey
(
const
str
&
nameSpace
,
const
str
&
keyFrom
,
const
str
&
keyTo
);
// copies key inside namespace
/* TODO: implement! */
bool
copyKey
(
const
str
&
nsFrom
,
const
str
&
keyFrom
,
const
str
&
nsTo
,
const
str
&
keyTo
);
// copies key to another namespace
/* TODO: test thoroughly! */
bool
moveKey
(
const
str
&
nameSpace
,
const
str
&
keyFrom
,
const
str
&
keyTo
);
// moves key inside namespace
/* TODO: test thoroughly! */
bool
moveKey
(
const
str
&
nsFrom
,
const
str
&
keyFrom
,
const
str
&
nsTo
,
const
str
&
keyTo
);
// moves key to another namespace
str
type2str
(
nvs_type_t
typ
);
str
type2str
(
nvs_type_t
typ
);
nvs_type_t
getType
(
const
str
&
nameSpace
,
const
str
&
key
);
nvs_type_t
getType
(
const
str
&
nameSpace
,
const
str
&
key
);
str
getTypeStr
(
const
str
&
nameSpace
,
const
str
&
key
);
str
getTypeStr
(
const
str
&
nameSpace
,
const
str
&
key
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment