wifi_provisioning: added wifi-ctrl reprov endpoint

This commit is contained in:
harshal.patil
2022-10-20 15:56:00 +05:30
parent dacf44dd1d
commit b7de443aaa
9 changed files with 341 additions and 17 deletions

View File

@@ -30,3 +30,22 @@ def ctrl_reset_response(security_ctx, response_data):
print_verbose(security_ctx, f'CtrlReset status: 0x{str(resp.status)}')
if resp.status != 0:
raise RuntimeError
def ctrl_reprov_request(security_ctx):
# Form protobuf request packet for CtrlReprov command
cmd = proto.wifi_ctrl_pb2.WiFiCtrlPayload()
cmd.msg = proto.wifi_ctrl_pb2.TypeCmdCtrlReprov
enc_cmd = security_ctx.encrypt_data(cmd.SerializeToString())
print_verbose(security_ctx, f'Client -> Device (Encrypted CmdCtrlReset): 0x{enc_cmd.hex()}')
return enc_cmd.decode('latin-1')
def ctrl_reprov_response(security_ctx, response_data):
# Interpret protobuf response packet from CtrlReprov command
dec_resp = security_ctx.decrypt_data(str_to_bytes(response_data))
resp = proto.wifi_ctrl_pb2.WiFiCtrlPayload()
resp.ParseFromString(dec_resp)
print_verbose(security_ctx, f'CtrlReset status: 0x{str(resp.status)}')
if resp.status != 0:
raise RuntimeError