aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding
diff options
context:
space:
mode:
Diffstat (limited to 'low-can-binding/binding')
-rw-r--r--low-can-binding/binding/application.hpp10
-rw-r--r--low-can-binding/binding/low-can-cb.cpp18
-rw-r--r--low-can-binding/binding/low-can-socket.cpp34
-rw-r--r--low-can-binding/binding/low-can-socket.hpp16
-rw-r--r--low-can-binding/binding/low-can-subscription.hpp8
5 files changed, 43 insertions, 43 deletions
diff --git a/low-can-binding/binding/application.hpp b/low-can-binding/binding/application.hpp
index 93494872..92aca382 100644
--- a/low-can-binding/binding/application.hpp
+++ b/low-can-binding/binding/application.hpp
@@ -28,12 +28,12 @@
#include "../diagnostic/diagnostic-manager.hpp"
///
-/// @brief Class representing a configuration attached to the binding.
+/// @brief Class represents a configuration attached to the binding.
///
-/// It regroups all needed objects instance from other class
-/// that will be used along the binding life. It gets a global vision
+/// It regroups all object instances from other classes
+/// that will be used through the binding life. It receives a global vision
/// on which signals are implemented for that binding.
-/// Here, it is only the definition of the class with predefined accessors
+/// Here, only the definition of the class is given with predefined accessors
/// methods used in the binding.
///
/// It will be the reference point to needed objects.
@@ -41,7 +41,7 @@
class application_t
{
private:
- can_bus_t can_bus_manager_; ///< instanciate the CAN bus manager. It's the one in charge of initialize the CAN bus devices.
+ can_bus_t can_bus_manager_; ///< instanciate the CAN bus manager. It's responsible of initializing the CAN bus devices.
diagnostic_manager_t diagnostic_manager_; ///< Diagnostic manager use to manage diagnostic message communication.
uint8_t active_message_set_ = 0; ///< Which is the active message set ? Default to 0.
diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp
index 76520f45..0f97404c 100644
--- a/low-can-binding/binding/low-can-cb.cpp
+++ b/low-can-binding/binding/low-can-cb.cpp
@@ -138,8 +138,8 @@ static int create_event_handle(std::shared_ptr<low_can_subscription_t>& can_subs
return 0;
}
-/// @brief Will determine if it is needed or not to create the event handle and checks it to be sure that
-/// we got a valid afb_event to get subscribe or unsubscribe. Then launch the subscription or unsubscription
+/// @brief This will determine if an event handle needs to be created and checks if
+/// we got a valid afb_event to get subscribe or unsubscribe. After that launch the subscription or unsubscription
/// against the application framework using that event handle.
static int subscribe_unsubscribe_signal(struct afb_req request,
bool subscribe,
@@ -166,8 +166,8 @@ static int subscribe_unsubscribe_signal(struct afb_req request,
ret = create_event_handle(can_subscription, s);
}
- // Check whether or not the event handler has been correctly created and
- // make the subscription/unsubscription operation is so.
+ // Checks if the event handler is correctly created, if it is, it
+ // performs the subscription or unsubscription operations.
if (ret < 0)
return ret;
return make_subscription_unsubscription(request, can_subscription, s, subscribe);
@@ -205,8 +205,8 @@ static int subscribe_unsubscribe_diagnostic_messages(struct afb_req request,
can_subscription = it != s.end() ?
it->second :
std::make_shared<low_can_subscription_t>(low_can_subscription_t(event_filter));
- // If the requested diagnostic message isn't supported by the car then unsubcribe it
- // no matter what we want, worse case will be a fail unsubscription but at least we don't
+ // If the requested diagnostic message is not supported by the car then unsubcribe it
+ // no matter what we want, worst case will be a failed unsubscription but at least we won't
// poll a PID for nothing.
if(sig->get_supported() && subscribe)
{
@@ -281,8 +281,8 @@ static int subscribe_unsubscribe_can_signals(struct afb_req request,
///
/// @brief subscribe to all signals in the vector signals
///
-/// @param[in] afb_req request : contain original request use to subscribe or unsubscribe
-/// @param[in] subscribe boolean value used to chose between a subscription operation or an unsubscription
+/// @param[in] afb_req request : contains original request use to subscribe or unsubscribe
+/// @param[in] subscribe boolean value, which chooses between a subscription operation or an unsubscription
/// @param[in] signals - struct containing vectors with can_signal_t and diagnostic_messages to subscribe
///
/// @return Number of correctly subscribed signal
@@ -666,7 +666,7 @@ int initv2()
if(application_t::instance().get_diagnostic_manager().initialize())
ret = 0;
- // Add a recurring dignostic message request to get engine speed continuously
+ // Add a recurring dignostic message request to get engine speed at all times.
openxc_DynamicField search_key = build_DynamicField("diagnostic_messages.engine.speed");
struct utils::signals_found sf = utils::signals_manager_t::instance().find_signals(search_key);
diff --git a/low-can-binding/binding/low-can-socket.cpp b/low-can-binding/binding/low-can-socket.cpp
index 8a8efbf7..0aebfa3c 100644
--- a/low-can-binding/binding/low-can-socket.cpp
+++ b/low-can-binding/binding/low-can-socket.cpp
@@ -163,10 +163,10 @@ void low_can_socket_t::set_max(float max)
{
event_filter_.max = max;
}
-/// @brief Based upon which object is subscribed CAN signal or diagnostic message
-/// this will open the socket with the required CAN bus device name.
+/// @brief Based upon which object is a subscribed CAN signal or diagnostic message
+/// it will open the socket with the required CAN bus device name.
///
-/// @return INVALID_SOCKET on failure else positive integer
+/// @return INVALID_SOCKET on failure, else positive integer
int low_can_socket_t::open_socket(const std::string& bus_name)
{
int ret = 0;
@@ -183,9 +183,9 @@ int low_can_socket_t::open_socket(const std::string& bus_name)
return ret;
}
-/// @brief Build a BCM message head but don't set can_frame.
+/// @brief Builds a BCM message head but doesn't set can_frame.
///
-/// @return a simple_bcm_msg with the msg_head parts set and can_frame
+/// @returns a simple_bcm_msg with the msg_head parts set and can_frame
/// zeroed.
struct utils::simple_bcm_msg low_can_socket_t::make_bcm_head(uint32_t opcode, uint32_t can_id, uint32_t flags, const struct timeval& timeout, const struct timeval& frequency_thinning) const
{
@@ -203,8 +203,8 @@ struct utils::simple_bcm_msg low_can_socket_t::make_bcm_head(uint32_t opcode, ui
return bcm_msg;
}
-/// @brief Take an existing simple_bcm_msg struct and add a can_frame to it.
-/// Only possible for now to add 1 uniq can_frame, it isn't possible to build
+/// @brief Take an existing simple_bcm_msg struct and add a can_frame.
+/// Currently only 1 uniq can_frame can be added, it's not possible to build
/// a multiplexed message with several can_frame.
void low_can_socket_t::add_bcm_frame(const struct can_frame& cf, struct utils::simple_bcm_msg& bcm_msg) const
{
@@ -219,7 +219,7 @@ void low_can_socket_t::add_bcm_frame(const struct can_frame& cf, struct utils::s
}
}
-/// @brief Create a RX_SETUP receive job used by the BCM socket for a CAN signal
+/// @brief Create a RX_SETUP receive job to be used by the BCM socket for a CAN signal
/// subscription
///
/// @return 0 if ok else -1
@@ -249,7 +249,7 @@ int low_can_socket_t::create_rx_filter(std::shared_ptr<can_signal_t> sig)
return create_rx_filter(bcm_msg);
}
-/// @brief Create a RX_SETUP receive job used by the BCM socket for a
+/// @brief Create a RX_SETUP receive job to be used by the BCM socket for a
/// diagnostic message subscription.
///
/// @return 0 if ok else -1
@@ -266,7 +266,7 @@ int low_can_socket_t::create_rx_filter(std::shared_ptr<diagnostic_message_t> sig
}
/// @brief Create a RX_SETUP receive job used by the BCM socket directly from
-/// a simple_bcm_msg. You will not use this method directly but rather use the
+/// a simple_bcm_msg. The method should not be used directly but rather through the
/// two previous method with can_signal_t or diagnostic_message_t object.
///
/// If the CAN arbitration ID is the OBD2 functional broadcast id the subscribed
@@ -275,11 +275,11 @@ int low_can_socket_t::create_rx_filter(std::shared_ptr<diagnostic_message_t> sig
/// @return 0 if ok else -1
int low_can_socket_t::create_rx_filter(utils::simple_bcm_msg& bcm_msg)
{
- // Make sure that socket has been opened.
+ // Make sure that socket is opened.
if(open_socket() < 0)
{return -1;}
- // If it isn't an OBD2 CAN ID then just add a simple RX_SETUP job
+ // If it's not an OBD2 CAN ID then just add a simple RX_SETUP job
// else monitor all standard 8 CAN OBD2 ID response.
if(bcm_msg.msg_head.can_id != OBD2_FUNCTIONAL_BROADCAST_ID)
{
@@ -302,10 +302,10 @@ int low_can_socket_t::create_rx_filter(utils::simple_bcm_msg& bcm_msg)
return 0;
}
-/// @brief Create a TX_SEND job used by the BCM socket to
-/// simply send message
+/// @brief Creates a TX_SEND job that is used by the BCM socket to
+/// send a message
///
-/// @return 0 if ok else -1
+/// @return 0 if ok, else -1
int low_can_socket_t::tx_send(const struct can_frame& cf, std::shared_ptr<can_signal_t> sig)
{
can_signal_ = sig;
@@ -323,8 +323,8 @@ int low_can_socket_t::tx_send(const struct can_frame& cf, std::shared_ptr<can_si
return 0;
}
-/// @brief Create a TX_SEND job used by the BCM socket to
-/// simply send message
+/// @brief Creates a TX_SEND job that is used by the BCM socket to
+/// send a message
///
/// @return 0 if ok else -1
int low_can_socket_t::tx_send(const struct can_frame& cf, const std::string& bus_name)
diff --git a/low-can-binding/binding/low-can-socket.hpp b/low-can-binding/binding/low-can-socket.hpp
index 71731b30..dee7bd13 100644
--- a/low-can-binding/binding/low-can-socket.hpp
+++ b/low-can-binding/binding/low-can-socket.hpp
@@ -25,21 +25,21 @@
#include "../diagnostic/diagnostic-message.hpp"
#include "../utils/socketcan-bcm.hpp"
-/// @brief Filtering values. Theses values has to be tested into
+/// @brief Filtering values. Theses values have to be tested in
/// can_bus_t::apply_filter method.
struct event_filter_t
{
- float frequency; ///< frequency - Maximum frequency which will be received and pushed a subscribed event.
- float min; ///< min - Minimum value that the signal don't have to go below to be pushed.
- float max; ///< max - Maximum value that the signal don't have to go above to be pushed.
+ float frequency; ///< frequency - Maximum frequency which will be received and pushed to a subscribed event.
+ float min; ///< min - Minimum value that the signal doesn't have to go below to be pushed.
+ float max; ///< max - Maximum value that the signal doesn't have to go above to be pushed.
event_filter_t() : frequency{0}, min{-__FLT_MAX__}, max{__FLT_MAX__} {};
bool operator==(const event_filter_t& ext) const {
return frequency == ext.frequency && min == ext.min && max == ext.max;
}
};
-/// @brief An object storing socket to CAN to be used to write on it.
-/// This is a simple access to a CAN bus device without subscriptions attached
+/// @brief The object stores socket to CAN to be used to write on it.
+/// This is a simple access to a CAN bus device without any subscriptions attached
class low_can_socket_t
{
protected:
@@ -48,8 +48,8 @@ protected:
/// Signal part
std::shared_ptr<can_signal_t> can_signal_; ///< can_signal_ - the CAN signal subscribed
- std::vector<std::shared_ptr<diagnostic_message_t> > diagnostic_message_; ///< diagnostic_message_ - diagnostic messages meant to received OBD2 responses.
- /// normal diagnostic request and response not tested for now.
+ std::vector<std::shared_ptr<diagnostic_message_t> > diagnostic_message_; ///< diagnostic_message_ - diagnostic messages meant to receive OBD2 responses.
+ /// normal diagnostic request and response are not tested for now.
utils::socketcan_bcm_t socket_; ///< socket_ - socket_ that receives CAN messages.
diff --git a/low-can-binding/binding/low-can-subscription.hpp b/low-can-binding/binding/low-can-subscription.hpp
index 239154a2..2e656b9a 100644
--- a/low-can-binding/binding/low-can-subscription.hpp
+++ b/low-can-binding/binding/low-can-subscription.hpp
@@ -26,10 +26,10 @@
#include "../diagnostic/diagnostic-message.hpp"
#include "../utils/socketcan-bcm.hpp"
-/// @brief A subscription object used has a context that handle all needed values to describe a subscription
-/// to the low-can binding. It can holds a CAN signal or diagnostic message. Diagnostic message for OBD2 is a kind
-/// of special because there is only 1 listener to retrieve OBD2 requests. So it's needed that all diagnostic messages
-/// subscriptions is to be in 1 object.
+/// @brief The subscription class has a context that can handle all needed values to describe a subscription
+/// to the low-can binding. It can hold a CAN signal or a diagnostic message. A diagnostic message for OBD2 is
+/// special because there is only 1 listener to retrieve OBD2 requests. It is required that all diagnostic message
+/// subscriptions are in 1 object.
class low_can_subscription_t : public low_can_socket_t
{
private: