X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fbinding%2Flow-can-subscription.cpp;h=46eced4e4331e0d26a36d9e04a4e22697c95de71;hb=4a0b8a5bc5d40f92cff93caf3c52da9957fe001f;hp=8b5f302eedbc44df04a70564563e2d7b006cb6c7;hpb=e2faa2a60da4fddcd966fa04a77d995c0bcbfa71;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/binding/low-can-subscription.cpp b/low-can-binding/binding/low-can-subscription.cpp index 8b5f302e..46eced4e 100644 --- a/low-can-binding/binding/low-can-subscription.cpp +++ b/low-can-binding/binding/low-can-subscription.cpp @@ -370,7 +370,7 @@ int low_can_subscription_t::open_socket(low_can_subscription_t &subscription, co if( subscription.signal_ ) ret = subscription.socket_->open(subscription.signal_->get_message()->get_bus_device_name()); else if(! subscription.diagnostic_message_.empty()) - ret = subscription.socket_->open(application_t::instance().get_diagnostic_bus()); + ret = subscription.socket_->open(application_t::instance().get_diagnostic_manager().get_bus_name()); else if(! bus_name.empty()) ret = subscription.socket_->open(bus_name); @@ -394,12 +394,12 @@ int low_can_subscription_t::open_socket(low_can_subscription_t &subscription, co rx = subscription.signal_->get_message()->get_id(); tx = subscription.get_tx_id(); } - ret = socket->open(subscription.signal_->get_message()->get_bus_device_name(),rx,tx); + ret = socket->open(subscription.signal_->get_message()->get_bus_device_name(), rx, tx); subscription.socket_ = socket; } else if(! bus_name.empty()) { - ret = socket->open(bus_name, subscription.get_rx_id(),subscription.get_tx_id()); + ret = socket->open(bus_name, subscription.get_rx_id(), subscription.get_tx_id()); subscription.socket_ = socket; } subscription.index_ = (int)subscription.socket_->socket(); @@ -495,7 +495,7 @@ void low_can_subscription_t::add_one_bcm_frame(struct canfd_frame& cfd, struct b void low_can_subscription_t::remove_last_bcm_frame(struct bcm_msg& bcm_msg) { struct canfd_frame cf; - memset(&cf,0,sizeof(cf)); + memset(&cf, 0, sizeof(cf)); bcm_msg.fd_frames[bcm_msg.msg_head.nframes] = cf; bcm_msg.msg_head.nframes--; } @@ -704,7 +704,7 @@ int low_can_subscription_t::tx_send(low_can_subscription_t &subscription, messag { can_message_t *cm = static_cast(message); - struct bcm_msg bcm_msg = subscription.make_bcm_head(TX_SEND, cm->get_id(),cm->get_flags()|TX_CP_CAN_ID); // TX_CP_CAN_ID -> copy in cfd the id of bcm + struct bcm_msg bcm_msg = subscription.make_bcm_head(TX_SEND, cm->get_id(), cm->get_flags()|TX_CP_CAN_ID); // TX_CP_CAN_ID -> copy in cfd the id of bcm cm->set_bcm_msg(bcm_msg); std::vector cfd_vect = cm->convert_to_canfd_frame_vector(); @@ -738,7 +738,9 @@ int low_can_subscription_t::tx_send(low_can_subscription_t &subscription, messag } if(! subscription.socket_.get()) - return -1; + { + return -1; + } return 0; }