/**
 * <p class=proto-main>This API is to define Road Side Assistance.When Bluetooth is triggered, Phone call will be dialed out to the call center.The operator may expect to see the vehicle related information when the phone call is connected. Client  gathers vehicle information and send it out.
 * </p>
 *
 * <div class=proto-hier>
 * 	 UconnectAny
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.RSADataUpload">RSADataUpload rsaDataUpload (180)</a>
 * 	   |
 * 	   |----<a href="#com.fca.uconnect.global.BCallStatusUpdate">BCallStatusUpdate bcallStatusUpdate (181)</a>
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.VehDataRequest">VehDataRequest vehDataRequest (182)</a>
 *
 * </div>
 *
 *  <h3 class=change-log-hdr> Change Log</h3>
 *  <table id="change-log" class="change-log"><thead><tr>
 *	<td>Version</td><td>Date</td><td>Notes</td></tr></thead>
 *   <tbody>
* <tr><td>1.9</td><td>2018-10-20</td><td>Added Call Center Type for UpdatePhone Numbers (used only by back end)</td></tr>
* <tr><td>1.8</td><td>2018-09-20</td><td>Added RequestPhoneNumbers changed ASOS to ASOS_NON_IMPACT</td></tr>
* <tr><td>1.7</td><td>2018-05-08</td><td>Added Specific CallOuts for ASOS and SOS</td></tr>
 *  <tr><td>1.6</td><td>2018-05-08</td><td>Added UpdateRSAPhoneNumbers</td></tr>
 *  <tr><td>1.6</td><td>2018-05-08</td><td>Added VehicleDataRequest operation per assembla ticket 441</td></tr>
 *    <tr><td>1.5</td><td>2018-04-20</td><td>Added callCenterNumber to the RSADataUpload message per Assembla ticket 252</td></tr>
 *    <tr><td>1.4</td><td>2017-11-2</td><td>Update to Proto3</td></tr>
 *  <tr><td>1.3</td><td>2017-09-20</td><td>Added ACK Message and additional Enum fields to BcallStatus.</td></tr>
 *  <tr><td>1.2</td><td>2017-04-19</td><td>Added BcallStatusUpdate message.</td></tr>
 *  <tr><td>1.1</td><td>2017-04-18</td><td>Added extra fields for language,stateofCharge,odometer,cruiserange,nextServiceIntervalinDays,distanceRemainingForNextService and odometerUnits.</td></tr>
 *	<tr><td>1.0</td><td>2017-03-15</td><td>Release of initial Proto.</td></tr>
 *	</tbody></table>
 *
 *  <h3 class=change-log-hdr>List of MQTT Topics</h3>
 *  <table class="change-log"><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}/RSA</td></tr>
 *	 <tr><td>Cloud receive from Vehicle</td><td>Subscribe</td><td>fcasdp/RSA/#</td></tr>
 *	 <tr><td>Vehicle send to Cloud </td><td>Publish</td><td>fcasdp/RSA/${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>The following sequence diagram depicts the flow of messages between the TBM and the SDP:</p>
 *
 * <img class=img-border src=./images/rsa.png>
 *
 * <table class=sequence-table><thead><tr>
 *	<td>Sequence</td><td>Title</td><td>Role</td><td>Message</td><td>Topic</td><td>Description</td></tr></thead>
 *   <tbody>
 * <tr><td>1.</td><td>RoadSideAssist Event</td><td>TBM</td><td></td><td></td><td><p>The in-vehicle RoadSideAssist event which triggers the client device to send an RSA Data to the SDP.</p></td></tr>
 * <tr><td>2.</td><td>Assign MessageId</td><td>TBM</td><td></td><td></td><td><p>The client generates the messageId for the message by incrementing a sequence counter.</p></td></tr>
 * <tr><td>3.</td><td>Send RSADataUpload Message</td><td>TBM</td><td>RSADataUpload</td><td>/RSA/${iot:ClientId}</td><td><p>The client populates the RSADataUpload Message with the required elements and publishes to the RSA topic.</p></td></tr>
 * <tr><td>4</td><td>Process Message</td><td>SDP</td><td></td><td></td><td><p>The SDP processes the message and proceed accordingly.</p></td></tr>
 * <tr><td>5.</td><td>Assign correlationID</td><td>SDP</td><td></td><td></td><td><p>Assign correct correlationId.</p></td></tr>
 * <tr><td>6.</td><td>send AckMessage</td><td>SDP</td><td>AckMessage</td><td>${iot:ClientId}/RSA</td><td><p>The SDP sends AckMessage to acknowledge that it received RSADataUpload Message.</p></td></tr>
 * <tr><td>7.</td><td>Process AckMessage</td><td>TBM</td><td></td><td></td><td><p>The client process AckMessage.</p></td></tr>
 * <tr><td>8_1</td><td>Cancel Event</td><td></td><td></td><td></td><td><p>step 7 to 13 are in opt means The interaction operator opt means that the combined fragment represents a sending VehDataRequestmessage may happen or nothing happens. </p></td></tr>
 * <tr><td>8_2</td><td>Send BCallStatusUpdate message<td>TBM</td><td>BCallStatusUpdate</td><td>/RSA/${iot:ClientId}</td><td><p>The client populates the BCallStatusUpdate Message with the required elements and publishes to the RSA topic.</p></td></tr>
 * <tr><td>8_3</td><td>TimeOut Waiting for Cancel</td><td>SDP</td><td></td><td></td><td><p>The vehicle times out waiting for cancel.</p></td></tr>
 * <tr><td>8_4</td><td>Send BCallStatusUpdate message<td>TBM</td><td>BCallStatusUpdate</td><td>/RSA/${iot:ClientId}</td><td><p>The client populates the BCallStatusUpdate Message with the required elements and publishes to the RSA topic.</p></td></tr>
 * <tr><td>8_5</td><td>Send BCallStatusUpdate message<td>SDP</td><td>BCallStatusUpdate</td><td>/RSA/${iot:ClientId}</td><td><p>The SDP populates the BCallStatusUpdate Message with the required elements and publishes to the RSA topic.</p></td></tr>
 * <tr><td>8_6</td><td>Fail BCallStatusUpdate message<td>TBM/SDP</td><td>BCallStatusUpdate</td><td>/RSA/${iot:ClientId}</td><td><p>The BCallStatusUpdate Message with the required elements is published to the RSA topic, it fails to be processed.</p></td></tr>
 * <tr><td>9. </td><td>Process Message</td><td>SDP</td><td></td><td></td><td><p>The SDP processes the message and generates an RSADataUpload Message  and the correlationId set to the messageId from the received VehDataRequest Message.</p></td></tr>
 * <tr><td>10.</td<td>send AckMessage</td><td>TBM/SDP</td><td>AckMessage</td><td>${iot:ClientId}/RSA</td><td><p>The TBM or SDP sends AckMessage to acknowledge that it received RSADataUpload Message.</p></td></tr>
 * <tr><td>0_1</td><td>BCall Data Query Event</td><td>SDP</td><td></td><td></td><td><p>The SDP can continuously request client for BCall Data through VehDataRequest.</p></td></tr>
* <tr><td>10_2</td><td>Send VehDataRequest Message</td><td>SDP</td><td>VehDataRequest</td><td>${iot:ClientId}/RSA</td><td><p>The SDP publishes the response message to the RSA topic for the client to receive.</p></td></tr>
 * <tr><td>10_3.</td><td>Process Message</td><td>TBM</td><td></td><td></td><td><p>The Client processes the message and generates an RSADataUpload Message  and the correlationId set to the messageId from the received VehDataRequest Message.</p></td></tr>
 * <tr><td>10_4.</td><td>Send RSADataUpload Message</td><td>TBM</td><td><p>RSADataUpload</td><td>/RSA/${iot:ClientId}</td><td>The Client populates the RSADataUpload message to the RSA topic for the SDP to receive.</p></td></tr>
 * <tr><td>10_5.</td><td>Process Message</td><td>SDP</td><td></td><td></td><td><p>The SDP receives the message and verifies the data and proceed accordingly.</p></td></tr>
 * </tbody>
 * </table>
 */
