diff options
author | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2015-11-13 16:11:35 +0900 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.200> | 2015-11-13 20:17:58 +0000 |
commit | 1cabebe572defd64c998c484b623d8d7ad31b93e (patch) | |
tree | c2e7594665862a3d4e00a660dcc03c924457a4dc /meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker/0004-cansocketbcm-Fix-reading-of-frames-in-case-of-RX_TIM.patch | |
parent | 9494cf383ad66063fcbc58f9c36fa9e48f479f5e (diff) |
Update AMB with amb-qt(qml) plugins to latest
To use CogentEmbedded fixes to amb-qt(qml) plugins of AMB, the
recipes for AMB has been updated:
- Pulling CogentEmbeeded's repository as upstream
- Apply some patches to fix some issue around amb-qt plugins
(these are from branch 'dev_0.14_2')
Change-Id: I81bf63d26446ec720343c4730fdc41d65ecf2e68
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Diffstat (limited to 'meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker/0004-cansocketbcm-Fix-reading-of-frames-in-case-of-RX_TIM.patch')
-rw-r--r-- | meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker/0004-cansocketbcm-Fix-reading-of-frames-in-case-of-RX_TIM.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker/0004-cansocketbcm-Fix-reading-of-frames-in-case-of-RX_TIM.patch b/meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker/0004-cansocketbcm-Fix-reading-of-frames-in-case-of-RX_TIM.patch new file mode 100644 index 000000000..fda729270 --- /dev/null +++ b/meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker/0004-cansocketbcm-Fix-reading-of-frames-in-case-of-RX_TIM.patch @@ -0,0 +1,65 @@ +From 10327a700491ba7412ce1296cb709b4d3303326f Mon Sep 17 00:00:00 2001 +From: Petr Nechaev <petr.nechaev@cogentembedded.com> +Date: Wed, 29 Jul 2015 17:58:49 +0300 +Subject: [PATCH 4/9] cansocketbcm: Fix reading of frames in case of RX_TIMEOUT + +If bcms.hdr.nframes==0 we must not read any frames. +Also, frame size can vary with the number of messages. +--- + plugins/common/cansocketbcm.cpp | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/plugins/common/cansocketbcm.cpp b/plugins/common/cansocketbcm.cpp +index d923ce3..7ee663c 100644 +--- a/plugins/common/cansocketbcm.cpp ++++ b/plugins/common/cansocketbcm.cpp +@@ -145,7 +145,7 @@ int CANSocketBCM::waitData(unsigned int timeout) + + /** + * BCM header with one message. +- * @note hdr.nframes must always be 0 or 1. ++ * @note As a result, hdr.nframes must always be 0 or 1. + */ + struct __attribute__ ((__packed__)) bcm_msg_one{ + struct bcm_msg_head hdr; +@@ -190,7 +190,7 @@ CANSocket::CANSocketReadSuccess CANSocketBCM::readMessage(CANFrameInfo& message) + switch (bcms.hdr.opcode) + { + case RX_CHANGED: +- if (bcms.hdr.nframes >= 1 && nbytes == sizeof(bcms)) ++ if (bcms.hdr.nframes >= 1 && nbytes == sizeof(bcm_msg_head) + bcms.hdr.nframes*sizeof(can_frame)) + { + if (bcms.hdr.nframes > 1) + { +@@ -211,10 +211,24 @@ CANSocket::CANSocketReadSuccess CANSocketBCM::readMessage(CANFrameInfo& message) + return CANSocket::CANSocketReadSuccess::READING_FAILED; + } + case RX_TIMEOUT: +- memcpy(&message.frame, &bcms.frames[0], sizeof(bcms.frames[0])); +- message.frame.can_id = bcms.hdr.can_id; //doubtful. Do we need to override this? +- message.status = CANFrameInfo::CANMessageStatus::TIMEOUT; +- return CANSocket::CANSocketReadSuccess::READING_SUCCEEDED; ++ if (bcms.hdr.nframes >= 0 && nbytes == sizeof(bcm_msg_head) + bcms.hdr.nframes*sizeof(can_frame)) ++ { ++ if (bcms.hdr.nframes > 0) ++ { ++ memcpy(&message.frame, &bcms.frames[0], sizeof(bcms.frames[0])); ++ } ++ message.frame.can_id = bcms.hdr.can_id; //doubtful. Do we need to override this? ++ message.status = CANFrameInfo::CANMessageStatus::TIMEOUT; ++ return CANSocket::CANSocketReadSuccess::READING_SUCCEEDED; ++ } ++ else ++ { ++ LOG_ERROR("Unexpected data from the socket" ++ << " " << bcms.hdr.opcode ++ << " " << bcms.hdr.nframes ++ << " " << nbytes); ++ return CANSocket::CANSocketReadSuccess::READING_FAILED; ++ } + + case TX_EXPIRED: + // do nothing +-- +1.9.1 + |