OpenCPN Partial API docs
Loading...
Searching...
No Matches
comm_drv_n2k.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2022 by David Register, Alec Leamas *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef _COMMDRIVERN2K_H__
25#define _COMMDRIVERN2K_H__
26
27#include <memory>
28
29#include "model/comm_driver.h"
30
32public:
33 CommDriverN2K(const std::string& s = "n2k0");
34
35 virtual ~CommDriverN2K();
36
37 virtual bool SendMessage(std::shared_ptr<const NavMsg> msg,
38 std::shared_ptr<const NavAddr> addr) override = 0;
39 virtual void SetListener(DriverListener& l) override;
40 virtual std::shared_ptr<NavAddr2000> GetAddress(const N2kName& name);
41 virtual int SetTXPGN(int pgn) { return 0; }
42};
43
44#endif // guard
Common interface for all drivers.
Definition comm_driver.h:65
virtual void SetListener(DriverListener &l) override
Set the entity which will receive incoming data.
Interface for handling incoming messages.
Definition comm_driver.h:50
Communication driver layer.
N2k uses CAN which defines the basic properties of messages.
Definition comm_navmsg.h:70