feat: check for provisioning state on shbc failure and reset if necessary

This commit is contained in:
Mudit Vats
2021-08-11 09:56:36 -07:00
parent 706a512bc7
commit 185cdceadb
3 changed files with 59 additions and 0 deletions

View File

@@ -492,3 +492,37 @@ bool cmd_start_config_host_based(config_host_based_settings& server_cert, config
return false;
}
bool cmd_get_provisioning_state(int& state)
{
state = 0;
// initialize HECI interface
if (heci_Init(NULL, PTHI_CLIENT) == 0) return false;
// get Control Mode
AMT_PROVISIONING_STATE provisioningState;
AMT_STATUS amt_status = pthi_GetProvisioningState(&provisioningState);
if (amt_status == 0)
{
state = provisioningState;
return true;
}
return false;
}
bool cmd_stop_configuration()
{
// initialize HECI interface
if (heci_Init(NULL, PTHI_CLIENT) == 0) return false;
AMT_STATUS amt_status = pthi_StopConfiguration();
if (amt_status == 0)
{
return true;
}
return false;
}