Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
usp-js
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
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WebSDK
usp-js
Commits
34a5bba1
Commit
34a5bba1
authored
4 years ago
by
Marin Karamihalev
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
d3c493bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#12369
failed
4 years ago
Stage: install
Stage: build
Stage: unit-testing
Stage: deploy-pages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+41
-9
41 additions, 9 deletions
README.md
with
41 additions
and
9 deletions
README.md
+
41
−
9
View file @
34a5bba1
...
@@ -107,15 +107,7 @@ const usp = await connect(options);
...
@@ -107,15 +107,7 @@ const usp = await connect(options);
await
usp
.
set
(
"
Device.WiFi.Radio.1.Name
"
,
"
radio-1
"
);
// => void
await
usp
.
set
(
"
Device.WiFi.Radio.1.Name
"
,
"
radio-1
"
);
// => void
```
```
-
Operate - WIP (response message not working yet)
-
Operate
-
operate without no arguments
```
javascript
await
usp
.
operate
(
"
Device.SelfTestDiagnostics()
"
);
```
-
operate with arguments (for required args check USP Reference)
```
javascript
```
javascript
const
[
ping
,
cleanPing
]
=
await
usp
.
operate
(
"
Device.IP.Diagnostics.IPPing()
"
);
const
[
ping
,
cleanPing
]
=
await
usp
.
operate
(
"
Device.IP.Diagnostics.IPPing()
"
);
...
@@ -150,3 +142,43 @@ const usp = await connect(options);
...
@@ -150,3 +142,43 @@ const usp = await connect(options);
```
javascript
```
javascript
await
usp
.
del
(
"
Device.NAT.PortMapping.4.
"
);
// => void
await
usp
.
del
(
"
Device.NAT.PortMapping.4.
"
);
// => void
```
```
-
Get Supported DM
```
javascript
await
usp
.
supportedDM
(
"
Device.WiFi.
"
)
```
-
Get Supported Protocols
```
javascript
await
usp
.
supportedProto
(
"
Device.WiFi.
"
)
```
-
Get Instances
```
javascript
await
usp
.
instances
(
"
Device.WiFi.
"
)
```
-
Subscribe
```
javascript
const
clearSub
=
await
usp
.
subscribe
({
id
:
'
1234
'
,
notif
:
'
ObjectCreation
'
,
reference
:
'
Device.NAT.PortMapping.
'
},
console
.
log
)
```
-
optional second argument to callback gives access to full message.
```
javascript
await
usp
.
subscribe
({
id
:
'
1234
'
,
notif
:
'
ObjectCreation
'
,
reference
:
'
Device.NAT.PortMapping.
'
},
(
_
,
fullMsg
)
=>
console
.
log
(
fullMsg
)
)
```
-
On (WIP)
Id can be a string or a regexp. Messages, generally, have their id in the form COMMAND@random_string (i.e. NOTIFY@12345).
(Note: does not add subscription to USP model, instead allows for internal monitoring of received messages)
Optional second argument to callback gives access to full message.
```
javascript
const
clear
=
usp
.
on
(
/NOTIFY.*/
,
(
data
,
msg
)
=>
console
.
log
({
data
,
msg
}))
```
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