update ambinterface.cc and controlwebsocket.cc 77/15777/1 accepted/tizen_ivi_panda accepted/tizen_ivi_release tizen_ivi_panda tizen_ivi_release accepted/tizen/ivi/20140129.180550 accepted/tizen/ivi/panda/20140403.020005 accepted/tizen/ivi/release/20140312.121157 submit/tizen/20140129.070938 submit/tizen_ivi_panda/20140403.012149 submit/tizen_ivi_release/20140312.071500
authorMasayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
Mon, 27 Jan 2014 01:31:04 +0000 (10:31 +0900)
committerMasayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
Tue, 28 Jan 2014 04:40:03 +0000 (13:40 +0900)
Change-Id: Ic6e83271e8b7b595d445258d3bd3f29e2d72aac9
Signed-off-by: Masayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
packaging/ico-vic-amb-plugin.changes
src/ambinterface.cc
src/controlwebsocket.cc

index f6a13e4..4ac40d7 100644 (file)
@@ -1,3 +1,6 @@
+* Mon Jan 27 2014 Shibata Makoto <shibata@mac.tec.toyota.co.jp> submit/tizen_ivi_release/20140108.221004@92d36e8
+- update ambinterface.cc and controlwebsocket.cc
+
 * Thu Dec 26 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> submit/tizen/20131219.042044@419946f
 - 0.9.05 release
 -- modified: Add vehicle property to ico_set_vehicleinfo tool.
index e9275a5..bdf6fdd 100644 (file)
@@ -278,13 +278,17 @@ AMBIF::updateProperty(AMBVehicleInfo *vehicleinfo)
 {
     if (vehicleinfo->name == VehicleProperty::VehicleSpeed) {
         static uint16_t prevspd = -1;
-        static uint16_t spdmax = -1;
+        static const uint16_t unusablespd = -1;
         uint16_t spd = vehicleinfo->value->value<uint16_t>();
-        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";
+        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";
         }
-        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";
+        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";
         }
         prevspd = spd;
     }
index 9aff9d4..6d1b0a1 100644 (file)
@@ -398,26 +398,36 @@ 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<void*> *idserver = GenerateCommID<void*>::getInstance();
         int commid = idserver->getID(const_cast<void*>(id), -1);
         StandardMessage msg;
         char *buf = reinterpret_cast<char*>(detail->_ico_uws_message.recv_data);
         if (strcmp(&buf[0], "VELOCITY") == 0) {
             static uint16_t prevspd = -1;
-            static uint16_t spdmax = -1;
+            static const uint16_t unusablespd = -1;
             uint16_t spd = 0;
-            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";
+            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";
             }
-            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";
+            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";
             }
             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: