OpenCPN Partial API docs
Loading...
Searching...
No Matches
comm_drv_n0183_android_bt.h
1
/***************************************************************************
2
*
3
* Project: OpenCPN
4
* Purpose:
5
* Author: David Register, Alec Leamas
6
*
7
***************************************************************************
8
* Copyright (C) 2023 by David Register, Alec Leamas *
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
* This program is distributed in the hope that it will be useful, *
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18
* GNU General Public License for more details. *
19
* *
20
* You should have received a copy of the GNU General Public License *
21
* along with this program; if not, write to the *
22
* Free Software Foundation, Inc., *
23
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24
**************************************************************************/
25
26
#ifndef _COMMDRIVERN0183ANDROIDBT_H
27
#define _COMMDRIVERN0183ANDROIDBT_H
28
29
#include <atomic>
30
#include <string>
31
32
#include <wx/event.h>
33
34
#include "
model/comm_drv_n0183.h
"
35
#include "model/conn_params.h"
36
37
class
CommDriverN0183AndroidBTEvent
:
public
wxEvent {
38
public
:
39
CommDriverN0183AndroidBTEvent
(wxEventType commandType,
int
id
);
40
~CommDriverN0183AndroidBTEvent
();
41
42
// accessors
43
void
SetPayload(std::shared_ptr<std::vector<unsigned char>> data);
44
std::shared_ptr<std::vector<unsigned char>> GetPayload();
45
46
// required for sending with wxPostEvent()
47
wxEvent* Clone()
const
;
48
49
private
:
50
std::shared_ptr<std::vector<unsigned char>> m_payload;
51
};
52
53
wxDECLARE_EVENT(wxEVT_COMMDRIVER_N0183_ANDROID_BT,
54
CommDriverN0183AndroidBTEvent
);
55
56
class
CommDriverN0183AndroidBT
:
public
CommDriverN0183
,
public
wxEvtHandler {
57
public
:
58
CommDriverN0183AndroidBT
(
const
ConnectionParams
* params,
DriverListener
& l);
59
60
virtual
~CommDriverN0183AndroidBT
();
61
62
bool
Open();
63
void
Close();
64
65
ConnectionParams
GetParams()
const
{
return
m_params; }
66
67
bool
SendMessage(std::shared_ptr<const NavMsg> msg,
68
std::shared_ptr<const NavAddr> addr)
override
;
69
70
private
:
71
bool
m_bok;
72
std::string m_portstring;
73
std::string m_BaudRate;
74
int
m_handshake;
75
76
ConnectionParams
m_params;
77
DriverListener
& m_listener;
78
void
handle_N0183_MSG(
CommDriverN0183AndroidBTEvent
& event);
79
};
80
81
#endif
// guard
CommDriverN0183AndroidBTEvent
Definition
comm_drv_n0183_android_bt.h:37
CommDriverN0183AndroidBT
Definition
comm_drv_n0183_android_bt.h:56
CommDriverN0183
NMEA0183 drivers common part.
Definition
comm_drv_n0183.h:35
ConnectionParams
Definition
conn_params.h:75
DriverListener
Interface implemented by transport layer and possible other parties like test code which should handl...
Definition
comm_driver.h:48
comm_drv_n0183.h
NMEA0183 drivers common base.
model
include
model
comm_drv_n0183_android_bt.h
Generated on Sat Mar 1 2025 02:28:51 for OpenCPN Partial API docs by
1.9.8