CANopenLinux
CANopenNode on Linux devices
Loading...
Searching...
No Matches
CO_error.h File Reference

CANopenNode Linux socketCAN Error handling. More...

#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <linux/can.h>
#include <net/if.h>
#include "CO_error_msgs.h"
+ Include dependency graph for CO_error.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CO_CANinterfaceErrorhandler_t
 socketCAN interface error handling More...
 

Macros

#define CO_CANerror_NOACK_MAX   16
 This is how many NO-ACKs need to be received in a row to assume that no other nodes are connected to a bus and therefore are assuming listen-only.
 
#define CO_CANerror_LISTEN_ONLY   10
 This is how long we are going to block transmission if listen-only mode is active.
 

Enumerations

enum  CO_CANinterfaceState_t { CO_INTERFACE_ACTIVE , CO_INTERFACE_LISTEN_ONLY , CO_INTERFACE_BUS_OFF }
 driver interface state More...
 

Functions

void log_printf (int priority, const char *format,...)
 Message logging function.
 
void CO_CANerror_init (CO_CANinterfaceErrorhandler_t *CANerrorhandler, int fd, const char *ifname)
 Initialize CAN error handler.
 
void CO_CANerror_disable (CO_CANinterfaceErrorhandler_t *CANerrorhandler)
 Reset CAN error handler.
 
void CO_CANerror_rxMsg (CO_CANinterfaceErrorhandler_t *CANerrorhandler)
 Message received event.
 
CO_CANinterfaceState_t CO_CANerror_txMsg (CO_CANinterfaceErrorhandler_t *CANerrorhandler)
 Check if interface is ready for message transmission.
 
CO_CANinterfaceState_t CO_CANerror_rxMsgError (CO_CANinterfaceErrorhandler_t *CANerrorhandler, const struct can_frame *msg)
 Error message received event.
 

Detailed Description

CANopenNode Linux socketCAN Error handling.

Author
Martin Wagner

This file is part of https://github.com/CANopenNode/CANopenNode, a CANopen Stack.

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.