-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcanbus.orogen
83 lines (60 loc) · 3.14 KB
/
canbus.orogen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name "canbus"
import_types_from "base"
using_library "canbus"
import_types_from "canbus/Message.hpp"
import_types_from "canTypes.hh"
task_context "Task" do
doc "component that allows to demultiplex CAN messages from a single CAN bus, and monitor the bus health indicators. To use, one adds specific CAN messages to watch using watch(), and then connects to the port(s) created by watch()."
needs_configuration
property("device", "/std/string").
doc "the device file used to connect to the CAN bus"
property("deviceType", "/canbus/DRIVER_TYPE").
doc "the device type, this determines which driver will be used to open the device"
property("checkBusOkInterval", "int", 100).
doc "this property defines the interval in which the can bus is checked for correct function. The unit is in ms"
output_port("stats", "/canbus/Statistics").
doc "some statistics about the CAN bus"
property("statsInterval", "int", 1000).
doc "the interval in which the stats message is send. The unit is in ms"
property("outputPorts", "std/vector</canbus/CanOutputPort>").
doc "The component will create the necessary ports at configure time based on the port names that are listed in the configuration file"
# What timeout value should be set for the underlying FD activity (if fd_driven)
#
# This should be lower than the statsInterval and checkBusOkInterval
property "fd_activity_timeout", "/base/Time"
input_port("in", "/canbus/Message").
multiplexes.
needs_reliable_connection.
doc "ports for writing CAN messages on the bus"
dynamic_output_port(/\w+/, "/canbus/Message").
doc "port for reading CAN messages from the bus"
operation("watch").
doc("requires the canbus component to filter the incoming CAN messages for interesting messages and output them to a specified port").
returns("bool", "returns true if the port could be created and false otherwise. The only failure reason is that the name is already in use").
argument("name", "/std/string", "the name of the output port. The new port will be of type /canbus/Message.").
argument("id", "int", "only messages for which (can_msg.id & mask) == id will be written on the new port").
argument("mask", "int", "only messages for which (can_msg.id & mask) == id will be written on the new port")
operation("unwatch").
returns("bool", "true if the given name was a valid watch name, and false otherwise").
argument("name", "/std/string", "the name of the watched device to remove")
port_driven
fd_driven
exception_states :IO_ERROR
end
task_context "InterfaceTask" do
doc "This Task could be the superclass if you need an abstract implementation for an canbus"
input_port("can_in", "canbus/Message").
needs_reliable_connection.
doc("Ingoing CAN Messages")
output_port("can_out", "canbus/Message").
doc("Outgoing CAN Messages")
end
using_task_library "logger"
deployment "test_canbus" do
do_not_install
t = task("can", "canbus::Task")
add_default_logger
if !corba_enabled?
browse t
end
end