You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by na...@apache.org on 2020/10/26 20:43:44 UTC
[mynewt-newtmgr] branch master updated: nmxact/udp: Fix image
upload failure due to unsupported async method
This is an automated email from the ASF dual-hosted git repository.
naveenkaje pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newtmgr.git
The following commit(s) were added to refs/heads/master by this push:
new 8473977 nmxact/udp: Fix image upload failure due to unsupported async method
new df72d61 Merge pull request #176 from nkaje/fix_udp_upload
8473977 is described below
commit 84739773a36cda2c4d185925fbc3ce726f65a85b
Author: Naveen Kaje <na...@juul.com>
AuthorDate: Mon Oct 26 06:58:02 2020 -0500
nmxact/udp: Fix image upload failure due to unsupported async method
This addresses the UDP based image upload failure.
The UDP and naked sessons do not implement TxRxAsync
for optimized transfer as in BLE, however, continue to
support the operation by calling TxRxMgmt.
Failure signature:
~/go/bin/mcumgr --conntype udp --connstring=[192.168.1.1]:1337 image
upload build_f429/smpsvr/zephyr/zephyr.signed.bin
0 / 90644
[-----------------------------------------]
0.00%
Error: ImageUpload unexpected error after 0/90644 bytes
Signed-off-by: Naveen Kaje <na...@juul.com>
---
nmxact/nmble/naked_sesn.go | 8 +++++++-
nmxact/udp/udp_sesn.go | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/nmxact/nmble/naked_sesn.go b/nmxact/nmble/naked_sesn.go
index ad6d4ba..a16f1c7 100644
--- a/nmxact/nmble/naked_sesn.go
+++ b/nmxact/nmble/naked_sesn.go
@@ -353,7 +353,13 @@ func (s *NakedSesn) TxRxMgmt(m *nmp.NmpMsg,
func (s *NakedSesn) TxRxMgmtAsync(m *nmp.NmpMsg,
timeout time.Duration, ch chan nmp.NmpRsp, errc chan error) error {
- return fmt.Errorf("unsupported")
+ rsp, err := s.TxRxMgmt(m, timeout)
+ if err != nil {
+ errc <- err
+ } else {
+ ch <- rsp
+ }
+ return nil
}
func (s *NakedSesn) ListenCoap(
diff --git a/nmxact/udp/udp_sesn.go b/nmxact/udp/udp_sesn.go
index 45873c6..cd6b718 100644
--- a/nmxact/udp/udp_sesn.go
+++ b/nmxact/udp/udp_sesn.go
@@ -120,7 +120,13 @@ func (s *UdpSesn) TxRxMgmt(m *nmp.NmpMsg,
func (s *UdpSesn) TxRxMgmtAsync(m *nmp.NmpMsg,
timeout time.Duration, ch chan nmp.NmpRsp, errc chan error) error {
- return fmt.Errorf("unsupported")
+ rsp, err := s.TxRxMgmt(m, timeout)
+ if err != nil {
+ errc <- err
+ } else {
+ ch <- rsp
+ }
+ return nil
}
func (s *UdpSesn) AbortRx(seq uint8) error {