X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=low-can-binding%2Futils%2Fsocketcan-isotp.cpp;h=928e8c72e98e4d4597724337e389a4dbd2928e00;hb=7ea53d8a89912cd0ab00fa4c0957f40ee6c9db8a;hp=a3792a7004c9f7aa59e44e47d6b8d6b35ad2ff0e;hpb=64691cf96f9c4d7ff59dbd49e1fe01d26c1a00f6;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/utils/socketcan-isotp.cpp b/low-can-binding/utils/socketcan-isotp.cpp index a3792a70..928e8c72 100644 --- a/low-can-binding/utils/socketcan-isotp.cpp +++ b/low-can-binding/utils/socketcan-isotp.cpp @@ -36,7 +36,7 @@ namespace utils int socketcan_isotp_t::open(std::string device_name) { AFB_WARNING("NOT USE THIS FUNCTION !"); - return open(device_name,NO_CAN_ID,NO_CAN_ID); + return open(device_name, NO_CAN_ID, NO_CAN_ID); } /** @@ -59,11 +59,11 @@ namespace utils return -1; } - if(define_tx_address(device_name,rx_id,tx_id) < 0) + if(define_tx_address(device_name, rx_id, tx_id) < 0) return -1; struct can_isotp_options opts; - memset(&opts,0,sizeof(opts)); + memset(&opts, 0, sizeof(opts)); setopt(SOL_CAN_ISOTP, CAN_ISOTP_OPTS, &opts, sizeof(opts)); if(bind((struct sockaddr *)&tx_address_, sizeof(tx_address_)) < 0) @@ -86,7 +86,7 @@ namespace utils std::shared_ptr cm = std::make_shared(); uint8_t msg[MAX_ISOTP_FRAMES]; - ssize_t nbytes = read(socket(),msg,MAX_ISOTP_FRAMES); + ssize_t nbytes = read(socket(), msg, MAX_ISOTP_FRAMES); cm->set_id(tx_address_.can_addr.tp.rx_id); @@ -101,8 +101,8 @@ namespace utils data.push_back(msg[i]); std::string data_string; - data_string = converter_t::to_hex(msg,nbytes); - AFB_DEBUG("DATA ISO TP for id : %x = %s",cm->get_id(),data_string.c_str()); + data_string = converter_t::to_hex(msg, nbytes); + AFB_DEBUG("DATA ISO TP for id : %x = %s", cm->get_id(), data_string.c_str()); cm->set_data(data); @@ -126,7 +126,7 @@ namespace utils size_t size = m.get_length(); if(size < MAX_ISOTP_FRAMES) { - ssize_t ret = write(socket(),m.get_data(),size); + ssize_t ret = write(socket(), m.get_data(), size); if(ret < 0) { AFB_ERROR("Error sending : %i %s", errno, ::strerror(errno)); @@ -134,7 +134,7 @@ namespace utils } if(ret != size) - AFB_WARNING("ISOTP wrote only %zd byte",ret); + AFB_WARNING("ISOTP wrote only %zd byte", ret); } else {