CANopenNode
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"

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. More...
 

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. More...
 
void CO_CANerror_init (CO_CANinterfaceErrorhandler_t *CANerrorhandler, int fd, const char *ifname)
 Initialize CAN error handler. More...
 
void CO_CANerror_disable (CO_CANinterfaceErrorhandler_t *CANerrorhandler)
 Reset CAN error handler. More...
 
void CO_CANerror_rxMsg (CO_CANinterfaceErrorhandler_t *CANerrorhandler)
 Message received event. More...
 
CO_CANinterfaceState_t CO_CANerror_txMsg (CO_CANinterfaceErrorhandler_t *CANerrorhandler)
 Check if interface is ready for message transmission. More...
 
CO_CANinterfaceState_t CO_CANerror_rxMsgError (CO_CANinterfaceErrorhandler_t *CANerrorhandler, const struct can_frame *msg)
 Error message received event. More...
 

Detailed Description

CANopenNode Linux socketCAN Error handling.

Author
Martin Wagner

This file is part of CANopenNode, an opensource CANopen Stack. Project home page is https://github.com/CANopenNode/CANopenNode. For more information on CANopen see http://www.can-cia.org/.

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.