Skip to content

Commit 070e160

Browse files
committed
app_support: Fix management protocol
1 parent 6d6e4b7 commit 070e160

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/ndn/app_support/nfd_mgmt.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ class ControlParameters(TlvModel):
9090
cp = ModelField(0x68, ControlParametersValue)
9191

9292

93-
class ControlResponse(ControlParametersValue):
93+
class ControlResponse(TlvModel):
9494
status_code = UintField(0x66)
9595
status_text = BytesField(0x67, is_string=True)
96-
body = IncludeBase(ControlParametersValue)
96+
body = ModelField(0x68, ControlParametersValue)
9797

9898

9999
class FaceEventNotificationValue(TlvModel):
@@ -285,8 +285,11 @@ def parse_response(buf):
285285
buf = parse_and_check_tl(memoryview(buf), 0x65)
286286
cr = ControlResponse.parse(buf)
287287
ret = {}
288-
for k in ControlResponse._encoded_fields:
289-
val = getattr(cr, k.name)
288+
ret['status_code'] = cr.status_code
289+
ret['status_text'] = cr.status_text
290+
params = cr.body
291+
for k in ControlParametersValue._encoded_fields:
292+
val = getattr(params, k.name)
290293
if isinstance(val, memoryview):
291294
val = bytes(val)
292295
ret[k.name] = val

0 commit comments

Comments
 (0)