From 3a3ade37677f46ac41a9a8522f9021e6a33e63f1 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Mon, 5 Aug 2013 16:01:14 -0700 Subject: [PATCH] updated idl to reflect manager interface --- TODO | 6 ++--- docs/amb.idl | 65 ++++++++++++++++++------------------------------- docs/manager.txt | 6 ++--- lib/vehicleproperty.cpp | 2 ++ lib/vehicleproperty.h | 3 +++ 5 files changed, 35 insertions(+), 47 deletions(-) diff --git a/TODO b/TODO index 8b8df22..3ffa108 100644 --- a/TODO +++ b/TODO @@ -3,9 +3,9 @@ For 0.11 - Implement all the DBus properties in the docs/ directory. -- DBus support for time and sequece being an additional api call (ie, getExtendedVehicleSpeedInfo()). -- DBus support for objects with multiple sources and multiple 'zones' (ie /org/automotive/${sourceID}/[${zone}/]batteryVoltage) -- Document changes to the DBus API in the IDL +- DBus support for time and sequece being an additional api call (ie, getVehicleSpeed()). DONE +- DBus support for objects with multiple sources and multiple 'zones' (/${sourceID}/[${zone}/]batteryVoltage) DONE +- Document changes to the DBus API in the IDL - autoreconnect on a timeout when Obd2 disconnects if 'autoreconnect' is 'true' in the config - update json protocol to include getPropertyInfo calls - update database to support zone column diff --git a/docs/amb.idl b/docs/amb.idl index c5f0043..9c9fb0f 100644 --- a/docs/amb.idl +++ b/docs/amb.idl @@ -12,17 +12,6 @@ Details. module Vehicle { -partial interface Navigator { - readonly attribute Vehicle vehicle; -}; - -[NoInterfaceObject] -interface VehiclePropertyType: Event { - /** /brief time at which the vehicle generated the property - **/ - readonly attribute DOMTimeStamp time; -}; - [NoInterfaceObject] interface VehiclePropertyError { const unsigned short PERMISSION_DENIED = 1; @@ -41,50 +30,44 @@ interface VehiclePropertyError { readonly attribute DOMString message; }; -callback VehiclePropertyCallback = void (VehiclePropertyType value); - -callback VehiclePropertyErrorCallback = void (VehiclePropertyError error); - -callback VehiclePropertyListCallback = void (sequence values); - -callback SupportedPropertiesCallback = void (sequence properties); - +enum Zone { + None = 0, + Front = 1, + Middle = 1 << 1, + Right = 1 << 2, + Left = 1 << 3, + Rear = 1 << 4, + Center = 1 << 5 +} [NoInterfaceObject] -interface Vehicle { +interface Manager { /** - * \brief returns supported properties - * \arg VehiclePropertyCallback successCallback function to be called when method has completed successfully - * \arg VehiclePropertyErrorCallback errorCallback this function is called when an error has occured. + * \brief returns supported properties **/ - getSupported(SupportedPropertiesCallback successCallback, optional VehiclePropertyErrorCallback errorCallback); + sequence list(); /** - * \brief fetch the current value for 'property'. + * \brief find the DBus object path which matches "objectName" and "zone". * \arg DOMString property is the requested property to be retrieved. - * \arg VehiclePropertyCallback successCallback function to be called when method has completed successfully - * \arg VehiclePropertyErrorCallback errorCallback this function is called when an error has occured. + * \arg Zone zone is the zone which the object + * \returns string representing the DBus Object path **/ - get(DOMString property, VehiclePropertyCallback successCallback, optional VehiclePropertyErrorCallback errorCallback); + DOMString findObjectForZone(DOMString objectName, Zone zone); /** - * \brief set the given property to value - * \arg DOMString property property to set - * \arg VehiclePropertyType value value to set - * \arg VehiclePropertyCallback successCallback callback if operation is successfull - * \arg VehiclePropertyErrorCallback errorCallback callback if error has been called. + * \brief find the DBus object path matching the given "objectName" + * \arg DOMString objectName to find + * \returns list of object paths that provide the given object Name. **/ - set(DOMString property, VehiclePropertyType value, optional VehiclePropertyCallback successCallback, optional VehiclePropertyErrorCallback errorCallback); + sequence findObject(DOMString objectName) /** - * \brief get values for a given property within a certain past time period between 'startTime' and 'endTime' - * \arg DOMString property property to request - * \arg Date startTime, starting period of time. - * \arg Date endTime, ending period of time. - * \arg VehiclePropertyListCallback successCallback. Callback with the result of the method call - * \arg VehiclePropertyErrorCallback errorCallback. Callback if an error has occurred. + * \brief get a list of zones for a given objectName. + * \arg DOMString objectName object name. + * \returns list of zones for the given objectName (@see Zone) **/ - getHistory(DOMString property, Date startTime, Date endTime, VehiclePropertyListCallback successCallback, optional VehiclePropertyErrorCallback errorCallback); + sequence zonesForObjectName(DOMString objectName) }; [NoInterfaceObject] diff --git a/docs/manager.txt b/docs/manager.txt index 7f7c357..0e1241d 100644 --- a/docs/manager.txt +++ b/docs/manager.txt @@ -6,15 +6,15 @@ Methods: Array{ObjectPath} findObject(string objectName) - returns list of object paths that provide the given property. + returns list of object paths that provide the given objectName. Array{int32} zonesForObjectName(string objectName) - returns list of zones for a given property. + returns list of zones for a given objectName. ObjectPath findObjectForZone(string objectName, int32 zone) - returns object path which provides the given property in the given zone. + returns object path which provides the given objectName in the given zone. Array{ObjectPath} list() diff --git a/lib/vehicleproperty.cpp b/lib/vehicleproperty.cpp index 0354dbf..8a8085c 100644 --- a/lib/vehicleproperty.cpp +++ b/lib/vehicleproperty.cpp @@ -146,6 +146,7 @@ const VehicleProperty::Property VehicleProperty::WindowStatus = "WindowStatus"; const VehicleProperty::Property VehicleProperty::Sunroof = "Sunroof"; const VehicleProperty::Property VehicleProperty::SunroofTilt = "SunroofTilt"; const VehicleProperty::Property VehicleProperty::ConvertibleRoof = "ConvertibleRoof"; +const VehicleProperty::Property VehicleProperty::NightMode = "NightMode"; std::list VehicleProperty::mCapabilities; @@ -326,6 +327,7 @@ VehicleProperty::VehicleProperty() REGISTERPROPERTY(Sunroof,0); REGISTERPROPERTY(SunroofTilt,0); REGISTERPROPERTY(ConvertibleRoof,false); + REGISTERPROPERTY(NightMode,false); } diff --git a/lib/vehicleproperty.h b/lib/vehicleproperty.h index 3914b1c..00bbaa2 100644 --- a/lib/vehicleproperty.h +++ b/lib/vehicleproperty.h @@ -765,6 +765,9 @@ public: PROPERTYTYPEBASIC(ConvertibleRoof, bool) //typedef BasicPropertyType ConvertibleRoofType; + static const Property NightMode; + PROPERTYTYPEBASIC(NightMode, bool) + /** END PROPERTIES **/ -- 2.7.4