6 Software
User Manual
63/374
Change the Transmit Queue Length
It is possible to vary the maximal number of CAN messages in the transmit queue of e.g. can0.
# ifconfig can0 txqueuelen 1000
# ifconfig can0
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:145
Interface at rc.conf: Activate / Deactivate CAN 0/1 and set bitrate
# CAN 0 "y" activate, else deactivate
export SYSCFG_CAN0="y"
# Baudrate of can0
export SYSCFG_CAN0_BAUD="500000"
# CAN 1 "y" activate, else deactivate
export SYSCFG_CAN1="y"
# Baudrate of can1
export SYSCFG_CAN1_BAUD="500000"
Example: Change bitrate of can0
Handling the user space interface can0 by using /sbin/ifconfig provided by the BusyBox multi-call binary and
/sbin/ip
Stop can0, change bitrate to 250000 and restart can0.
# ifconfig can0 down
# /bin/ip link set can0 up type can bitrate 250000
# ifconfig can0 up
Example: Socket CAN for C programming
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <linux/can.h>
#include <linux/can/raw.h>
#include <string.h>
#include "stwtypes.h"
/* At time of writing, these constants are not defined in the headers */
/* ... */
/* Somewhere in your application */
/* Create the socket */
sint16 s16_Socket = socket( PF_CAN, SOCK_RAW, CAN_RAW);
/* Locate the interface you wish to use */
struct ifreq t_Ifr;
strcpy(t_Ifr.ifr_name, "can0");
ioctl(s16_Socket, SIOCGIFINDEX, &t_Ifr);
/* Ifr.ifr_ifindex gets filled with that
device's index*/
Summary of Contents for TC1
Page 1: ...TC1 User Manual Version of this document V1 00r0 ...
Page 25: ...5 Hardware User Manual 25 374 5 2 2 Block Diagram Variant TC1 WIFI ...
Page 34: ...5 Hardware User Manual 34 374 5 6 Housing Connector Top view and side view Bottom View ...
Page 125: ...7 Teleservice Application Framework User Manual 125 374 TAF overview ...
Page 190: ...7 Teleservice Application Framework User Manual 190 374 How the logger mechanism works ...