From 9cc04404780fff849dbd047c9af3479eb719a8c2 Mon Sep 17 00:00:00 2001 From: Nakamura Hayato Date: Fri, 30 Aug 2013 20:05:31 +0900 Subject: [PATCH] Bug fix TIVI-991. Change-Id: I8ca081c16a989bcc438e8513ffb7c75b96ac2588 Signed-off-by: Nakamura Hayato --- packaging/ico-vic-amb-plugin.changes | 5 +++++ packaging/ico-vic-amb-plugin.spec | 13 +++++-------- src/AMBformat.conf | 2 +- tool/ico_set_vehicleinfo.c | 14 ++++++++++++-- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/packaging/ico-vic-amb-plugin.changes b/packaging/ico-vic-amb-plugin.changes index 0f27c5a..634ca66 100644 --- a/packaging/ico-vic-amb-plugin.changes +++ b/packaging/ico-vic-amb-plugin.changes @@ -1,3 +1,8 @@ +* Fri Aug 30 2013 Shibata Makoto accepted/2.0alpha-wayland/20130603.172856@28877d7 +- release 0.9.01 +-- Bug fix for TIVI-991 : Modify ico_set_vehicleinfo. +-- Can not reproduce TIVI-823. + * Wed Jul 17 2013 Shibata Makoto accepted/2.0alpha-wayland/20130603.172856@298d6ff - 0.2.1 release. - Change to ico-uxf-utilities from libwebsocket diff --git a/packaging/ico-vic-amb-plugin.spec b/packaging/ico-vic-amb-plugin.spec index c2a54cc..5573767 100644 --- a/packaging/ico-vic-amb-plugin.spec +++ b/packaging/ico-vic-amb-plugin.spec @@ -1,23 +1,20 @@ Name: ico-vic-amb-plugin Summary: Automotive Message Broker is a vehicle network abstraction system. -Version: 0.2.1 -Release: 1 +Version: 0.9.0 +Release: 1.1 Group: System Environment/Daemons License: LGPL v2.1 URL: "" Source0: %{name}-%{version}.tar.bz2 Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig -#Requires: json-glib Requires: libjson Requires: ico-uxf-utilities BuildRequires: cmake BuildRequires: boost-devel -#BuildRequires: json-glib-devel BuildRequires: libjson-devel BuildRequires: automotive-message-broker-devel >= 0.6.9 BuildRequires: ico-uxf-utilities-devel -#BuildRequires: libwebsockets-devel >= 1.2 %description Collection of plugins for automotive-message-broker @@ -34,10 +31,9 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install mkdir -p %{buildroot}/%{_sysconfdir}/ambd +mkdir -p %{buildroot}/usr/local/bin cp src/AMBformat.conf %{buildroot}/%{_sysconfdir}/ambd/ - -mkdir -p %{buildroot}/%{_sysconfdir}/ambd -cp src/AMBformat.conf %{buildroot}/%{_sysconfdir}/ambd/ +cp tool/ico_set_vehicleinfo %{buildroot}/usr/local/bin/ico_set_vehicleinfo %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -47,3 +43,4 @@ cp src/AMBformat.conf %{buildroot}/%{_sysconfdir}/ambd/ %{_libdir}/automotive-message-broker/*.so %{_sysconfdir}/ambd/AMBformat.conf /usr/share/doc/automotive-message-broker/%{name}/README +/usr/local/bin/ico_set_vehicleinfo diff --git a/src/AMBformat.conf b/src/AMBformat.conf index 30d0c07..b865918 100644 --- a/src/AMBformat.conf +++ b/src/AMBformat.conf @@ -932,7 +932,7 @@ [ { "AMBPropertyName":"Direction", - "Type":"int", + "Type":"uint16_t", "AccessControl":"R", "Default":"0", "DBusProperty":"Direction" diff --git a/tool/ico_set_vehicleinfo.c b/tool/ico_set_vehicleinfo.c index 9e838aa..16f0c91 100644 --- a/tool/ico_set_vehicleinfo.c +++ b/tool/ico_set_vehicleinfo.c @@ -49,7 +49,7 @@ static const struct { { "Speed", "VELOCITY", {TYPE_INT32, TYPE_NULL, 0,0} }, { "Velocity", "VELOCITY", {TYPE_INT32, TYPE_NULL, 0,0} }, { "Location", "LOCATION", {TYPE_DOUBLE, TYPE_DOUBLE, TYPE_DOUBLE, TYPE_NULL} }, - { "Direction", "DIRECTION", {TYPE_DOUBLE, TYPE_NULL, 0,0} }, + { "Direction", "DIRECTION", {TYPE_INT32, TYPE_NULL, 0,0} }, { "EngineSpeed", "ENGINE_SPEED", {TYPE_INT32, TYPE_NULL, 0, 0} }, { "Engine", "ENGINE_SPEED", {TYPE_INT32, TYPE_NULL, 0, 0} }, { "Shift", "SHIFT", {TYPE_SHIFT, TYPE_BYTE, TYPE_NULL, 0} }, @@ -115,12 +115,17 @@ init_comm(const int port, const char *spadr) uri_name, port); exit(2); } - ico_uws_set_event_cb(context, uws_callback, NULL); + if (ico_uws_set_event_cb(context, uws_callback, NULL) != + ICO_UWS_ERR_NONE) { + fprintf(stderr, "Can not set callback.\n"); + exit(2); + } /* wait for connection */ for (rep = 0; rep < (2*1000); rep += 50) { if (connected) break; ico_uws_service(context); + usleep(50 * 1000); } } @@ -335,6 +340,11 @@ main(int argc, char *argv[]) init_comm(port, spadr); + if (!connected) { + fprintf(stderr, "Can't connect server.\n"); + exit(-1); + } + if (j <= 0) { while (fgets(buf, sizeof(buf), stdin)) { j = -1; -- 2.7.4