Path: blob/master/libraries/AP_CANManager/AP_CANDriver.h
9576 views
/*1* This file is free software: you can redistribute it and/or modify it2* under the terms of the GNU General Public License as published by the3* Free Software Foundation, either version 3 of the License, or4* (at your option) any later version.5*6* This file is distributed in the hope that it will be useful, but7* WITHOUT ANY WARRANTY; without even the implied warranty of8* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.9* See the GNU General Public License for more details.10*11* You should have received a copy of the GNU General Public License along12* with this program. If not, see <http://www.gnu.org/licenses/>.13*14* Code by Siddharth Bharat Purohit15*/1617#pragma once1819#include <AP_Common/AP_Common.h>20#include <AP_HAL/AP_HAL.h>2122class AP_CANManager;23class CANSensor;2425class AP_CANDriver26{27public:2829friend class AP_CANManager;3031// init method for protocol drivers, specify driver index32virtual void init(uint8_t driver_index) = 0;3334// link protocol drivers with interfaces by adding reference to CANIface35virtual bool add_interface(AP_HAL::CANIface* can_iface) = 0;3637// add an 11 bit auxillary driver38virtual bool add_11bit_driver(CANSensor *sensor) { return false; }3940// handler for outgoing frames for auxillary drivers41virtual bool write_aux_frame(AP_HAL::CANFrame &out_frame, const uint32_t timeout_us) { return false; }42};434445