#pragma once
+#include "can-utils.hpp"
class decoder_t
{
* Returns the raw value of the signal parsed as a bitfield from the given byte
* array.
*/
- float parseSignalBitfield(const CanSignal& signal, const CanMessage& message);
+ float parseSignalBitfield(const CanSignal& signal, const can_message_t& message);
/* Public: Find and return the corresponding string state for a CAN signal's
* raw integer value.
* string or boolean. If 'send' is false, the return value is undefined.
*/
openxc_DynamicField decodeSignal(const CanSignal& signal,
- const CanMessage& message, const CanSignal& signals,
+ const can_message_t& message, const CanSignal& signals,
bool* send);
/* Public: Decode a transformed, human readable value from an raw CAN signal
#include "timer.hpp"
#include "openxc.pb.h"
-#include <afb/afb-binding.h>
-#include <afb/afb-service-itf.h>
// TODO actual max is 32 but dropped to 24 for memory considerations
#define MAX_ACCEPTANCE_FILTERS 24
* limitations under the License.
*/
-#include <linux/can.h>
-#include <linux/can/raw.h>
-#include <queue>
-#include <sys/timeb.h>
-
-#include <afb/afb-binding.h>
-
-#include "can-utils.hpp"
-#include "can-decoder.hpp"
-#include "openxc.pb.h"
-#include "openxc-utils.hpp"
+#include "low-can-binding.hpp"
void can_decode_message(can_bus_t &can_bus)
{
* limitations under the License.
*/
-#include <linux/can.h>
-#include <linux/can/raw.h>
-#include <queue>
-
-#include <afb/afb-binding.h>
-
-#include "can-utils.h"
-#include "openxc-utils.hpp"
-#include "openxc.pb.h"
-#include "json-c/json.h"
+#include "low-can-binding.hpp"
void can_event_push(can_bus_t& can_bus)
{
* limitations under the License.
*/
-#include <linux/can.h>
-#include <linux/can/raw.h>
-
-#include <afb/afb-binding.h>
-
-#include "can-utils.h"
+#include "low-can-binding.hpp"
void can_reader(can_bus_t &can_bus)
{
#include <openxc.pb.h>
#include "low-can-binding.hpp"
-#include "openxc-utils.hpp"
-#include "obd2.hpp"
-#include "can-utils.hpp"
-#include "can-signals.hpp"
/********************************************************************************
*
return 1;
}
-}
\ No newline at end of file
+};
\ No newline at end of file
#pragma once
+#include <queue>
+#include <sys/timeb.h>
+#include <linux/can.h>
+#include <json-c/json.h>
+#include <linux/can/raw.h>
+
+#include "obd2.hpp"
+#include "openxc.pb.h"
+#include "can-utils.hpp"
#include "can-signals.hpp"
+#include "can-decoder.hpp"
+#include "openxc-utils.hpp"
+
+/*
+ * Interface between the daemon and the binding
+ */
+static const struct afb_binding_interface *interface;
extern "C"
{
* @return Exit code, zero if success.
*/
int afbBindingV1ServiceInit(struct afb_service service);
-}
-
-/*
- * Interface between the daemon and the binding
- */
-static const struct afb_binding_interface *interface;
\ No newline at end of file
+};
\ No newline at end of file
#include <vector>
#include "uds/uds.h"
+extern "C"
+{
+ #include <afb/afb-binding.h>
+}
enum UNIT {
POURCENT,
#pragma once
-/*
- * Build a specific VehicleMessage containing a SimpleMessage.
+#include "openxc.pb.h"
+
+/**
+ * @brief Build a specific VehicleMessage containing a SimpleMessage.
*/
-openxc_VehicleMessage build_VehicleMessage_with_SimpleMessage(openxc_DynamicField_Type type,
- const openxc_SimpleMessage& message);
+openxc_VehicleMessage build_VehicleMessage_with_SimpleMessage(openxc_DynamicField_Type type, const openxc_SimpleMessage& message);
-/*
- * Build an openxc_SimpleMessage associating a name to an openxc_DynamicField
+/**
+ * @brief Build an openxc_SimpleMessage associating a name to an openxc_DynamicField
*/
openxc_SimpleMessage build_SimpleMessage(const std::string& name, const openxc_DynamicField& value);
-/*
- * Build an openxc_DynamicField depending what we pass as argument
+/**
+ * @brief Build an openxc_DynamicField depending what we pass as argument
*/
openxc_DynamicField build_DynamicField(const std::string& value);
-/*
- * Build an openxc_DynamicField depending what we pass as argument
+/**
+ * @brief Build an openxc_DynamicField depending what we pass as argument
*/
openxc_DynamicField build_DynamicField(double value);
-/*
- * Build an openxc_DynamicField depending what we pass as argument
+/**
+ * @brief Build an openxc_DynamicField depending what we pass as argument
*/
openxc_DynamicField build_DynamicField(bool value);
void jsonify_DynamicField(const openxc_DynamicField& field, const json_object& value);
-/* Extract the simple message value from an openxc_VehicleMessage
+/**
+ * @brief Extract the simple message value from an openxc_VehicleMessage
* and return it, or null if there isn't.
*/
openxc_SimpleMessage get_simple_message(const openxc_VehicleMessage& v_msg);