Lely core libraries
2.3.4
|
This file is part of the I/O library; it contains the CAN controller mplementation for Linux. More...
#include "io.h"
#include <lely/io2/linux/can.h>
#include <lely/util/util.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <net/if.h>
#include "can_attr.h"
#include "if.h"
#include "ifreq.h"
Go to the source code of this file.
Data Structures | |
struct | io_can_ctrl_impl |
Macros | |
#define | LELY_IO_CAN_TXLEN 128 |
The default SocketCAN transmit queue length (in number of CAN frames). | |
Functions | |
io_can_ctrl_t * | io_can_ctrl_create_from_name (const char *name, size_t txlen) |
Creates a new CAN controller from an interface name. More... | |
io_can_ctrl_t * | io_can_ctrl_create_from_index (unsigned int index, size_t txlen) |
Creates a new CAN controller from an interface index. More... | |
void | io_can_ctrl_destroy (io_can_ctrl_t *ctrl) |
Destroys a CAN controller. More... | |
const char * | io_can_ctrl_get_name (const io_can_ctrl_t *ctrl) |
Returns the interface name of a CAN controller. | |
unsigned int | io_can_ctrl_get_index (const io_can_ctrl_t *ctrl) |
Returns the interface index of a CAN controller. | |
int | io_can_ctrl_get_flags (const io_can_ctrl_t *ctrl) |
Returns the flags specifying which CAN bus features are enabled. More... | |
This file is part of the I/O library; it contains the CAN controller mplementation for Linux.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file can_ctrl.c.
io_can_ctrl_t* io_can_ctrl_create_from_name | ( | const char * | name, |
size_t | txlen | ||
) |
Creates a new CAN controller from an interface name.
This function MAY need the CAP_NET_ADMIN capability to set the transmit queue length of the specified SocketCAN interface to at least txlen.
name | the name of a SocketCAN network interface. |
txlen | the transmission queue length (in number of frames) of the network interface. If txlen is 0, the default value LELY_IO_CAN_TXLEN is used. |
Definition at line 138 of file can_ctrl.c.
io_can_ctrl_t* io_can_ctrl_create_from_index | ( | unsigned int | index, |
size_t | txlen | ||
) |
Creates a new CAN controller from an interface index.
This function MAY need the CAP_NET_ADMIN capability to set the transmit queue length of the specified SocketCAN interface to at least txlen.
index | the index of a SocketCAN network interface. |
txlen | the transmission queue length (in number of frames) of the network interface. If txlen is 0, the default value LELY_IO_CAN_TXLEN is used. |
Definition at line 147 of file can_ctrl.c.
void io_can_ctrl_destroy | ( | io_can_ctrl_t * | ctrl | ) |
Destroys a CAN controller.
Definition at line 174 of file can_ctrl.c.
int io_can_ctrl_get_flags | ( | const io_can_ctrl_t * | ctrl | ) |
Returns the flags specifying which CAN bus features are enabled.
Definition at line 199 of file can_ctrl.c.