syntax="proto3";
package com.fca.uconnect.global;

//import public "Global_Uconnect_Control.proto";
import public "Global_Uconnect_VehicleInfo.proto";
import public "Global_Uconnect_Device.proto";
import public "Global_Uconnect_Ext_ECall.proto";
/**
 * This message represents  RoadSideAssistance DataUpload when User touches RSA button.This can also be used to send in response to VehDataRequest
 * <div class=exmsg-main>
 * <h4>RSADataUpload Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1489680328348
 * 		messageId: 1
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.rsaDataUpload]
 * 		 {
 * 		  vehicleLocation
 * 		  {
 * 			longitude: 43.9999
 * 			latitude: -84.54636
 * 		  }
 * 		  tirePressure
 * 		  {
 * 			flTirePressure: 35.0
 * 			frTirePressure: 34.0
 * 			rlTirePressure: 36.0
 * 			rrTirePressure: 35.0
 * 		  }
 * 		 fuelLevel: 20.0
 * 		 errorTellTale
 * 		 {
 * 			oilPressure: true
 *  	 }
 * 		 engineStatusEnum: REQUESTSTART
 * 		}
 *     }
 *	</code>
 *   </div>
 * </div>
 */

message RSADataUpload {
	  string callCenterNumber = 9; /// Phone number for the call center that the assist call was directed to.
	  CallType calltype = 10; /// Enumeration for the type of call being made i.e. Brand, Uconnect, Roadside, Concierge
	  CallTrigger callTriggerEnum = 11; /// Is an automatic non-impact call or manual
	  CallReason CallReasonEnum = 12; /// Reason - only used in case of automatic call
	  Device device = 8; /// device info This identifies the type of the device. / Device Manufacturer Name / TBM Serial Number / TBM Part Number / TBM Hardware Version / TBM Software Version / ICCID for the SIM / MSI for the SIM / Number uniquely identifying a subscription in a mobile network. / IMIE Number for the NAD / Modem Hardware Version / Modem Software Version / Modem Serial Number / Model Part Number / WiFi Mac Address / HU Serial Number / HU Part Number / HU Hardware Version / HU Software Version
	  VehicleInfo vehicleInfo = 1;
	  TirePressure tirePressure=2;///define Tire pressure for all the tires - not used
	  float	fuelRemaining=3;/// Represents Fuel left. Not used
	  ErrorTellTale errorTellTale= 4; /// Not Used
	  double stateofCharge = 5;// 0% - Empty , 100% - Full. Not Used
	  int32 daysRemainingForNextService = 6;/// The number of days remaining for next service. NOT USED
	  int32 distanceRemainingForNextService = 7;/// The distance remaining for next service. NOT USED

	 /**
	  * This message is to define any error Tell Tale signs
	  */
	 message ErrorTellTale{
	 	 bool isOilPressure=1;/// This is for Oil Tell-tale Sign.
	 }
	enum CallTrigger {
		MANUAL = 0;
		AUTOMATIC = 1;
		ONDEMAND = 2;

	}

	enum CallReason {
		DEFAULT = 0;
		ENGINEOILTEMP = 1;
		WATERINFUEL = 2;
		BRAKEINDICATOR = 3;
		BRAKEPADINDICATOR = 4;
		LOWBREAKFLUID = 5;
		BREAKPEDALFAULT = 6;



	}
	 enum CallType {
	 	BRAND=0;// DEPRECATED
	 	ROADSIDE=1;// DEPRECATED
	 	GUARDIAN=2; //DEPRECATED
	 	UCONNECT=3; //DEPRECATED
	 	CONCIERGE=4;//DEPRECATED
	 	ASOS_NON_IMPACT = 5;
	 	SOS = 6; // DO NOT USE FOR BCALLS
	 	ASSIST1 = 7;
	 	ASSIST2 = 8;
	 	ASSIST3 = 9;
	 	ASSIST4 = 10;
	 	IVA = 11;
	 }
}
/**
 * This message is to update the status of the BCall.
 *<div class=exmsg-main>
 * <h4>BCallStatusUpdate Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 *		timestamp: 1489600243281
 * 		messageId: 2
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.bcallStatusUpdate]
 * 		 {
 * 		  bcallStatusEnum: DIAL
 * 		 }
 * 		}
 *	</code>
 *  </div>
 * </div>
 */
