AzureSphere/AzureSphereSampleDevice/main.c
static ExitCode ValidateUserConfiguration(void)
{
    ExitCode validationExitCode = ExitCode_Success;

    if (connectionType < ConnectionType_DPS || connectionType > ConnectionType_IoTEdge) {
        validationExitCode = ExitCode_Validate_ConnectionType;
    }

    if (connectionType == ConnectionType_DPS) {
        if (scopeId == NULL) {
            validationExitCode = ExitCode_Validate_ScopeId;
        } else {
            Log_Debug("Using DPS Connection: Azure IoT DPS Scope ID %s\n", scopeId);
        }
    }

    if (connectionType == ConnectionType_Direct) {
        if (hostName == NULL) {
            validationExitCode = ExitCode_Validate_Hostname;
        }

        if (validationExitCode == ExitCode_Success) {
            Log_Debug("Using Direct Connection: Azure IoT Hub Hostname %s\n", hostName);
        }
    }

    if (connectionType == ConnectionType_IoTEdge) {
        if (hostName == NULL) {
            validationExitCode = ExitCode_Validate_Hostname;
        }

        if (iotEdgeRootCAPath == NULL) {
            validationExitCode = ExitCode_Validate_IoTEdgeCAPath;
        }

        if (validationExitCode == ExitCode_Success) {
            Log_Debug("Using IoTEdge Connection: IoT Edge device Hostname %s, IoTEdge CA path %s\n",
                      hostName, iotEdgeRootCAPath);
        }
    }

    if (validationExitCode != ExitCode_Success) {
        Log_Debug("Command line arguments for application shoud be set as below\n%s",
                  cmdLineArgsUsageText);
    }

    return validationExitCode;
}
/// <summary>
///     Validates if the values of the Connection type, Scope ID, IoT Hub or IoT Edge Hostname
///  were set.
/// </summary>
/// <returns>ExitCode_Success if the parameters were provided; otherwise another
/// ExitCode value which indicates the specific failure.</returns>

Validates if the values of the Connection type, Scope ID, IoT Hub or IoT Edge Hostname
were set.

ExitCode_Success if the parameters were provided; otherwise another
ExitCode value which indicates the specific failure.
Validates if the values of the Connection type Scope ID IoT Hub or IoT Edge Hostname were set . ExitCode_Success if the parameters were provided ; otherwise another ExitCode value which indicates the specific failure .
static ExitCode ValidateUserConfiguration(void)
{
    ExitCode validationExitCode = ExitCode_Success;
    if (connectionType < ConnectionType_DPS || connectionType > ConnectionType_IoTEdge) {
        validationExitCode = ExitCode_Validate_ConnectionType;
    }
    if (connectionType == ConnectionType_DPS) {
        if (scopeId == NULL) {
            validationExitCode = ExitCode_Validate_ScopeId;
        } else {
            Log_Debug("Using DPS Connection: Azure IoT DPS Scope ID %s\n", scopeId);
        }
    }
    if (connectionType == ConnectionType_Direct) {
        if (hostName == NULL) {
            validationExitCode = ExitCode_Validate_Hostname;
        }
        if (validationExitCode == ExitCode_Success) {
            Log_Debug("Using Direct Connection: Azure IoT Hub Hostname %s\n", hostName);
        }
    }
    if (connectionType == ConnectionType_IoTEdge) {
        if (hostName == NULL) {
            validationExitCode = ExitCode_Validate_Hostname;
        }
        if (iotEdgeRootCAPath == NULL) {
            validationExitCode = ExitCode_Validate_IoTEdgeCAPath;
        }
        if (validationExitCode == ExitCode_Success) {
            Log_Debug("Using IoTEdge Connection: IoT Edge device Hostname %s, IoTEdge CA path %s\n",
                      hostName, iotEdgeRootCAPath);
        }
    }
    if (validationExitCode != ExitCode_Success) {
        Log_Debug("Command line arguments for application shoud be set as below\n%s",
                  cmdLineArgsUsageText);
    }
    return validationExitCode;
}
static ExitCode ValidateUserConfiguration ( void ) { ExitCode validationExitCode = ExitCode_Success ; if ( connectionType < ConnectionType_DPS || connectionType > ConnectionType_IoTEdge ) { validationExitCode = ExitCode_Validate_ConnectionType ; } if ( connectionType == ConnectionType_DPS ) { if ( scopeId == NULL ) { validationExitCode = ExitCode_Validate_ScopeId ; } else { Log_Debug ( " \n " , scopeId ) ; } } if ( connectionType == ConnectionType_Direct ) { if ( hostName == NULL ) { validationExitCode = ExitCode_Validate_Hostname ; } if ( validationExitCode == ExitCode_Success ) { Log_Debug ( " \n " , hostName ) ; } } if ( connectionType == ConnectionType_IoTEdge ) { if ( hostName == NULL ) { validationExitCode = ExitCode_Validate_Hostname ; } if ( iotEdgeRootCAPath == NULL ) { validationExitCode = ExitCode_Validate_IoTEdgeCAPath ; } if ( validationExitCode == ExitCode_Success ) { Log_Debug ( " \n " , hostName , iotEdgeRootCAPath ) ; } } if ( validationExitCode != ExitCode_Success ) { Log_Debug ( " \n " , cmdLineArgsUsageText ) ; } return validationExitCode ; }
<summary>
Validates if the values of the Connection type, Scope ID, IoT Hub or IoT Edge Hostname
were set.
<summary > Validates if the values of the Connection type Scope ID IoT Hub or IoT Edge Hostname were set .