From 69a3f5d3ca3d0e6aa277fb86c7317ae6d341d3e8 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Tue, 6 Aug 2013 15:36:50 -0700 Subject: [PATCH] updated idl and use UpperCamelCase for set operations --- packaging/wrt-plugins-ivi.changes | 5 + packaging/wrt-plugins-ivi.spec | 4 +- src/Vehicle/JSVehicle.cpp | 3 + src/Vehicle/Vehicle.idl | 188 +++++++++++++++++++------------------- 4 files changed, 104 insertions(+), 96 deletions(-) diff --git a/packaging/wrt-plugins-ivi.changes b/packaging/wrt-plugins-ivi.changes index b2655fa..10aba0a 100644 --- a/packaging/wrt-plugins-ivi.changes +++ b/packaging/wrt-plugins-ivi.changes @@ -1,3 +1,8 @@ +* Tue Aug 06 2013 +- Added set() call +- lowerCamelCase for object members +- updated idl + * Mon Jul 29 2013 - added supported() call - fix for callback garbage collection diff --git a/packaging/wrt-plugins-ivi.spec b/packaging/wrt-plugins-ivi.spec index 20bd558..892ed73 100644 --- a/packaging/wrt-plugins-ivi.spec +++ b/packaging/wrt-plugins-ivi.spec @@ -1,7 +1,7 @@ Name: wrt-plugins-ivi Summary: JavaScript plugins for WebRuntime for IVI -Version: 0.4.1 -Release: 23 +Version: 0.5.0 +Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/Vehicle/JSVehicle.cpp b/src/Vehicle/JSVehicle.cpp index d73a681..1b4063e 100644 --- a/src/Vehicle/JSVehicle.cpp +++ b/src/Vehicle/JSVehicle.cpp @@ -313,6 +313,9 @@ JSValueRef JSVehicle::set(JSContextRef context, LoggerD("value type: " << JSValueGetType(context, val)); + /// make sure the property is UpperCamelCase because that's how it look in AMB + std::transform(result.begin(), result.begin()+1, result.begin(), ::toupper); + objectMap[result] = val; } diff --git a/src/Vehicle/Vehicle.idl b/src/Vehicle/Vehicle.idl index d1e16f0..c3ee060 100644 --- a/src/Vehicle/Vehicle.idl +++ b/src/Vehicle/Vehicle.idl @@ -20,7 +20,7 @@ partial interface Navigator { interface VehiclePropertyType: Event { /** /brief time at which the vehicle generated the property **/ - attribute DOMTimeStamp Time; + attribute DOMTimeStamp time; }; [NoInterfaceObject] @@ -99,7 +99,7 @@ interface VehicleSpeed : VehiclePropertyType { /** VehicleSpeed * \brief Must return Vehicle Speed in kilometers per hour. **/ - attribute unsigned long VehicleSpeed; + attribute unsigned long vehicleSpeed; }; [NoInterfaceObject] @@ -108,7 +108,7 @@ interface EngineSpeed : VehiclePropertyType { /** EngineSpeed * \brief Must return Engine Speed in rotations per minute. **/ - attribute unsigned long EngineSpeed; + attribute unsigned long engineSpeed; }; [NoInterfaceObject] @@ -121,7 +121,7 @@ interface VehiclePowerMode : VehiclePropertyType { /** VehiclePowerMode * \brief Must return Vehicle Power mode (see VEHICLEPOWERMODE) **/ - attribute octet VehiclePowerMode; + attribute octet vehiclePowerMode; }; [NoInterfaceObject] @@ -130,7 +130,7 @@ interface TripMeter : VehiclePropertyType { /** TripMeters * \brief Must return trip meters. Changing any items in the array will reset the item's value to '0'. **/ - attribute sequence TripMeters; + attribute sequence tripMeters; }; [NoInterfaceObject] @@ -139,17 +139,17 @@ interface Acceleration : VehiclePropertyType { /** X * \brief Must return acceleration on the "X" axis as 1/1000 G (gravitational force). **/ - attribute unsigned long X; + attribute unsigned long x; /** Y * \brief Must return acceleration on the "Y" axis as 1/1000 G (gravitational force). **/ - attribute unsigned long Y; + attribute unsigned long y; /** Z * \brief Must return acceleration on the "Z" axis as 1/1000 G (gravitational force). **/ - attribute unsigned long Z; + attribute unsigned long z; }; [NoInterfaceObject] @@ -177,12 +177,12 @@ interface Transmission : VehiclePropertyType { /** GearPosition * \brief Must return transmission gear position (see TRANSMISSIONPOSITION) **/ - attribute octet GearPosition; + attribute octet gearPosition; /** Mode * \brief Must return transmission Mode (see **/ - attribute octet Mode; + attribute octet mode; }; [NoInterfaceObject] @@ -191,12 +191,12 @@ interface CruiseControlStatus : VehiclePropertyType { /** Activated * \brief Must return whether or not the Cruise Control system is active (true) or inactive (false) **/ - attribute boolean Activated; + attribute boolean activated; /** Speed * \brief Must return target Cruise Control speed in kilometers per hour (kph). **/ - attribute unsigned short Speed; + attribute unsigned short speed; }; [NoInterfaceObject] @@ -205,7 +205,7 @@ interface WheelBrake : VehiclePropertyType { /** Engaged * \brief Must return Wheel Brake status: Engaged = true, disengaged = false **/ - attribute boolean Engaged; + attribute boolean engaged; }; [NoInterfaceObject] @@ -214,42 +214,42 @@ interface LightStatus : VehiclePropertyType { /** Head * \brief Must return headlight status: on = true, off = false. **/ - attribute boolean Head; + attribute boolean head; /** RightTurn * \brief Must return right turn signal status: on = true, off = false. **/ - attribute boolean RightTurn; + attribute boolean rightTurn; /** LeftTurn * \brief Must return left turn signal status: on = true, off = false. **/ - attribute boolean LeftTurn; + attribute boolean leftTurn; /** Brake * \brief Must return brake signal light status: on = true, off = false. **/ - attribute boolean Brake; + attribute boolean brake; /** Fog * \brief Must return fog light status: on = true, off = false. **/ - attribute boolean Fog; + attribute boolean fog; /** Hazard * \brief Must return hazard light status: on = true, off = false. **/ - attribute boolean Hazard; + attribute boolean hazard; /** Parking * \brief Must return parking light status: on = true, off = false. **/ - attribute boolean Parking; + attribute boolean parking; /** HighBeam * \brief Must return high beam status: on = true, off = false. **/ - attribute boolean HighBeam; + attribute boolean highBeam; }; [NoInterfaceObject] @@ -258,17 +258,17 @@ interface InteriorLightStatus : VehiclePropertyType { /** Passenger * \brief Must return passenger interior light status: on = true, off = false **/ - attribute boolean Passenger; + attribute boolean passenger; /** Driver * \brief Must return driver interior light status: on = true, off = false **/ - attribute boolean Driver; + attribute boolean driver; /** Center * \brief Must return center interior light status: on = true, off = false **/ - attribute boolean Center; + attribute boolean center; }; [NoInterfaceObject] @@ -277,7 +277,7 @@ interface Horn : VehiclePropertyType { /** On * \brief Must return horn status: on = true, off = false **/ - attribute boolean On; + attribute boolean on; }; [NoInterfaceObject] @@ -286,27 +286,27 @@ interface Fuel : VehiclePropertyType { /** Level * \brief Must return fuel level as a percentage of fullness. **/ - attribute unsigned short Level; + attribute unsigned short level; /** Range * \brief Must return estimated fuel range in kilometers. **/ - attribute unsigned short Range; + attribute unsigned short range; /** InstantConsumption * \brief Must return instant fuel consumption in milliliters of fuel per second. **/ - attribute unsigned short InstantConsumption; + attribute unsigned short instantConsumption; /** InstantEconomy * \brief Must return instant fuel 'economy' in kilometers per liter of fuel. **/ - attribute unsigned short InstantEconomy; + attribute unsigned short instantEconomy; /** AverageEconomy * \brief Must return average fuel 'economy' in kilometers per liter of fuel since last reset. Setting this to any value should reset the counter to '0' **/ - attribute unsigned short AverageEconomy; + attribute unsigned short averageEconomy; }; [NoInterfaceObject] @@ -315,17 +315,17 @@ interface EngineOil : VehiclePropertyType { /** Remaining * \brief Must return remaining engine oil as percentage of fullness. **/ - attribute unsigned short Remaining; + attribute unsigned short remaining; /** Temperature * \brief Must return Engine Oil Temperature in Celcius. **/ - attribute long Temperature; + attribute long temperature; /** Pressure * \brief Must return Engine Oil Pressure in kPa. **/ - attribute unsigned short Pressure; + attribute unsigned short pressure; }; [NoInterfaceObject] @@ -334,22 +334,22 @@ interface Location : VehiclePropertyType { /** Latitude * \brief Must return latitude in Deg.Min (-180, +180) **/ - attribute double Latitude; + attribute double latitude; /** Longitude * \brief Must return longitude in Deg.Min (-90, +90) **/ - attribute double Longitude; + attribute double longitude; /** Altitude * \brief Must return altitude in meters above sea-level (0). **/ - attribute double Altitude; + attribute double altitude; /** Direction * \brief Must return direction in Degrees (0-360) **/ - attribute unsigned short Direction; + attribute unsigned short direction; }; [NoInterfaceObject] @@ -358,7 +358,7 @@ interface ExteriorBrightness : VehiclePropertyType { /** ExteriorBrightness * \brief Must return the brightness outside the vehicle in lux. **/ - attribute unsigned long ExteriorBrightness; + attribute unsigned long exteriorBrightness; }; [NoInterfaceObject] @@ -367,12 +367,12 @@ interface Temperature : VehiclePropertyType { /** Interior * \brief Must return the temperature of the interior of the vehicle in celcius. **/ - attribute signed short Interior; + attribute signed short interior; /** Exterior * \brief Must return the temperature of the exterior of the vehicle in celcius. **/ - attribute signed short Exterior; + attribute signed short exterior; }; [NoInterfaceObject] @@ -381,7 +381,7 @@ interface RainSensor : VehiclePropertyType { /** RainSensor * \brief Must return level of rain intensity 0: No Rain - 10: Heaviest Rain. **/ - attribute unsigned short RainSensor; + attribute unsigned short rainSensor; }; [NoInterfaceObject] @@ -394,7 +394,7 @@ interface WindshieldWiper : VehiclePropertyType { /** WindshieldWiper * \brief Must return Level of windshield whiper speed (see WIPERSPEED) **/ - attribute unsigned short WindshieldWiper; + attribute unsigned short windshieldWiper; }; dictionary DefrostDictionary { @@ -412,53 +412,53 @@ interface HVAC : VehiclePropertyType { /** AirflowDirection * \brief Must return airflow direction. See **/ - attribute unsigned short AirflowDirection; + attribute unsigned short airflowDirection; /** FanSpeed * \brief Must return speed of the fan (0-7) **/ - attribute unsigned short FanSpeed; + attribute unsigned short fanSpeed; /** TargetTemperature * \brief Must return target desired temperature in celcius. **/ - attribute unsigned short TargetTemperature; + attribute unsigned short targetTemperature; /** AirConditioning * \brief Must return air conditioning on (true) / off (false). **/ - attribute boolean AirConditioning; + attribute boolean airConditioning; /** AirRecirculation * \brief Must return air recirculation on (true) / off (false). **/ - readwrite attribute boolean AirRecirculation; + readwrite attribute boolean airRecirculation; /** Heater * \brief Must return heater on (true) / off (false). **/ - attribute boolean Heater; + attribute boolean heater; /** Defrost * \brief Must return the defrost status of all windows equiped with defrosters. This will return a dictionary of DefrostDictionary that represents * \brief each window and its defrost status. **/ - attribute DefrostDictionary Defrost; + attribute DefrostDictionary defrost; /** SteeringWheelHeater * \brief Must return air recirculation on (true) / off (false). **/ - attribute boolean SteeringWheelHeater; + attribute boolean steeringWheelHeater; /** SeatHeater * \brief Must return seat heater status: on (true) / off (false). **/ - attribute boolean SeatHeater; + attribute boolean seatHeater; /** SeatCooler * \brief Must return seat heater status: on (true) / off (false). **/ - attribute boolean SeatCooler; + attribute boolean seatCooler; }; [NoInterfaceObject] @@ -482,12 +482,12 @@ interface Sunroof : VehiclePropertyType { /** Openness * \brief Must return window status for sunroof openness percentage. **/ - readwrite attribute unsigned short Openness; + readwrite attribute unsigned short openness; /** Tilt * \brief Must return tilt status for sunroof percentage. **/ - readwrite attribute unsigned short Tilt; + readwrite attribute unsigned short tilt; }; [NoInterfaceObject] @@ -496,7 +496,7 @@ interface ConvertibleRoof : VehiclePropertyType { /** Openness * \brief Must return window status for sunroof openness percentage. **/ - readwrite attribute unsigned short Openness; + readwrite attribute unsigned short openness; }; [NoInterfaceObject] @@ -520,17 +520,17 @@ interface Size : VehiclePropertyType { /** Width * \brief MUST return width of vehicle in mm **/ - attribute unsigned long Width; + attribute unsigned long width; /** Height * \brief MUST return height of vehicle in mm **/ - attribute unsigned long Height; + attribute unsigned long height; /** Length * \brief MUST return length of vehicle in mm **/ - attribute unsigned long Length; + attribute unsigned long length; }; [NoInterfaceObject] @@ -548,12 +548,12 @@ interface FuelInfo : VehiclePropertyType { /** Type * \brief MUST return type of fuel. integer 0-4 (see **/ - attribute unsigned short Type; + attribute unsigned short type; /** RefuelPosition * \brief MUST return position of refuling (see **/ - attribute unsigned short RefuelPosition; + attribute unsigned short refuelPosition; }; [NoInterfaceObject] @@ -568,7 +568,7 @@ interface VehicleType : VehiclePropertyType { /** Type * \brief MUST return type of Vehicle. Integer 0-5 (see **/ - attribute unsigned short Type; + attribute unsigned short type; }; [NoInterfaceObject] @@ -580,7 +580,7 @@ interface Doors : VehiclePropertyType { * Example a common mini-van may have Doors[0] = 2 doors, * Doors[1] = 1 (side door), Doors[2] = 1 (trunk). **/ - attribute sequence DoorsPerRow; + attribute sequence doorsPerRow; }; [NoInterfaceObject] @@ -592,7 +592,7 @@ interface TransmissionGearType : VehiclePropertyType { /** TransmissionGearType * \brief MUST return transmission gear type of either Automatic, Manual or Constant Variable (CV). See **/ - attribute unsigned short TransmissionGearType; + attribute unsigned short transmissionGearType; }; [NoInterfaceObject] @@ -601,17 +601,17 @@ interface WheelInformation : VehiclePropertyType { /** FrontWheelRadius * \brief MUST return Radius of Front Wheel(s) in mm. **/ - attribute unsigned short FrontWheelRadius; + attribute unsigned short frontWheelRadius; /** RearWheelRadius * \brief MUST return Radius of Rear Wheel(s) in mm. **/ - attribute unsigned short RearWheelRadius; + attribute unsigned short rearWheelRadius; /** WheelTrack * \brief MUST return Wheel Track in mm. **/ - attribute unsigned long WheelTrack; + attribute unsigned long wheelTrack; /** ABS * \brief MUST return Antilock Brake System status: on = true, off = false. @@ -625,7 +625,7 @@ interface Odometer : VehiclePropertyType { /** Odometer * \brief MUST return Distance traveled in km **/ - attribute unsigned long Odometer; + attribute unsigned long odometer; }; [NoInterfaceObject] @@ -634,17 +634,17 @@ interface Fluid : VehiclePropertyType { /** Transmission * \brief MUST return Transmission fluid level percentage. 0-100. **/ - attribute unsigned short Transmission; + attribute unsigned short transmission; /** Brake * \brief MUST return Brake fluid level percentage. 0-100. **/ - attribute unsigned short Brake; + attribute unsigned short brake; /** Washer * \brief MUST return Washer fluid level percentage. 0-100. **/ - attribute unsigned short Washer; + attribute unsigned short washer; }; [NoInterfaceObject] @@ -653,12 +653,12 @@ interface Battery : VehiclePropertyType { /** Voltage * \brief MUST return battery voltage. **/ - attribute double Voltage; + attribute double voltage; /** Current * \brief MUST return battery current in Amperes **/ - attribute double Current; + attribute double current; }; [NoInterfaceObject] @@ -667,22 +667,22 @@ interface TirePressure : VehiclePropertyType { /** LeftFront * \brief MUST return left front tire pressure in kPa. **/ - attribute double LeftFront; + attribute double leftFront; /** RightFront * \brief MUST return right front tire pressure in kPa. **/ - attribute double RightFront; + attribute double rightFront; /** LeftRear * \brief MUST return left rear tire pressure in kPa. **/ - attribute double LeftRear; + attribute double leftRear; /** RightRear * \brief MUST return right rear tire pressure in kPa. **/ - attribute double RightRear; + attribute double rightRear; }; [NoInterfaceObject] @@ -691,22 +691,22 @@ interface TireTemperature : VehiclePropertyType { /** LeftFront * \brief MUST return left front tire temperature in Celcius. **/ - attribute double LeftFront; + attribute double leftFront; /** RightFront * \brief MUST return right front tire temperature in Celcius. **/ - attribute double RightFront; + attribute double rightFront; /** LeftRear * \brief MUST return left rear tire temperature in Celcius. **/ - attribute double LeftRear; + attribute double leftRear; /** RightRear * \brief MUST return right rear tire temperature in Celcius. **/ - attribute double RightRear; + attribute double rightRear; }; [NoInterfaceObject] @@ -715,7 +715,7 @@ interface SecurityAlert : VehiclePropertyType { /** SecurityAlert * \brief MUST return **/ - attribute boolean SecurityAlert; + attribute boolean securityAlert; }; [NoInterfaceObject] @@ -724,7 +724,7 @@ interface ParkingBrake : VehiclePropertyType { /** ParkingBrake * must return status of parking brake: Engaged = true, Disengaged = false. **/ - attribute boolean ParkingBrake; + attribute boolean parkingBrake; }; [NoInterfaceObject] @@ -733,7 +733,7 @@ interface ParkingLight : VehiclePropertyType { /** ParkingLight * must return status of parking light: Engaged = true, Disengaged = false. **/ - attribute boolean ParkingLight; + attribute boolean parkingLight; }; [NoInterfaceObject] @@ -742,7 +742,7 @@ interface HazardLight : VehiclePropertyType { /** HazardLight * must return status of hazard light: Engaged = true, Disengaged = false. **/ - attribute boolean HazardLight; + attribute boolean hazardLight; }; [NoInterfaceObject] @@ -751,7 +751,7 @@ interface AntilockBrakingSystem : VehiclePropertyType { /** AntilockBrakingSystem * \brief MUST return whether Antilock Braking System is Idle (false) or Engaged (true) **/ - attribute boolean AntilockBrakingSystem; + attribute boolean antilockBrakingSystem; }; [NoInterfaceObject] @@ -760,7 +760,7 @@ interface TractionControlSystem : VehiclePropertyType { /** TractionControlSystem * \brief MUST return whether Traction Control System is Off (false) or On (true) **/ - attribute boolean TractionControlSystem; + attribute boolean tractionControlSystem; }; [NoInterfaceObject] @@ -769,7 +769,7 @@ interface VehicleTopSpeedLimit : VehiclePropertyType { /** VehicleTopSpeedLimit * \brief MUST returns top rated speed in km/h. 0 = no limit **/ - attribute unsigned short VehicleTopSpeedLimit; + attribute unsigned short vehicleTopSpeedLimit; }; [NoInterfaceObject] @@ -785,7 +785,7 @@ interface AirbagStatus : VehiclePropertyType { /** AirbagStatus * \brief MUST returns a dictionary of Airbag (byte) and Status (byte) (see **/ - attribute object AirbagStatus; + attribute object airbagStatus; }; [NoInterfaceObject] @@ -804,19 +804,19 @@ interface DoorStatus : VehiclePropertyType { /** DoorStatus * \brief MUST returns dictionary of Door (byte) and Status (byte). See **/ - attribute object DoorStatus; + attribute object doorStatus; /** DoorLockStatus * \brief MUST returns dictionary of Door (byte) and Status (bool locked = true, unlocked = false). See **/ - attribute object DoorLockStatus; + attribute object doorLockStatus; /** ChildLockStatus * \brief MUST returns Child lock status of rear doors. active = true, inactive = false. * Setting this to 'true' will prevent the rear doors from being opened * from the inside. **/ - attribute boolean ChildLockStatus; + attribute boolean childLockStatus; }; [NoInterfaceObject] @@ -831,7 +831,7 @@ interface SeatBeltStatus : VehiclePropertyType { /** SeatBeltStatus * \brief MUST returns dictionary of Seat Belt (byte, see SEATBELTLOCATION) and Status (bool: Fasten = true, Unfastened = false) **/ - attribute object SeatBeltStatus; + attribute object seatBeltStatus; }; [NoInterfaceObject] @@ -849,7 +849,7 @@ interface OccupantStatus : VehiclePropertyType { /** OccupantStatus * \brief MUST returns dictionary of Occupant (byte see OCCUPANTLOCATION) and Status (byte, see **/ - attribute object OccupantStatus; + attribute object occupantStatus; }; [NoInterfaceObject] @@ -864,7 +864,7 @@ interface ObstacleDistance : VehiclePropertyType { /** ObstacleDistance * \brief MUST returns dictionary of Distance Sensor (byte, see DISTANCESENSORLOCATION) and distance (double) in m. **/ - attribute object ObstacleDistance; + attribute object obstacleDistance; }; }; -- 2.7.4