Updated Modello Common libraries
[profile/ivi/sdk/web-ide-resources.git] / web-ui-fw / 0.0.2 / 0.0.2_Common / original / js / services / carIndicator.js
1 /**
2  * @module Services
3  */
4
5 /**
6  * Class provides AMB related functionality utilizing `tizen.vehicle` API for signals used in HTML applications. This component is usually initialized by {{#crossLink "Bootstrap"}}{{/crossLink}} class
7  * and can be later accessed using {{#crossLink "Bootstrap/carIndicator:property"}}{{/crossLink}} property. Signals recognized by this class needs to be registered in property
8  * {{#crossLink "CarIndicator/_mappingTable:property"}}{{/crossLink}}.
9  *
10  * To attach and detach to particular property register new callback object using {{#crossLink "Bootstrap/carIndicator:addListener"}}{{/crossLink}} method, e.g.:
11  *
12  *     var listenerId = bootstrap.carIndicator.addListener({
13  *        onSteeringWheelAngleChanged: function(newValue){
14  *           // Process new value
15  *        },
16  *        onWheelBrakeChanged : function(newValue){
17  *           // Process new value
18  *        }
19  *     });
20  *
21  *     // Unregister listener
22  *     bootstrap.carIndicator.removeListener(listenerId);
23  *
24  * Currently following signals are recognized:
25  *
26  * * SteeringWheelAngle
27  *   * SteeringWheelAngle
28  * * WheelBrake
29  *   * Engaged
30  * * TirePressure
31  *   * leftFront
32  *   * rightFront
33  *   * leftRear
34  *   * rightRear
35  * * DoorStatus
36  *   * ChildLockStatus
37  * * WindowStatus
38  *   * FrontDefrost
39  *   * RearDefrost
40  * * HVAC
41  *   * FanSpeed
42  *   * TargetTemperatureRight
43  *   * TargetTemperatureLeft
44  *   * SeatHeaterRight
45  *   * SeatHeaterLeft
46  *   * AirConditioning
47  *   * AirRecirculation
48  *   * AirflowDirection
49  * * LightStatus
50  *   * Hazard
51  *   * Head
52  *   * Parking
53  * * BatteryStatus
54  * * FullBatteryRange
55  * * ExteriorTemperature
56  *   * Exterior
57  * * InteriorTemperature
58  *   * Interior
59  * * WheelInformation
60  *   * FrontWheelRadius
61  * * AvgKW
62  *   * AvgKW
63  * * VehicleSpeed
64  * * Odometer
65  * * Transmission
66  *   * ShiftPosition
67  * * ExteriorBrightness
68  * * NightMode
69  * * DirectionIndicationINST
70  * * DirectionIndicationMS
71  * * ACCommand
72  * * RecircReq
73  * * FrontTSetRightCmd
74  * * FrontTSetLeftCmd
75  * * FrontBlwrSpeedCmd
76  * * HeatedSeatFRModeRequest
77  * * HeatedSeatFRRequest
78  * * HeatedSeatFLModeRequest
79  * * HeatedSeatFLRequest
80  * * FLHSDistrCmd
81  * * FRHSDistrCmd
82  *
83  * @class CarIndicator
84  * @constructor
85  */
86 var CarIndicator = function() {
87         "use strict";
88         console.info("Starting up service CarIndicator");
89 };
90
91 if (typeof Zone !== 'function')
92 {
93         window.Zone = function(){return undefined;};
94 }
95
96 function parseInteger(value) {
97         "use strict";
98         return parseInt(value, 10);
99 }
100
101 function parseTirePressure(value) {
102         "use strict";
103         var floatValue = parseFloat(value).toFixed(2);
104         if (floatValue > 180 && floatValue < 220) {
105                 floatValue = "OK";
106         }
107         return floatValue;
108 }
109
110 /**
111  * Array of registered listeners
112  * @type Object
113  * @property _listeners
114  * @private
115  */
116 CarIndicator.prototype._listeners = {};
117
118 /**
119  * Array of registered listener IDs.
120  * @type Array
121  * @property _listenerIDs
122  * @private
123  */
124 CarIndicator.prototype._listenerIDs = [];
125
126 /**
127  * Signal mapping table.
128  * Each entry should form an object
129  * @property _mappingTable
130  * @private
131  * @type Object
132  */
133 CarIndicator.prototype._mappingTable = {
134         /*
135         ZONE_None   = 000000;
136         ZONE_Front  = 000001;
137         ZONE_Middle = 000010;
138         ZONE_Right  = 000100;
139         ZONE_Left   = 001000;
140         ZONE_Rear   = 010000;
141         ZONE_Center = 100000;
142         */
143         /* this is for steeringWheel game controler */
144         "SteeringWheelAngle" : {
145                 attributeName : "steeringWheelAngle",
146                 callBackPropertyName : "SteeringWheelAngle",
147                 interfaceName : "steeringWheel",
148                 conversionFunction : function(value) {
149                         "use strict";
150                         value = parseInt(value, 10);
151                         var returnValue = 0;
152                         if (value <= 180 && value > 0) {
153                                 returnValue = (1 * (value / 6)) - 30;
154                         } else if (value <= 360 && value > 180) {
155                                 returnValue = ((value - 179) / 6);
156                         } else if (value === 0) {
157                                 returnValue = -30;
158                         }
159                         return returnValue;
160                 }
161         },
162         "WheelBrake" : {
163                 attributeName : "engaged",
164                 callBackPropertyName : "WheelBrake",
165                 interfaceName : "brakeOperation"
166         },
167         /* end steeringWheel game controler*/
168         "TirePressureLeftFront" : {
169                 attributeName : "leftFront",
170                 callBackPropertyName : "tirePressureLeftFront",
171                 interfaceName : "tire",
172                 conversionFunction : parseTirePressure
173                 //zone : new Zone(["Front","Left"])
174         },
175         "TirePressureRightFront" : {
176                 attributeName : "rightFront",
177                 callBackPropertyName : "tirePressureRightFront",
178                 interfaceName : "tire",
179                 conversionFunction : parseTirePressure
180                 //zone : new Zone(["Front","Right"])
181         },
182         "TirePressureLeftRear" : {
183                 attributeName : "leftRear",
184                 callBackPropertyName : "tirePressureLeftRear",
185                 interfaceName : "tire",
186                 conversionFunction : parseTirePressure
187                 //zone : new Zone(["Rear","Left"])
188         },
189         "TirePressureRightRear" : {
190                 attributeName : "rightRear",
191                 callBackPropertyName : "tirePressureRightRear",
192                 interfaceName : "tire",
193                 conversionFunction : parseTirePressure
194                 //zone : new Zone(["Rear","Right"])
195         },
196         "ChildLock" : {
197                 attributeName : "childLock",
198                 callBackPropertyName : "childLock",
199                 interfaceName : "childSafetyLock"
200         },
201         "FrontDefrost" : {
202                 attributeName : "defrostWindow",
203                 callBackPropertyName : "frontDefrost",
204                 interfaceName : "defrost"
205                 //zone : new Zone(["Front"])
206         },
207         "RearDefrost" : {
208                 attributeName : "defrostWindow",
209                 callBackPropertyName : "rearDefrost",
210                 interfaceName : "defrost"
211                 //zone : new Zone(["Rear"])
212         },
213         "FanSpeed" : {
214                 attributeName : "fanSpeed",
215                 callBackPropertyName : "fanSpeed",
216                 interfaceName : "climateControl",
217                 conversionFunction : parseInteger
218         },
219         "TargetTemperatureRight" : {
220                 attributeName : "targetTemperature",
221                 callBackPropertyName : "targetTemperatureRight",
222                 interfaceName : "climateControl",
223                 conversionFunction : parseInteger
224                 //zone : new Zone(["Right"])
225         },
226         "TargetTemperatureLeft" : {
227                 attributeName : "targetTemperature",
228                 callBackPropertyName : "targetTemperatureLeft",
229                 interfaceName : "climateControl",
230                 conversionFunction : parseInteger
231                 //zone : new Zone(["Left"])
232         },
233         "Hazard" : {
234                 attributeName : "hazard",
235                 callBackPropertyName : "hazard",
236                 interfaceName : "lightStatus"
237         },
238         "Head" : {
239                 attributeName : "head",
240                 callBackPropertyName : "frontLights",
241                 interfaceName : "lightStatus"
242         },
243         "SeatHeaterRight" : {
244                 attributeName : "seatHeater",
245                 callBackPropertyName : "seatHeaterRight",
246                 interfaceName : "climateControl"
247                 //zone : new Zone(["Right"])
248         },
249         "SeatHeaterLeft" : {
250                 attributeName : "seatHeater",
251                 callBackPropertyName : "seatHeaterLeft",
252                 interfaceName : "climateControl"
253                 //zone : new Zone(["Left"])
254         },
255         "Parking" : {
256                 attributeName : "parking",
257                 callBackPropertyName : "rearLights",
258                 interfaceName : "lightStatus",
259         },
260         "AirConditioning" : {
261                 attributeName : "airConditioning",
262                 callBackPropertyName : "fan",
263                 interfaceName : "climateControl"
264         },
265         "AirRecirculation" : {
266                 attributeName : "airRecirculation",
267                 callBackPropertyName : "airRecirculation",
268                 interfaceName : "climateControl"
269         },
270         "AirflowDirection" : {
271                 attributeName : "airflowDirection",
272                 callBackPropertyName : "airflowDirection",
273                 interfaceName : "climateControl",
274                 conversionFunction : parseInteger
275         },
276         "BatteryStatus" : {
277                 attributeName : "chargeLevel",
278                 callBackPropertyName : "batteryStatus",
279                 interfaceName : "batteryStatus",
280                 conversionFunction : parseInteger
281         },
282         "FullBatteryRange" : {
283                 attributeName : "fullBatteryRange",
284                 callBackPropertyName : "fullBatteryRange",
285                 conversionFunction : parseInteger
286         },
287         "Exterior" : {
288                 attributeName : "exteriorTemperature",
289                 callBackPropertyName : "outsideTemp",
290                 interfaceName : "temperature",
291                 conversionFunction : parseInteger
292         },
293         "Interior" : {
294                 attributeName : "interiorTemperature",
295                 callBackPropertyName : "insideTemp",
296                 interfaceName : "temperature",
297                 conversionFunction : parseInteger
298         },
299         "WheelAngle" : {
300                 attributeName : "frontWheelRadius",
301                 callBackPropertyName : "wheelAngle",
302                 //interfaceName : "wheelConfiguration",
303                 conversionFunction : parseInteger
304         },
305         "Weather" : {
306                 attributeName : "weather",
307                 callBackPropertyName : "weather",
308                 conversionFunction : parseInteger
309         },
310         "AvgKW" : {
311                 attributeName : "avgKW",
312                 callBackPropertyName : "avgKW",
313                 //interfaceName : "AvgKW",
314                 conversionFunction : function(newValue) {
315                         "use strict";
316                         return parseFloat(newValue).toFixed(2);
317                 }
318         },
319         "VehicleSpeed" : {
320                 attributeName : "vehicleSpeed",
321                 callBackPropertyName : "speed",
322                 interfaceName : "vehicleSpeed",
323                 conversionFunction : parseInteger
324         },
325         "Odometer" : {
326                 attributeName : "odometer",
327                 callBackPropertyName : "odoMeter",
328                 interfaceName : "odometer",
329                 conversionFunction : parseInteger
330         },
331         "TransmissionShiftPosition" : {
332                 attributeName : "mode",
333                 callBackPropertyName : "gear",
334                 conversionFunction : function(value) {
335                         "use strict";
336                         switch (value) {
337                         case 0:
338                                 value = "P";
339                                 break;
340                         case 1:
341                                 value = "R";
342                                 break;
343                         case 2:
344                                 value = "N";
345                                 break;
346                         case 3:
347                                 value = "L";
348                                 break;
349                         case 4:
350                                 value = "D";
351                                 break;
352                         case 5:
353                                 value = "OD";
354                                 break;
355                         default:
356                                 value = "D";
357                                 break;
358                         }
359                         return value;
360                 },
361                 interfaceName : "transmission"
362         },
363         "Randomize" : {
364                 attributeName : "randomize",
365                 callBackPropertyName : "randomize",
366                 interfaceName : "Randomize"
367         },
368         "ExteriorBrightness" : {
369                 attributeName : "exteriorBrightness",
370                 callBackPropertyName : "exteriorBrightness"
371         },
372         "NightMode" : {
373                 attributeName : "mode",
374                 callBackPropertyName : "nightMode",
375                 interfaceName : "nightMode"
376         },
377         "DirectionIndicationINST" : {
378                 attributeName : "DirectionIndicationINST",
379                 callBackPropertyName : "DirectionIndicationINST",
380                 //interfaceName : "DirectionIndicationINST"
381         },
382         "DirectionIndicationMS" : {
383                 attributeName : "DirectionIndicationMS",
384                 callBackPropertyName : "DirectionIndicationMS",
385                 //interfaceName : "DirectionIndicationMS"
386         },
387         "ACCommand" : {
388                 attributeName : "ACCommand",
389                 callBackPropertyName : "ACCommand",
390                 //interfaceName : "ACCommand"
391         },
392         "RecircReq" : {
393                 attributeName : "RecircReq",
394                 callBackPropertyName : "RecircReq",
395                 //interfaceName : "RecircReq"
396         },
397         "FrontTSetRightCmd" : {
398                 attributeName : "FrontTSetRightCmd",
399                 callBackPropertyName : "FrontTSetRightCmd",
400                 //interfaceName : "FrontTSetRightCmd"
401         },
402         "FrontTSetLeftCmd" : {
403                 attributeName : "FrontTSetLeftCmd",
404                 callBackPropertyName : "FrontTSetLeftCmd",
405                 //interfaceName : "FrontTSetLeftCmd"
406         },
407         "FrontBlwrSpeedCmd" : {
408                 attributeName : "FrontBlwrSpeedCmd",
409                 callBackPropertyName : "FrontBlwrSpeedCmd",
410                 //interfaceName : "FrontBlwrSpeedCmd"
411         },
412         "HeatedSeatFRModeRequest" : {
413                 attributeName : "HeatedSeatFRModeRequest",
414                 callBackPropertyName : "HeatedSeatFRModeRequest",
415                 //interfaceName : "HeatedSeatFRModeRequest"
416         },
417         "HeatedSeatFRRequest" : {
418                 attributeName : "HeatedSeatFRRequest",
419                 callBackPropertyName : "HeatedSeatFRRequest",
420                 //interfaceName : "HeatedSeatFRRequest"
421         },
422         "HeatedSeatFLModeRequest" : {
423                 attributeName : "HeatedSeatFLModeRequest",
424                 callBackPropertyName : "HeatedSeatFLModeRequest",
425                 //interfaceName : "HeatedSeatFLModeRequest"
426         },
427         "HeatedSeatFLRequest" : {
428                 attributeName : "HeatedSeatFLRequest",
429                 callBackPropertyName : "HeatedSeatFLRequest",
430                 //interfaceName : "HeatedSeatFLRequest"
431         },
432         "FLHSDistrCmd" : {
433                 attributeName : "FLHSDistrCmd",
434                 callBackPropertyName : "FLHSDistrCmd",
435                 //interfaceName : "FLHSDistrCmd"
436         },
437         "FRHSDistrCmd" : {
438                 attributeName : "FRHSDistrCmd",
439                 callBackPropertyName : "FRHSDistrCmd",
440                 //interfaceName : "FRHSDistrCmd"
441         }
442 };
443
444 /**
445  * This method adds listener object for car events. Object should define function callbacks taking signal names from mapping table, e.g.:
446  * @example
447  *     {
448  *        onBatteryChange: function(newValue, oldValue) {}
449  *     }
450  * Methods are called back with new and last known values.
451  * @method addListener
452  * @param callback {Object} object with callback functions.
453  * @return {Integer} WatchID for later removal of listener.
454  */
455 CarIndicator.prototype.addListener = function(aCallbackObject) {
456         "use strict";
457         var id = Math.floor(Math.random() * 1000000);
458         var self = this;
459         this._listeners[id] = aCallbackObject;
460         this._listenerIDs.push(id);
461
462         var subscribeCallback = function(data) {
463                 self.onDataUpdate(data, self);
464         };
465         for ( var i in aCallbackObject) {
466                 if (aCallbackObject.hasOwnProperty(i)) {
467                         var prop = i.replace("on", "").replace("Changed", "");
468
469                         for ( var signal in this._mappingTable) {
470                                 if (this._mappingTable.hasOwnProperty(signal)) {
471                                         var mapping = this._mappingTable[signal];
472                                         var zone = mapping.zone;
473                                         var interfaceName = signal;
474
475                                         if (mapping.interfaceName !== "undefined") {
476                                                 interfaceName = mapping.interfaceName;
477                                         }
478
479                                         if (mapping.callBackPropertyName.toLowerCase() === prop.toLowerCase() && !mapping.subscribeCount) {
480                                                 mapping.subscribeCount = typeof (mapping.subscribeCount) === "undefined" ? 0 : mapping.subscribeCount++;
481
482                                                 if (typeof (tizen.vehicle[interfaceName]) !== "undefined") {
483                                                         if (!(interfaceName.toString().trim().toLowerCase() === "nightmode" && id === this._listenerIDs[0])) {
484                                                                 if (tizen.vehicle[interfaceName]){
485                                                                         var setUpData = tizen.vehicle[interfaceName].get(zone);
486                                                                         if (setUpData !== undefined)
487                                                                                 self.onDataUpdate(setUpData, self, id);
488                                                                 }
489                                                         }
490                                                         if (typeof (tizen.vehicle[interfaceName].subscribe) !== "undefined")
491                                                         {
492                                                                 console.log("Modello: Subscribing to AMB signal - " + interfaceName);
493                                                                 tizen.vehicle[interfaceName].subscribe(subscribeCallback, zone);
494                                                         }
495                                                 } else {
496                                                         if (typeof (tizen.vehicle[interfaceName]) === "undefined")
497                                                                 console.warn(interfaceName + " is not available to subscribe to");
498                                                         else
499                                                                 console.warn("Tizen API is not available, cannot subscribe to signal", signal);
500                                                 }
501                                         }
502                                 }
503                         }
504                 }
505         }
506
507         return id;
508 };
509 /**
510  * This method is call as callback if data oon tizen.vehicle was change onDataUpdate
511  * @method onDataUpdate
512  * @param data {object} object whit new data.
513  * @param self {object} this carIndicator Object.
514  * @param lisenersID {int} id of listener.
515  */
516 CarIndicator.prototype.onDataUpdate = function(data, self, lisenersID) {
517         "use strict";
518         if (data !== undefined) {
519                 if (data.zone !== undefined)
520                         var zone = data.zone.toString(2);
521                 else
522                         var zone = "0";
523                 var mapping;
524
525                 for ( var property in data) {
526                         if (data.hasOwnProperty(property)) {
527                                 mapping = undefined;
528                                 if (property !== "time" && property !== "zone" && property !== "interfaceName" && property.search("Sequence") === -1) {
529                                         for ( var element in self._mappingTable) {
530                                                 if (self._mappingTable.hasOwnProperty(element) && self._mappingTable[element].interfaceName !== undefined) {
531                                                         if (self._mappingTable[element].interfaceName.toLowerCase() === data.interfaceName.toLowerCase() &&
532                                                                 self._mappingTable[element].attributeName.toLowerCase() === property.toLowerCase()) {
533                                                                 /* jshint bitwise: false */
534                                                                 if (!(zone ^ self._mappingTable[element].zone)) {
535                                                                         /* jshint bitwise: true */
536                                                                         mapping = self._mappingTable[element];
537                                                                         break;
538                                                                 }
539                                                         }
540                                                 }
541                                         }
542
543                                         if (typeof (mapping) !== 'undefined') {
544                                                 var value = data[property];
545                                                 value = mapping.conversionFunction ? mapping.conversionFunction(value) : value;
546
547                                                 var oldValue = self.status[mapping.callBackPropertyName];
548                                                 if (oldValue !== value || property.toUpperCase() === "nightMode".toUpperCase()) {
549                                                         console.info("AMB property '" + property + "' has changed to new value:" + value);
550                                                         self.status[mapping.callBackPropertyName] = value;
551
552                                                         var callbackName = "on" + mapping.callBackPropertyName[0].toUpperCase() + mapping.callBackPropertyName.substring(1) + "Changed";
553                                                         var listener;
554
555                                                         if (lisenersID !== undefined) {
556                                                                 listener = self._listeners[lisenersID];
557
558                                                                 if (typeof (listener[callbackName]) === 'function') {
559                                                                         try {
560                                                                                 listener[callbackName](value, oldValue);
561                                                                         } catch (ex) {
562                                                                                 console.error("Error occured during executing listener", ex);
563                                                                         }
564                                                                 }
565                                                         } else {
566                                                                 for ( var i in self._listeners) {
567                                                                         if (self._listeners.hasOwnProperty(i)) {
568                                                                                 listener = self._listeners[i];
569
570                                                                                 if (typeof (listener[callbackName]) === 'function') {
571                                                                                         try {
572                                                                                                 listener[callbackName](value, oldValue);
573                                                                                         } catch (ex) {
574                                                                                                 console.error("Error occured during executing listener", ex);
575                                                                                         }
576                                                                                 }
577                                                                         }
578                                                                 }
579                                                         }
580                                                 }
581
582                                         } else {
583                                                 console.warn("Mapping for property '" + property + "' is not defined");
584                                         }
585                                 }
586                         }
587                 }
588         }
589 };
590
591 /**
592  * This method removes previosly added listener object. Use WatchID returned from addListener method.
593  * @method removeListener
594  * @param aId {Integer} WatchID.
595  */
596 CarIndicator.prototype.removeListener = function(aId) {
597         "use strict";
598         var listener = this._listeners[aId];
599
600         for ( var i in listener) {
601                 if (listener.hasOwnProperty(i)) {
602                         var prop = i.replace("on", "").replace("Changed", "");
603
604                         for ( var signal in this._mappingTable) {
605                                 if (this._mappingTable.hasOwnProperty(signal)) {
606                                         var mapping = this._mappingTable[signal];
607
608                                         if (mapping.subscribeCount === 0) { // Last signal, unscubscribe
609                                                 tizen.vehicle.unsubscribe(signal);
610                                                 mapping.subscribeCount = undefined;
611                                         } else if (typeof (mapping.subscribeCount) !== 'undefined') {
612                                                 mapping.subscribeCount--;
613                                         }
614                                 }
615                         }
616                 }
617         }
618
619         this._listeners[aId] = undefined;
620 };
621
622 /**
623  * status object
624  * @property status
625  * @type Object
626  * @private
627  */
628 CarIndicator.prototype.status = {
629         fanSpeed : 0,
630         targetTemperatureRight : 0,
631         targetTemperatureLeft : 0,
632         hazard : false,
633         frontDefrost : false,
634         rearDefrost : false,
635         frontLeftwhell : "",
636         frontRightwhell : "",
637         rearLeftwhell : "",
638         rearRightwhell : "",
639         childLock : false,
640         frontLights : false,
641         rearLights : false,
642         fan : false,
643         seatHeaterRight : 0,
644         seatHeaterLeft : 0,
645         airRecirculation : false,
646         airflowDirection : 0,
647         batteryStatus : 58,
648         fullBatteryRange : 350,
649         outsideTemp : 74.2,
650         insideTemp : 68.2,
651         wheelAngle : 0,
652         weather : 1,
653         avgKW : 0.28,
654         speed : 65,
655         odoMeter : 75126,
656         gear : "D",
657         nightMode : false,
658         randomize : false,
659         exteriorBrightness : 1000
660 };
661
662 /**
663  * This method return status object in callback
664  * @method getStatus
665  * @param callback {function} callback function.
666  */
667 CarIndicator.prototype.getStatus = function(callback) {
668         "use strict";
669         callback(this.status);
670 };
671
672 /**
673  * this method set status for property in tizen.vehicle and status object
674  * @method setStatus
675  * @param indicator {string} indicator name.
676  * @param status {??} ??.
677  * @param text_status {string} new status .
678  * @param callback {function} callback function.
679  */
680 CarIndicator.prototype.setStatus = function(indicator, newValue, callback, zone) {
681         "use strict";
682         var mappingElement, mappingProperty;
683         for ( var element in this._mappingTable) {
684                 if (this._mappingTable.hasOwnProperty(element)) {
685                         mappingProperty = undefined;
686                         if (this._mappingTable[element].callBackPropertyName.toLowerCase() === indicator.toLowerCase()) {
687                                 mappingElement = this._mappingTable[element];
688                                 mappingProperty = this._mappingTable[element].attributeName;
689                                 break;
690                         }
691                 }
692         }
693
694         // this.status[indicator] = status === "true";
695         if (mappingProperty !== undefined) {
696                 var objectName = mappingElement.interfaceName;
697                 var propertyZone = parseInt(mappingElement.zone, 2);
698                 var propertyValue = {};
699                 propertyValue[mappingProperty] = newValue;
700                 propertyValue.zone = propertyZone;
701
702                 tizen.vehicle.set(objectName, propertyValue, function(msg) {
703                         console.error("Set error: " + msg);
704                 });
705         }
706         if (!!callback) {
707                 callback();
708         }
709 };