message BCallStatusUpdate {
	 BCallStatusEnum bcallStatusEnum = 1;
	enum BCallStatusEnum{
		DIAL=0;
		CANCELLED=1;
		TERMINATED=2;///This represents the call is terminated.
		DROPPED_CALL = 3;///This is sent when TBM detects dropped call without a terminate tone.
		CALL_FAILED = 4;///This is sent when TBM fails to Establish CALL.
	}

	}
/**
 * This message is to get the Data from Client after Bcall is placed.
 */

 message RSAVehicleDataRequest{
	ECallVehDataRequest vehicleDataRequest = 1; /// Requests the vehicle data
	}

	message RSAVehicleDataResponse {
	RSADataUpload vehicleDataUpload= 1; /// Returns the requested vehicle data
}
message UpdateRSAPhoneNumbers {
	bytes PhoneList = 1; /// Deprecated
	repeated RAPhoneListMessage raPhoneListMessages = 2; /// repreated structure providing details for each phone number that requires updating

}
 message RAPhoneListMessage {
 	bool EnableCallType = 1;
	string PrimaryPhoneNumber = 2; /// Primary Phone Number for the feature
	string SecondaryPhoneNumber = 3; /// Secondary Phone Number for the feature
	CallCenterType callCenter = 5; /// This field can be ignored by the vehicle and is used for backend uniform API design purposes only
	CallType callTypeEnum = 4;

	enum CallCenterType {
		BRAND = 0;
		ROADSIDE = 1;
		GUARDIAN = 2;
		UCONNECT = 3;
		CONCIERGE = 4;
		IVA_CALL = 5;


	}
	enum CallType {
		Assist1 = 0;
		Assist2 = 1;
		Assist3 = 2;
		Assist4 = 3;
		IVA = 4;
		ASOS_NON_IMPACT = 5;
		// SOS = 6;

	}

}
message RequestRSAPhoneNumbers {

repeated RAPhoneListMessage raPhoneListMessages = 1; /// Sends the current vehicle phone list for comparison with SDP list for the vehicles current profile.
}





