28#include <wx/msw/winundef.h>
50#if defined(__linux__) && !defined(__ANDROID__) && !defined(__WXOSX__)
61 void Notify(std::shared_ptr<const NavMsg> message)
override {
62 switch (message->state) {
63 case NavMsg::State::kCannotParse:
64 case NavMsg::State::kFiltered:
65 case NavMsg::State::kBadChecksum:
69 NavMsgBus::GetInstance().
Notify(message);
76 auto driver = std::make_unique<LoopbackDriver>(NavMsgBus::GetInstance());
77 CommDriverRegistry::GetInstance().
Activate(std::move(driver));
81 auto driver = std::make_unique<CommDriverInternal>(NavMsgBus::GetInstance());
82 CommDriverRegistry::GetInstance().
Activate(std::move(driver));
88 wxLogMessage(
"MakeCommDriver: %s", params->
GetDSPort().c_str());
90 auto& msgbus = NavMsgBus::GetInstance();
91 auto& registry = CommDriverRegistry::GetInstance();
92 switch (params->type) {
94 switch (params->data_protocol) {
95 case PROTO_NMEA2000: {
96 auto driver = std::make_unique<CommDriverN2KSerial>(params, msgbus);
97 registry.Activate(std::move(driver));
102 std::make_unique<CommDriverN0183Serial>(params, listener);
103 registry.Activate(std::move(driver));
109 switch (params->net_protocol) {
111 auto driver = std::make_unique<CommDriverSignalKNet>(params, msgbus);
112 registry.Activate(std::move(driver));
116 switch (params->data_protocol) {
117 case PROTO_NMEA0183: {
119 std::make_unique<CommDriverN0183Net>(params, listener);
120 registry.Activate(std::move(driver));
123 case PROTO_NMEA2000: {
124 auto driver = std::make_unique<CommDriverN2KNet>(params, msgbus);
125 registry.Activate(std::move(driver));
136#if defined(__linux__) && !defined(__ANDROID__) && !defined(__WXOSX__)
138 auto driver = CommDriverN2KSocketCAN::Create(params, msgbus);
139 registry.Activate(std::move(driver));
146 auto driver = std::make_unique<CommDriverN0183AndroidInt>(params, msgbus);
147 registry.Activate(std::move(driver));
152 auto driver = std::make_unique<CommDriverN0183AndroidBT>(params, msgbus);
153 registry.Activate(std::move(driver));
Common interface for all drivers.
obs::EventVar evt_dropped_msg
Updated by drivers with a shared Navmsg pointer when receiving data otherwise dropped,...
void Activate(DriverPtr driver)
Add driver to list of active drivers.
static void uninitIXNetSystem()
ix::uninitIXNetSystem wrapper
static void initIXNetSystem()
ix::initIXNetSystem wrapper
Connection data container close to a POD struct.
wxString GetDSPort() const
Return port description including for example serial port or network address/port,...
Interface for handling incoming messages.
void Notify(std::shared_ptr< const NavMsg > message) override
Handle a received message.
void Notify(const AbstractCommDriver &driver) override
Handle driver status change.
void Notify(std::shared_ptr< const NavMsg > message)
Accept message received by driver, make it available for upper layers.
void Notify() override
Notify all listeners, no data supplied.
void MakeLoopbackDriver()
Create and register the loopback driver.
void MakeInternalDriver()
Create and register the internal driver.
void MakeCommDriver(const ConnectionParams *params)
Create and register a driver for given connection.
Internal send-only driver sending to plugins.
Loopback driver, treat sent messages as received.
Android nmea0183 internal bluetooth driver.
Android internal nmea0183 driver.
Nmea2000 IP network driver.
Low-level driver for socketcan devices (linux only).
Driver registration container, a singleton.
SignalK IP network driver.
Raw messages layer, supports sending and recieving navmsg messages.