
/**
 * <p class=proto-main>The Proto is to utilize the common Authorization and Comm Check Messages, often referred to as bootstrap.</p>
 *
 * <div class=proto-hier>
 *
 * UconnectAny
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.CommCheckRequest">CommCheckRequest</a>
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.CommCheckResponse">CommCheckResponse</a>
 * 	   |
* 	   |---- <a href="#com.fca.uconnect.global.SmallECUCommCheckRequest">SmallECUCommCheckRequest</a>
 * 	   |---- <a href="#com.fca.uconnect.global.AckMessage">AckMessage</a>
 *
 * </div>
 *
 *  <h3 class=change-log-hdr> Change Log</h3>
 *  <table id="change-log" class="change-log">
 * <thead><tr>
 *	<th>Version</th><th>Date</th><th>Notes</th></tr></thead>
 *   <tbody>
 *    <tr><td>1.2</td><td>2018-07-16</td><td>Added SmallECU Comm check request message</td></tr>
 *    <tr><td>1.1</td><td>2018-07-16</td><td>Added DRM Hash for the opportunity to combine CommCheck and ProvisioningRequest</td></tr>
 *    <tr><td>1.0</td><td>2017-12-11</td><td>1st Drafted</td></tr>
 *	</tbody></table>
 * <table class="Topics"><thead><tr>
*	<td>Flow</td><td>Type</td><td>Topic Name</td></tr></thead>
 *  <tbody>
  *<tr><td>Cloud send to Vehicle</td><td>Publish</td><td>fcasdp/${iot:ClientId}/CCHK</td></tr>
	* <tr><td>Cloud receive from Vehicle</td><td>Subscribe</td><td>fcasdp/CCHK/#</td></tr>
	 *<tr><td>Vehicle send to Cloud </td><td>Publish</td><td>fcasdp/CCHK/${iot:ClientId}</td></tr>
	* <tr><td>Vehicle receive from Cloud </td><td>Subscribe</td><td>fcasdp/${iot:ClientId}/#</td></tr>
	* </tbody></table>
 *
 * <h3 class=change-log-hdr>Data Flow</h3>
 * <p class=proto-main>The following sequence diagram depicts the flow of messages between the Vehicle and the SDP:</p>
 *
 *
 *  * <img class=img-border src=./images/CommCheck.png>
 *

 */


syntax="proto3";
// import public "Global_Uconnect_Control4.proto";
import public "Global_Uconnect_Device.proto";
package com.fca.uconnect.global;
message CommCheckRequest {
     string vehicleId = 1;/// VIN or other unique identifier for the vehicle this Telematics Unit is installed in.
     Device device1 = 2;
     bytes drmHash = 5; /// Hash of the DRM from the Signature
    map<string,string> additionalModemParams = 3;/// This can be used as key value pair for additional Modem Identifiers. And should contain key value pairs for parameters identified in the TC Client Specification
	 ReasonEnum reason = 4;

    enum ReasonEnum{
    	IGNITION_CYCLE_CHECK = 0; /// IGNITION_CYCLE_CHECK
    	TBM_FLASH= 1; /// TBM_FLASH
    	HU_FLASH = 2; /// HU_FLASH
    	ON_DEMAND = 3; /// ON_DEMAND
    	MISDN_MISMATCH = 4; /// MISDN_MISMATCH
    	DISCREPENCY_CHECK = 5; /// DISCREPENCY_CHECK
    	SOFTWARE_REFRESH = 6; /// SOFTWARE_REFRESH
    	HU_SWAP = 7; /// HU_SWAP
    	TBM_SWAP = 8; ///TBM_SWAP
    	ENROLLMENT = 9; /// ENROLLMEN

    }

}

 message CommCheckResponse {
	enum ResponseEnum {
		SUCCESS = 0;/// Comm check successful
		FAILURE = 1;/// Comm check failed

	}
	 ResponseEnum response = 1;
	 bool isTransient = 2; /// Indicates a transient error and a retry can be attempted.
	 int32 failureReasonCode = 3; /// Specific error code.
}

message InitiateCommCheck {

    map<string,string> parameters = 1;/// This can be used as key value pair for additional Modem Identifiers. And should contain key value pairs for parameters required to trigger the comm check


}

message SmallECUCommCheckRequest {
enum MasterECUDeviceType {

	NOT_USED = 0;
	CADM2 = 1;
	SGW = 2;

}

 enum CommCheckReasonEnum{
    	IGNITION_CYCLE_CHECK = 0; /// IGNITION_CYCLE_CHECK
    	ON_DEMAND = 1; /// ON_DEMAND
    	SOFTWARE_REFRESH = 2; /// SOFTWARE_REFRESH
    	ECU_SWAP = 3; /// HU_SWAP
    	ECU_FLASH = 4; ///TBM_SWAP

}
	string vehicleId = 1;
	CommCheckReasonEnum commCheckReason = 11;
	MasterECUDeviceType ecuType = 2;
	string deviceManufacturer = 3;
	string serialNumber = 4;
	string partNumber = 5;
	string hardwareNumber = 6;
	string hardwareVersion = 7;
	string softwareNumber = 8;
	string softwareVersion = 9;
	bytes drmHash = 10;




}
