Merge pull request #176 from nkaje/fix_udp_upload
nmxact: Fix image upload failure due to unsupported async method
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) 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) 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 {