You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2022/07/11 13:42:08 UTC
[mynewt-newtmgr] branch master updated: nmp decode: allow registration of custom response handlers
This is an automated email from the ASF dual-hosted git repository.
janc 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 52c313c nmp decode: allow registration of custom response handlers
52c313c is described below
commit 52c313ced42e0c2a2b8e59b82511ac4906f578ac
Author: Nico Lastzka <Ni...@ATSonline.de>
AuthorDate: Mon May 30 10:59:37 2022 +0200
nmp decode: allow registration of custom response handlers
---
nmxact/nmp/decode.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/nmxact/nmp/decode.go b/nmxact/nmp/decode.go
index 4cbd095..aa94ba5 100644
--- a/nmxact/nmp/decode.go
+++ b/nmxact/nmp/decode.go
@@ -124,3 +124,10 @@ func DecodeRspBody(hdr *NmpHdr, body []byte) (NmpRsp, error) {
r.SetHdr(hdr)
return r, nil
}
+
+func RegisterResponseHandler (ogi Ogi, f rspCtor) {
+ cb := rspCtorMap[ogi]
+ if cb == nil {
+ rspCtorMap[ogi] = f
+ }
+}