diff options
author | Marek Timko <marek.timko@ixonos.com> | 2013-11-29 16:31:38 +0100 |
---|---|---|
committer | Marek Timko <marek.timko@ixonos.com> | 2013-11-29 16:31:38 +0100 |
commit | 9e436563607021c43d3944651234a6c86ee53c89 (patch) | |
tree | bd588f9f17cd6102cd8b34bdb2183f5fe422e330 | |
parent | 2bb698aea77ceba7cdc555719e9a63da76446441 (diff) | |
parent | 1c172ea3441435313c2d66ea58898583dfb7a459 (diff) | |
download | automotive-message-broker-9e436563607021c43d3944651234a6c86ee53c89.tar.gz |
Merge remote-tracking branch 'upstream/master' into memleaks
-rw-r--r-- | docs/amb.idl | 11 | ||||
-rw-r--r-- | examples/gpsnmea | 2 | ||||
-rw-r--r-- | packaging.in/amb.manifest | 25 | ||||
-rw-r--r-- | plugins/dbus/environmentproperties.h | 44 | ||||
-rw-r--r-- | plugins/gpsnmea/gpsnmea.cpp | 22 |
5 files changed, 51 insertions, 53 deletions
diff --git a/docs/amb.idl b/docs/amb.idl index 016793f3..2b609323 100644 --- a/docs/amb.idl +++ b/docs/amb.idl @@ -456,13 +456,14 @@ interface org.automotive.HVAC : VehiclePropertyType { [NoInterfaceObject] interface org.automotive.WindowStatus : VehiclePropertyType { - /** WindowStatus - * \brief Must return window status for the window location see "zone" attribute + /** Openness + * \brief Must return window openness percentage (100% fully open, 0% fully closed) + * for the window location see "zone" attribute **/ - attribute UInt16 WindowStatus; + attribute UInt16 Openness; /** Defrost - * \brief Must return the defrost status of the window equiped with a defroster. + * \brief Must return the defroster status of the window. On = true, Off = false. **/ attribute Boolean Defrost; }; @@ -485,7 +486,7 @@ interface org.automotive.Sunroof : VehiclePropertyType { interface org.automotive.ConvertibleRoof : VehiclePropertyType { /** Openness - * \brief Must return window status for sunroof openness percentage. + * \brief Must return convertible roof openness percentage. **/ attribute UInt16 Openness; }; diff --git a/examples/gpsnmea b/examples/gpsnmea index dd77c224..039199f6 100644 --- a/examples/gpsnmea +++ b/examples/gpsnmea @@ -4,7 +4,7 @@ "name" : "gps nmea plugin", "path" : "/usr/lib/automotive-message-broker/gpsnmea.so", "test" : "true", - "device" : "00:1C:88:13:4E:9C" + "device" : "/dev/ttyACM0" } ], "sinks": [ diff --git a/packaging.in/amb.manifest b/packaging.in/amb.manifest new file mode 100644 index 00000000..9d2706e0 --- /dev/null +++ b/packaging.in/amb.manifest @@ -0,0 +1,25 @@ +<manifest> + <define> + <domain name="AMB" /> + <provide> + <label name="AMB::machinegun" /> + </provide> + <request> + <smack request="AMB::machinegun" type="rw" /> + </request> + </define> + <assign> + <dbus name="org.automotive.message.broker" own="AMB" bus="system"> + <node name="/org/automotive/uncategorized/MachineGunTurretStatus"> + <interface name="org.freedesktop.DBus.Properties"> + <method name="Set" > + <annotation name="com.tizen.smack" value="AMB::machinegun" /> + </method> + </interface> + </node> + </dbus> + </assign> + <request> + <domain name="AMB" /> + </request> +</manifest> diff --git a/plugins/dbus/environmentproperties.h b/plugins/dbus/environmentproperties.h index 5f8073b2..4172bd15 100644 --- a/plugins/dbus/environmentproperties.h +++ b/plugins/dbus/environmentproperties.h @@ -199,30 +199,8 @@ public: WindowStatusProperty(AbstractRoutingEngine* re, GDBusConnection* connection) :DBusSink("WindowStatus", re, connection, map<string, string>()) { - /** - * @enum const unsigned short WINDOWLOCATION_DRIVER= 0; - * @enum const unsigned short WINDOWLOCATION_PASSENGER = 1; - * @enum const unsigned short WINDOWLOCATION_LEFTREAR = 2; - * @enum const unsigned short WINDOWLOCATION_RIGHTREAR = 3; - * @enum const unsigned short WINDOWLOCATION_REAR = 4; - **/ - - /** - * @attributeName WindowStatus - * @type object - * @access readwrite - * @attributeComment \brief Must return window status for each window location. object returned is a - * @attributeComment unsigned short percentage opened - */ - wantPropertyVariant(VehicleProperty::WindowStatus,"WindowStatus", "q", AbstractProperty::ReadWrite); + wantPropertyVariant(VehicleProperty::WindowStatus,"Openness", "q", AbstractProperty::ReadWrite); - /** - * @attributeName Defrost - * @type object - * @access readwrite - * @attributeComment \brief Must return the defrost status of all windows equiped with defrosters. This will return a dictionary of { unsigned short, boolean } that represents - * @attributeComment \brief each window and its defrost status. - */ wantPropertyVariant(VehicleProperty::Defrost, "Defrost", "b", AbstractProperty::ReadWrite); } }; @@ -234,20 +212,8 @@ public: Sunroof(AbstractRoutingEngine* re, GDBusConnection* connection) :DBusSink("Sunroof", re, connection, map<string, string>()) { - /** - * @attributeName Openness - * @type unsigned short - * @access readwrite - * @attributeComment \brief Must return window status for sunroof openness percentage. - */ wantPropertyVariant(VehicleProperty::Sunroof, "Openness", "y", AbstractProperty::ReadWrite); - /** - * @attributeName Tilt - * @type unsigned short - * @access readwrite - * @attributeComment \brief Must return tilt status for sunroof percentage. - */ wantPropertyVariant(VehicleProperty::SunroofTilt, "Tilt", "y", AbstractProperty::ReadWrite); } @@ -260,13 +226,7 @@ public: ConvertibleRoof(AbstractRoutingEngine* re, GDBusConnection* connection) :DBusSink("ConvertibleRoof", re, connection, map<string, string>()) { - /** - * @attributeName Openness - * @type unsigned short - * @access readwrite - * @attributeComment \brief Must return window status for sunroof openness percentage. - */ - wantPropertyVariant(VehicleProperty::ConvertibleRoof, "ConvertibleRoof", "b", AbstractProperty::ReadWrite); + wantPropertyVariant(VehicleProperty::ConvertibleRoof, "Openness", "y", AbstractProperty::ReadWrite); } }; #endif diff --git a/plugins/gpsnmea/gpsnmea.cpp b/plugins/gpsnmea/gpsnmea.cpp index 9e58bfdf..b5fa7eb5 100644 --- a/plugins/gpsnmea/gpsnmea.cpp +++ b/plugins/gpsnmea/gpsnmea.cpp @@ -52,7 +52,7 @@ std::string gprmcRegEx = "[\\$]?GPRMC,([0-1][0-9]|2[0-3])([0-5][0-9])([0-5][0-9] "([EW])," /** lon E or W **/ "([0-9]{3}\\.[0-9])," /** Speed in knots **/ "(3[0-5][0-9]|[0-2][0-9]{2}\\.[0-9])," /** Direction **/ - "(3[0-1]|[1-2][0-9]|0[1-9])(0[1-9]|1[0-2])([0-9]{2})," + "(3[0-1]|[1-2][0-9]|0[1-9])(0[1-9]|1[0-2])([0-9]{2})," /** Date stamp **/ "(180|[1][0-7][0-9]|[0][0-9]{2}\\.[0-9])," /** Magnetic variation **/ "([EW])" /** Magnetic Direction **/ "\\*([0-9,A-F]{2})"; @@ -113,7 +113,7 @@ private: ///methods: void parseGprmc(string gprmc); void parseGpgga(string gpgga); - void parseTime(std::string h, std::string m, std::string s); + void parseTime(std::string h, std::string m, std::string s, string dd, string mm, string yy); void parseLatitude(std::string d, std::string m, std::string ns); void parseLongitude(std::string d, string m, string ew); void parseSpeed(std::string spd); @@ -168,13 +168,22 @@ void Location::parseGprmc(string gprmc) if (boost::regex_match (gprmc, tokens, regularExpression) ) { - parseTime(tokens[1],tokens[2],tokens[3]); + if(tokens[4] == "A") { isActive = true; } + int i=0; + for(auto tok : tokens) + { + DebugOut(0)<<i++<<":"<<tok<<endl; + + } + + parseTime(tokens[1],tokens[2],tokens[3],tokens[13],tokens[14],tokens[15]); + parseLatitude(tokens[5], tokens[6], tokens[7]); parseLongitude(tokens[8], tokens[9], tokens[10]); parseSpeed(tokens[11]); @@ -194,7 +203,6 @@ void Location::parseGpgga(string gpgga) return; } - parseTime(tokens[1].substr(0,2),tokens[1].substr(2,2),tokens[1].substr(4,2)); parseLatitude(tokens[2],"",tokens[3]); parseLongitude(tokens[4],"",tokens[5]); if(tokens[6] != "0") @@ -206,12 +214,15 @@ void Location::parseGpgga(string gpgga) parseAltitude(tokens[9]); } -void Location::parseTime(string h, string m, string s) +void Location::parseTime(string h, string m, string s, string dd, string mm, string yy) { tm t; t.tm_hour = boost::lexical_cast<int>(h); t.tm_min = boost::lexical_cast<int>(m); t.tm_sec = boost::lexical_cast<int>(s); + t.tm_mday = boost::lexical_cast<int>(dd); + t.tm_mon = boost::lexical_cast<int>(mm); + t.tm_year = boost::lexical_cast<int>(yy) + 100; time_t time = mktime(&t); @@ -388,6 +399,7 @@ GpsNmeaSource::GpsNmeaSource(AbstractRoutingEngine *re, map<string, string> conf DebugOut()<<"lat: "<<location.latitude().toString()<<endl; g_assert(location.latitude().toString() == "-23.86600833"); + g_assert(location.gpsTime().toString() == "1050585131"); location.parse("GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47"); |