This file contains:
- 1 Broadcast Manager protocol sockets (SOCK_DGRAM)
- 1.1 Opening BCM sockets
- 1.2 BCM messages (struct bcm_msg_head)
- 1.3 TX_SETUP opcode
- 1.4 TX_DELETE opcode
- 1.5 TX_READ opcode
- 1.6 TX_SEND opcode
- 1.7 RX_SETUP opcode
- 1.8 RX_DELETE opcode
- 1.9 RX_READ opcode
+ B. Broadcast Manager protocol sockets (SOCK_DGRAM)
+ B.1 Opening BCM sockets
+ B.2 BCM messages (struct bcm_msg_head)
+ B.3 TX_SETUP opcode
+ B.4 TX_DELETE opcode
+ B.5 TX_READ opcode
+ B.6 TX_SEND opcode
+ B.7 RX_SETUP opcode
+ B.8 RX_DELETE opcode
+ B.9 RX_READ opcode
============================================================================
-1. Broadcast Manager protocol sockets (SOCK_DGRAM)
+B. Broadcast Manager protocol sockets (SOCK_DGRAM)
--------------------------------------------------
The Broadcast Manager (BCM) provides functions to send CAN frames
- Frequency reduction of messages (throttle function) to the user
application
- 1.1 Opening BCM sockets
+ B.1 Opening BCM sockets
- To use Broadcast-Manager include the file "bcm.h".
- A socket for Broadcast-Manager is created with:
+ To use the referenced definitions for CAN_BCM sockets, include
+ <linux/can/bcm.h>.
+
+ A socket for the Broadcast-Manager is created with:
s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM);
connect(s, (struct sockaddr *)&addr, sizeof(addr));
- If a process must operate on multiple CAN buses, it must open several
+ If a process must operate on multiple CAN buses, it can open several
sockets. It is also possible for a process to open multiple sockets
on a single CAN-bus, if it makes sense for the application programmer
to structure different data flows.
Every single instance of Broadcast-Manager is able to manage any number of
filter and/or send requests.
- 1.2 BCM messages (struct bcm_msg_head)
+ B.2 BCM messages (struct bcm_msg_head)
All messages from the (user) process to Broadcast-Manager have the same
structure. It consists of a message header with the command (opcode),
int count; /* run 'count' times ival1 then ival2 */
struct timeval ival1, ival2; /* intervals */
canid_t can_id; /* 32 Bit SFF/EFF. MSB set at EFF */
- int nframes; /* number of can_frame's in the next field */
+ int nframes; /* num of can_frame's in the next field */
struct can_frame frames[0];
};
SETTIMER: set the value of ival1, ival2 and count
STARTTIMER: start the timer with the actual value of ival1, ival2 and count.
- Starting the timer leads simultaneously to the transmission of a can_frame
+ Starting the timer leads simultaneously to the transmission of a
+ can_frame
TX_COUNTEVT: create the message TX_EXPIRED when count is reached
TX_ANNOUNCE: a change of data by the process is emitted with a new frame,
regardless of the timer status
generated when the (cyclic) receive restarts. This will happen even
if the user data have not changed
- 1.3 TX_SETUP opcode
- 1.4 TX_DELETE opcode
+ B.3 TX_SETUP opcode
+ B.4 TX_DELETE opcode
This opcode will delete the entry for transmission of the CAN frame with
the specified can_id CAN identifier. The message length for the command
TX_DELETE is sizeof(bcm_msg_head) (only the header).
- 1.5 TX_READ opcode
- 1.6 TX_SEND opcode
- 1.7 RX_SETUP opcode
- 1.8 RX_DELETE opcode
- 1.9 RX_READ opcode
+ B.5 TX_READ opcode
+ B.6 TX_SEND opcode
+ B.7 RX_SETUP opcode
+ B.8 RX_DELETE opcode
+ B.9 RX_READ opcode