From 892992241f3afa0f9afd03b115d488a524887777 Mon Sep 17 00:00:00 2001 From: Masayuki Sasaki Date: Thu, 26 Dec 2013 16:37:33 +0900 Subject: [PATCH] Modified: Add vehicle property to ico_set_vehicleinfo tool. Revise: add manifest file for SMACK label setting. Change-Id: I09abfe9eb1f55ec936b36baf82dbc0f94c0254d0 Signed-off-by: Masayuki Sasaki --- ico-vic-amb-plugin.manifest | 5 +++++ packaging/ico-vic-amb-plugin.changes | 5 +++++ packaging/ico-vic-amb-plugin.spec | 15 ++++++++------- src/ambinterface.cc | 14 +++++--------- src/controlwebsocket.cc | 28 +++++++++------------------- tool/CMakeLists.txt | 1 + tool/ico_set_vehicleinfo.c | 22 +++++++++++++--------- 7 files changed, 46 insertions(+), 44 deletions(-) create mode 100644 ico-vic-amb-plugin.manifest diff --git a/ico-vic-amb-plugin.manifest b/ico-vic-amb-plugin.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/ico-vic-amb-plugin.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/ico-vic-amb-plugin.changes b/packaging/ico-vic-amb-plugin.changes index 47a7dd3..f6a13e4 100644 --- a/packaging/ico-vic-amb-plugin.changes +++ b/packaging/ico-vic-amb-plugin.changes @@ -1,3 +1,8 @@ +* Thu Dec 26 2013 Shibata Makoto submit/tizen/20131219.042044@419946f +- 0.9.05 release +-- modified: Add vehicle property to ico_set_vehicleinfo tool. +-- revise: add manifest file for SMACK label setting + * Fri Nov 29 2013 Shibata Makoto accepted/tizen_ivi_stable/20131116.012220@47cc4e3 - 0.9.04 release -- BugFix:TIVI-1991 diff --git a/packaging/ico-vic-amb-plugin.spec b/packaging/ico-vic-amb-plugin.spec index da1263f..78142a2 100644 --- a/packaging/ico-vic-amb-plugin.spec +++ b/packaging/ico-vic-amb-plugin.spec @@ -1,7 +1,7 @@ Name: ico-vic-amb-plugin Summary: Automotive Message Broker is a vehicle network abstraction system. -Version: 0.9.4 -Release: 2.1 +Version: 0.9.5 +Release: 1.1 Group: System Environment/Daemons License: LGPL v2.1 URL: "" @@ -16,11 +16,11 @@ BuildRequires: libjson-devel BuildRequires: automotive-message-broker-devel >= 0.10.0 BuildRequires: ico-uxf-utilities-devel >= 0.9.04 BuildRequires: ico-uxf-utilities >= 0.9.04 -BuildRequires: pkgconfig(ecore) -BuildRequires: pkgconfig(elementary) -BuildRequires: pkgconfig(edbus) -BuildRequires: pkgconfig(dbus-1) -BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(edbus) +BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(appcore-efl) %description Collection of plugins for automotive-message-broker @@ -45,6 +45,7 @@ cp tool/ico_set_vehicleinfo %{buildroot}/usr/bin/ico_set_vehicleinfo %postun -p /sbin/ldconfig %files +%manifest %{name}.manifest %defattr(-,root,root,-) %{_libdir}/automotive-message-broker/*.so %{_sysconfdir}/ambd/AMBformat.conf diff --git a/src/ambinterface.cc b/src/ambinterface.cc index bdf6fdd..e9275a5 100644 --- a/src/ambinterface.cc +++ b/src/ambinterface.cc @@ -278,17 +278,13 @@ AMBIF::updateProperty(AMBVehicleInfo *vehicleinfo) { if (vehicleinfo->name == VehicleProperty::VehicleSpeed) { static uint16_t prevspd = -1; - static const uint16_t unusablespd = -1; + static uint16_t spdmax = -1; uint16_t spd = vehicleinfo->value->value(); - if ((prevspd == unusablespd && spd > 0) || (prevspd == 0 && spd > 0)) { - DebugOut(3) << "PERF CHG_VIC_INF VIC-Plugin notify Code of update " - << vehicleinfo->name - << ". VehicleSpeed is 1km/h or more.\n"; + if ((prevspd == spdmax && spd > 0) || (prevspd == 0 && spd > 0)) { + DebugOut(3) << "PERF CHG_VIC_INF VIC-Plugin notify Code of update " << vehicleinfo->name << ". VehicleSpeed is 1km/h or more.\n"; } - else if ((prevspd == unusablespd && spd == 0) || - (prevspd > 0 && spd == 0)) { - DebugOut(3) << "PERF CHG_VIC_INF VIC-Plugin notify Code of update " - << vehicleinfo->name << ". VehicleSpeed is 0km/h.\n"; + else if ((prevspd == spdmax && spd == 0) || (prevspd > 0 && spd == 0)) { + DebugOut(3) << "PERF CHG_VIC_INF VIC-Plugin notify Code of update " << vehicleinfo->name << ". VehicleSpeed is 0km/h.\n"; } prevspd = spd; } diff --git a/src/controlwebsocket.cc b/src/controlwebsocket.cc index 6d1b0a1..9aff9d4 100644 --- a/src/controlwebsocket.cc +++ b/src/controlwebsocket.cc @@ -398,36 +398,26 @@ ControlWebsocket::callback_receive(const struct ico_uws_context *context, break; case ICO_UWS_EVT_RECEIVE: { - DebugOut(10) << "ControlWebsocket Start callback_recevie" - << " Receive message.\n"; + DebugOut(10) << "ControlWebsocket Start callback_recevie Receive message.\n"; GenerateCommID *idserver = GenerateCommID::getInstance(); int commid = idserver->getID(const_cast(id), -1); StandardMessage msg; char *buf = reinterpret_cast(detail->_ico_uws_message.recv_data); if (strcmp(&buf[0], "VELOCITY") == 0) { static uint16_t prevspd = -1; - static const uint16_t unusablespd = -1; + static uint16_t spdmax = -1; uint16_t spd = 0; - memcpy(&spd, - buf + StandardMessage::KEYEVENTTYPESIZE + - sizeof(struct timeval) + sizeof(int), - sizeof(uint16_t)); - if ((prevspd == unusablespd && spd > 0) || - (prevspd == 0 && spd > 0)) { - DebugOut(3) << "PERF CHG_VIC_INF Receive from VIC. Message is " - << &buf[0] << ". VELOCITY is 1km/h or more.\n"; + memcpy(&spd, buf + StandardMessage::KEYEVENTTYPESIZE + sizeof(struct timeval) + sizeof(int), sizeof(uint16_t)); + if ((prevspd == spdmax && spd > 0) || (prevspd == 0 && spd > 0)) { + DebugOut(3) << "PERF CHG_VIC_INF Receive from VIC. Message is " << &buf[0] << ". VELOCITY is 1km/h or more.\n"; } - else if ((prevspd == unusablespd && spd == 0) || - (prevspd > 0 && spd == 0)) { - DebugOut(3) << "PERF CHG_VIC_INF Receive from VIC. Message is " - << &buf[0] << ". VELOCITY is 0km/h.\n"; + else if ((prevspd == spdmax && spd == 0) || (prevspd > 0 && spd == 0)) { + DebugOut(3) << "PERF CHG_VIC_INF Receive from VIC. Message is " << &buf[0] << ". VELOCITY is 0km/h.\n"; } prevspd = spd; } - container->ctrlws->receive(commid, buf, - detail->_ico_uws_message.recv_len); - DebugOut(10) << "ControlWebsocket End " - << "callback_recevie Receive message.\n"; + container->ctrlws->receive(commid, buf, detail->_ico_uws_message.recv_len); + DebugOut(10) << "ControlWebsocket End callback_recevie Receive message.\n"; break; } case ICO_UWS_EVT_ADD_FD: diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt index b885335..5669512 100644 --- a/tool/CMakeLists.txt +++ b/tool/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 2.8) include(CheckIncludeFiles) set(ico_set_vehicleinfo_sources ico_set_vehicleinfo.c) diff --git a/tool/ico_set_vehicleinfo.c b/tool/ico_set_vehicleinfo.c index e5d0568..d24d36a 100644 --- a/tool/ico_set_vehicleinfo.c +++ b/tool/ico_set_vehicleinfo.c @@ -44,7 +44,9 @@ static const struct { char *prop; char *eventtype; unsigned char datatype[5]; -} vehicleinfo_key[] = { +} + +vehicleinfo_key[] = { { "VehicleSpeed", "VELOCITY", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, { "Speed", "VELOCITY", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, { "Velocity", "VELOCITY", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, @@ -61,14 +63,17 @@ static const struct { { "Winker", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, { "TurnSignal", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, { "Turn", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, - { "lightStatus", "LIGHTSTATUS", {TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, 0} }, + { "lightStatus", "LIGHTSTATUS", {TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_NULL} }, { "light", "LIGHTSTATUS", {TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, 0} }, - { "WATER_TEMP", "WATER_TEMP", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, - { "EXTERIORBRIGHTNESS", "EXTERIORBRIGHTNESS", {TYPE_UINT16, TYPE_NULL, 0, 0, 0} }, - { "EXTERIOR", "EXTERIORBRIGHTNESS", {TYPE_UINT16, TYPE_NULL, 0, 0, 0} }, - { "STEERING", "STEERING", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, - { "steering", "STEERING", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, - { "\0", "\0", {TYPE_NULL, 0, 0, 0, 0} } }; + { "Warter_Temp", "WATER_TEMP", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, + { "WarterTemp", "WATER_TEMP", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, + { "ExteriorBrightness", "EXTERIORBRIGHTNESS", {TYPE_UINT16, TYPE_NULL, 0, 0, 0} }, + { "Exterior", "EXTERIORBRIGHTNESS", {TYPE_UINT16, TYPE_NULL, 0, 0, 0} }, + { "Steering", "STEERING", {TYPE_INT32, TYPE_NULL, 0, 0, 0} }, + { "TripMeter", "TRIPMETER", {TYPE_INT16, TYPE_INT16, TYPE_INT16, TYPE_NULL, 0} }, + { "Fuel", "FUEL", {TYPE_INT16, TYPE_INT16, TYPE_INT16, TYPE_INT16, TYPE_NULL} }, + { "\0", "\0", {TYPE_NULL, 0, 0, 0, 0} } +}; struct KeyDataMsg_t { @@ -388,4 +393,3 @@ main(int argc, char *argv[]) exit(0); } - -- 2.7.4