commit | dc54bac0be216a2dc0cf37a919b19583ce82381e | [log] [tgz] |
---|---|---|
author | Christopher Collins <ccollins@apache.org> | Fri Aug 09 11:27:05 2019 -0700 |
committer | ccollins476ad <ccollins476ad@gmail.com> | Mon Aug 12 12:20:52 2019 -0700 |
tree | 30aaf8ec21f437fc2ca232ab30b252d6db4a1602 | |
parent | 6daa7b286ca8c46d1c8304bc813baf388f1233c7 [diff] |
nmxact: Create a listener for each OMP response Prior to this change, nmxact created a single CoAP listener to handle all incoming OMP responses. This listener would parse the embedded NMP message, then dispatch to the appropriate NMP listener based on the NMP sequence number. There is a problem with this approach. If the server rejects an outgoing OMP request with a CoAP error (e.g., the omp resource requires a more secure connection), then the error does not get passed up to the caller. The error response does not contain an embedded NMP response, so there is no way to match it with the appropriate listener. The result is that nmxact drops the CoAP error, and the OMP operation eventually times out. This commit makes the following changes: * Every outgoing OMP request contains a single-byte token consisting of the NMP sequence number. * A new CoAP listener and NMP listener are created for each expected OMP response. * Both NMP errors and CoAP errors are communicated to the caller. With this change, when an OMP elicits a CoAP error, newtmgr displays the error and terminates.
Newt Manager (newtmgr) is the application tool that enables a user to communicate with and manage remote devices running the Mynewt OS. It uses a connection profile to establish a connection with a device and sends command requests to the device. The newtmgr tool documentation can be found under /docs which are published at http://mynewt.apache.org/latest/os/modules/devmgmt/newtmgr.html
Build the newtmgr tool as follows:
apache-mynewt-newtmgr-1.3.0
directory to $GOPATH/src/mynewt.apache.org/newtmgr
cd $GOPATH/src/mynewt.apache.org/newtmgr/newtmgr
go build