<?php

//=================================================================
//Software version SERVICE Tool====================================
//=================================================================
$latest_version = getLatestVersion('EPSK01',$clientsecret) ?? '';

$service_tool_current_version = ($latest_version !='') ? $latest_version['version'] : '';
$service_tool_current_filename = ($latest_version !='') ? $latest_version['software'] : '';
$software_download_url = 'https://'.$_SERVER['SERVER_NAME'].'/firmware'.'/';

//getSoftware (legacy)
$software_url = ($latest_version !='') ? $latest_version['source'] : 'https://'.$_SERVER['SERVER_NAME'].'/firmware'.'/'.$service_tool_current_filename;

//=================================================================
//SERVICE Tool manual          ===================================
//=================================================================

switch ($language) {
    case 'NL':
        $manual_url = "https://lms.tss-learning.com/course/view.php?id=60";
        break;
    
    case 'US':
        $manual_url = "https://lms.tss-learning.com/course/view.php?id=78";
        break;

    case 'DE':
        $manual_url = "https://lms.tss-learning.com/course/view.php?id=80";
        break;
    
    case 'ES':
        $manual_url = "https://lms.tss-learning.com/course/view.php?id=78";
        break;

    case 'PT':
        $manual_url = "https://lms.tss-learning.com/course/view.php?id=78";
        break;
            
    default:
        $manual_url = "https://lms.tss-learning.com/course/view.php?id=78";
        break;
}


//=================================================================
//SERVICE Tool initialize       ===================================
//=================================================================
$init = array(
    "COM" => array(
        "batteryVoltage_Max"=> 4.9,
        "batteryVoltage_Min"=> 4.5,
        "AnalogVoltagePP_EP_0_Max"=> 4.8,
        "AnalogVoltagePP_EP_0_Min"=> 4.1,
        "AnalogVoltagePP_EP_680_Max"=> 3.4,
        "AnalogVoltagePP_EP_680_Min"=> 2.9,
        "AnalogVoltagePP_EP_480_Max"=> 2.9,
        "AnalogVoltagePP_EP_480_Min"=> 2.5,
        "AnalogVoltagePP_EP_330_Max"=> 2.5,
        "AnalogVoltagePP_EP_330_Min"=> 2.1,
        "AnalogVoltageCP_0_POS_Max"=> 12.5,
        "AnalogVoltageCP_0_POS_Min"=> 11.5,
        "AnalogVoltageCP_0_NEG_Max"=> -11.5,
        "AnalogVoltageCP_0_NEG_Min"=> -12.5,
        "AnalogVoltageCP_2K74_POS_Max"=> 9.2,
        "AnalogVoltageCP_2K74_POS_Min"=> 8.7,
        "AnalogVoltagePP_EP_Off_Max"=>0.3,
        "AnalogVoltagePP_EP_Off_Min"=>-0.5
    ),
    "ATM"=> array(
        "batteryVoltage_Max"=> 4.9,
        "batteryVoltage_Min"=> 4.5,
        "AnalogVoltagePP_EP_0_Max"=> 4.8,
        "AnalogVoltagePP_EP_0_Min"=> 4.1,
        "AnalogVoltagePP_EP_680_Max"=> 3.4,
        "AnalogVoltagePP_EP_680_Min"=> 2.9,
        "AnalogVoltagePP_EP_480_Max"=> 2.9,
        "AnalogVoltagePP_EP_480_Min"=> 2.5,
        "AnalogVoltagePP_EP_330_Max"=> 2.5,
        "AnalogVoltagePP_EP_330_Min"=> 2.1,
        "AnalogVoltageCP_0_POS_Max"=> 12.5,
        "AnalogVoltageCP_0_POS_Min"=> 11.5,
        "AnalogVoltageCP_0_NEG_Max"=> -11.5,
        "AnalogVoltageCP_0_NEG_Min"=> -12.5,
        "AnalogVoltageCP_2K74_POS_Max"=> 9.2,
        "AnalogVoltageCP_2K74_POS_Min"=> 8.7,
        "AnalogVoltagePP_EP_Off_Max"=>0.3,
        "AnalogVoltagePP_EP_Off_Min"=>-0.5
    ),
    "ManualURL"=> $manual_url,
    "termsURL"=> "https://emergency-plug.com/en/terms-and-conditions",
    "Application" => array(
        "current_version" => $service_tool_current_version,
        "current_filename" => $service_tool_current_filename,
        "location" => $software_download_url
    )
);

?>