AJ_Status AJS_FactoryReset(void)
{
    AJ_Status status = AJ_OK;

    AJ_WarnPrintf(("FactoryReset\n"));
    status = AJSVC_PropertyStore_ResetAll();
    if (status != AJ_OK) {
        return status;
    }
    status = AJOBS_ClearInfo();
    if (status != AJ_OK) {
        return status;
    }
    AJ_ClearCredentials();
    return AJ_ERR_RESTART;
}
static AJ_Status DoDeferredOperation(duk_context* ctx)
{
    AJ_Status status = AJ_ERR_RESTART;

    switch (deferredOp) {
    case AJS_OP_OFFBOARD:
        AJOBS_ClearInfo();
        AJS_DetachAllJoyn(AJS_GetBusAttachment(), AJ_ERR_RESTART);
        break;

    case AJS_OP_FACTORY_RESET:
        AJS_FactoryReset();
        break;

    default:
        status = AJ_OK;
        break;
    }
    deferredOp = AJS_OP_NONE;
    return status;
}
AJ_Status AJOBS_ControllerAPI_DoOffboardWiFi()
{
    return (AJOBS_ClearInfo());
}