1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-28 05:03:06 +01:00

5 Commits

Author SHA1 Message Date
898922769a PGN 127502 remote keyboard support 2025-12-27 17:07:01 +01:00
Norbert Walter
470c0e5f4d Merge pull request #208 from thooge/fonts
Added small 8x8px font mainly for use with graphs
2025-10-06 18:25:44 +02:00
Norbert Walter
9a792b49db Merge pull request #206 from TobiasE-github/master
disabe mode x in PageWind
2025-10-06 18:23:56 +02:00
8f851a4b61 Added small 8x8px font mainly for use with graphs
Page skyview improved with the new font as example usage
2025-10-06 13:19:42 +02:00
TobiasE-github
e5950f95fd disabe mode x in PageWind 2025-09-27 20:30:00 +02:00
13 changed files with 306 additions and 28 deletions

View File

@@ -137,6 +137,7 @@ class GwApi{
* thread safe methods - can directly be called from a user task * thread safe methods - can directly be called from a user task
*/ */
virtual GwRequestQueue *getQueue()=0; virtual GwRequestQueue *getQueue()=0;
virtual QueueHandle_t getKbQueue()=0;
virtual void sendN2kMessage(const tN2kMsg &msg, bool convert=true)=0; virtual void sendN2kMessage(const tN2kMsg &msg, bool convert=true)=0;
/** /**
* deprecated - sourceId will be ignored * deprecated - sourceId will be ignored

View File

@@ -71,6 +71,7 @@ class GwConverterConfig{
int rmcInterval=1000; int rmcInterval=1000;
int rmcCheckTime=4000; int rmcCheckTime=4000;
int winst312=256; int winst312=256;
int swBankInstance=0;
bool unmappedXdr=false; bool unmappedXdr=false;
unsigned long xdrTimeout=60000; unsigned long xdrTimeout=60000;
std::vector<WindMapping> windMappings; std::vector<WindMapping> windMappings;
@@ -97,6 +98,7 @@ class GwConverterConfig{
windMappings.push_back(mapping); windMappings.push_back(mapping);
} }
} }
swBankInstance=config->getInt(GwConfigDefinitions::swBankInstance,0);
} }
const WindMapping findWindMapping(const tN2kWindReference &n2k) const{ const WindMapping findWindMapping(const tN2kWindReference &n2k) const{
for (const auto & it:windMappings){ for (const auto & it:windMappings){

View File

@@ -1572,6 +1572,36 @@ private:
finalizeXdr(); finalizeXdr();
} }
void Handle127502(const tN2kMsg &msg){
// switch bank control / receive remote key strokes
unsigned char instance=-1;
tN2kBinaryStatus bankstatus;
LOG_DEBUG(GwLog::LOG,"received switch bank control");
// check if we are addressed and our configured instance is used
if (! ParseN2kPGN127502(msg,instance,bankstatus)) {
LOG_DEBUG(GwLog::DEBUG,"unable to parse PGN %d",msg.PGN);
return;
}
if (! (instance == config.swBankInstance)) {
LOG_DEBUG(GwLog::DEBUG,"switch bank instance #%d ignored",instance);
return;
}
// TODO (?) multiple keys together
// only process configured key count (default 6)
for (uint8_t i=1; i<=6; i++) {
tN2kOnOff keystatus = N2kGetStatusOnBinaryStatus(bankstatus, i);
if (keystatus == 1) {
// key pressed: send key to queue
xQueueSend(keyboardQueue, &i, 0);
} else if (keystatus == 2) {
// long key pressed: send long key to queue
xQueueSend(keyboardQueue, &i, 0);
}
}
}
void registerConverters() void registerConverters()
{ {
//register all converter functions //register all converter functions
@@ -1607,6 +1637,7 @@ private:
converters.registerConverter(127488UL, &N2kToNMEA0183Functions::Handle127488); converters.registerConverter(127488UL, &N2kToNMEA0183Functions::Handle127488);
converters.registerConverter(130316UL, &N2kToNMEA0183Functions::Handle130316); converters.registerConverter(130316UL, &N2kToNMEA0183Functions::Handle130316);
converters.registerConverter(127257UL, &N2kToNMEA0183Functions::Handle127257); converters.registerConverter(127257UL, &N2kToNMEA0183Functions::Handle127257);
converters.registerConverter(127502UL, &N2kToNMEA0183Functions::Handle127502);
#define HANDLE_AIS #define HANDLE_AIS
#ifdef HANDLE_AIS #ifdef HANDLE_AIS
converters.registerConverter(129038UL, &N2kToNMEA0183Functions::HandleAISClassAPosReport); // AIS Class A Position Report, Message Type 1 converters.registerConverter(129038UL, &N2kToNMEA0183Functions::HandleAISClassAPosReport); // AIS Class A Position Report, Message Type 1
@@ -1620,13 +1651,15 @@ private:
public: public:
N2kToNMEA0183Functions(GwLog *logger, GwBoatData *boatData, N2kToNMEA0183Functions(GwLog *logger, GwBoatData *boatData,
SendNMEA0183MessageCallback callback, SendNMEA0183MessageCallback callback,
String talkerId, GwXDRMappings *xdrMappings, const GwConverterConfig &cfg) String talkerId, GwXDRMappings *xdrMappings, const GwConverterConfig &cfg,
QueueHandle_t kbQueue)
: N2kDataToNMEA0183(logger, boatData, callback,talkerId) : N2kDataToNMEA0183(logger, boatData, callback,talkerId)
{ {
this->logger = logger; this->logger = logger;
this->boatData = boatData; this->boatData = boatData;
this->xdrMappings=xdrMappings; this->xdrMappings=xdrMappings;
this->config=cfg; this->config=cfg;
this->keyboardQueue=kbQueue;
registerConverters(); registerConverters();
} }
virtual void loop(unsigned long lastExtRmc) override virtual void loop(unsigned long lastExtRmc) override
@@ -1642,8 +1675,8 @@ private:
N2kDataToNMEA0183* N2kDataToNMEA0183::create(GwLog *logger, GwBoatData *boatData, N2kDataToNMEA0183* N2kDataToNMEA0183::create(GwLog *logger, GwBoatData *boatData,
SendNMEA0183MessageCallback callback, String talkerId, GwXDRMappings *xdrMappings, SendNMEA0183MessageCallback callback, String talkerId, GwXDRMappings *xdrMappings,
const GwConverterConfig &cfg){ const GwConverterConfig &cfg, QueueHandle_t kbQueue){
LOG_DEBUG(GwLog::LOG,"creating N2kToNMEA0183"); LOG_DEBUG(GwLog::LOG,"creating N2kToNMEA0183");
return new N2kToNMEA0183Functions(logger,boatData,callback, talkerId,xdrMappings,cfg); return new N2kToNMEA0183Functions(logger,boatData,callback, talkerId,xdrMappings,cfg,kbQueue);
} }
//***************************************************************************** //*****************************************************************************

View File

@@ -43,6 +43,7 @@ protected:
GwBoatData *boatData; GwBoatData *boatData;
int sourceId=0; int sourceId=0;
char talkerId[3]; char talkerId[3];
QueueHandle_t keyboardQueue;
SendNMEA0183MessageCallback sendNMEA0183MessageCallback; SendNMEA0183MessageCallback sendNMEA0183MessageCallback;
void SendMessage(const tNMEA0183Msg &NMEA0183Msg); void SendMessage(const tNMEA0183Msg &NMEA0183Msg);
N2kDataToNMEA0183(GwLog *logger, GwBoatData *boatData, N2kDataToNMEA0183(GwLog *logger, GwBoatData *boatData,
@@ -50,7 +51,8 @@ protected:
public: public:
static N2kDataToNMEA0183* create(GwLog *logger, GwBoatData *boatData, SendNMEA0183MessageCallback callback, static N2kDataToNMEA0183* create(GwLog *logger, GwBoatData *boatData, SendNMEA0183MessageCallback callback,
String talkerId, GwXDRMappings *xdrMappings,const GwConverterConfig &cfg); String talkerId, GwXDRMappings *xdrMappings,const GwConverterConfig &cfg,
QueueHandle_t kbQueue);
virtual void HandleMsg(const tN2kMsg &N2kMsg, int sourceId) = 0; virtual void HandleMsg(const tN2kMsg &N2kMsg, int sourceId) = 0;
virtual void loop(unsigned long lastRmc); virtual void loop(unsigned long lastRmc);
virtual ~N2kDataToNMEA0183(){} virtual ~N2kDataToNMEA0183(){}

View File

@@ -24,6 +24,7 @@
#include "fonts/Ubuntu_Bold20pt8b.h" #include "fonts/Ubuntu_Bold20pt8b.h"
#include "fonts/Ubuntu_Bold32pt8b.h" #include "fonts/Ubuntu_Bold32pt8b.h"
#include "fonts/Atari16px8b.h" // Key label font #include "fonts/Atari16px8b.h" // Key label font
#include "fonts/IBM8x8px.h"
// E-Ink Display // E-Ink Display
#define GxEPD_WIDTH 400 // Display width #define GxEPD_WIDTH 400 // Display width

View File

@@ -51,6 +51,7 @@ extern const GFXfont Ubuntu_Bold16pt8b;
extern const GFXfont Ubuntu_Bold20pt8b; extern const GFXfont Ubuntu_Bold20pt8b;
extern const GFXfont Ubuntu_Bold32pt8b; extern const GFXfont Ubuntu_Bold32pt8b;
extern const GFXfont Atari16px; extern const GFXfont Atari16px;
extern const GFXfont IBM8x8px;
// Global functions // Global functions
#ifdef DISPLAY_GDEW042T2 #ifdef DISPLAY_GDEW042T2

View File

@@ -121,18 +121,20 @@ public:
getdisplay().setCursor(c.x - r + 3 , c.y + h / 2); getdisplay().setCursor(c.x - r + 3 , c.y + h / 2);
getdisplay().print("W"); getdisplay().print("W");
getdisplay().setFont(&Ubuntu_Bold8pt8b);
// show satellites in "map" // show satellites in "map"
getdisplay().setFont(&IBM8x8px);
for (int i = 0; i < nSat; i++) { for (int i = 0; i < nSat; i++) {
float arad = (sats[i].Azimut * M_PI / 180.0) + M_PI; float arad = (sats[i].Azimut * M_PI / 180.0) + M_PI;
float erad = sats[i].Elevation * M_PI / 180.0; float erad = sats[i].Elevation * M_PI / 180.0;
uint16_t x = c.x + sin(arad) * erad * r1; uint16_t x = c.x + sin(arad) * erad * r1;
uint16_t y = c.y + cos(arad) * erad * r1; uint16_t y = c.y + cos(arad) * erad * r1;
getdisplay().fillRect(x-4, y-4, 8, 8, commonData->fgcolor); getdisplay().fillRect(x-4, y-4, 8, 8, commonData->fgcolor);
getdisplay().setCursor(x-7, y+12);
getdisplay().printf("%02d", static_cast<int>(sats[i].PRN));
} }
// Signal / Noise bars // Signal / Noise bars
getdisplay().setFont(&Ubuntu_Bold8pt8b);
getdisplay().setCursor(325, 34); getdisplay().setCursor(325, 34);
getdisplay().print("SNR"); getdisplay().print("SNR");
// getdisplay().drawRect(270, 20, 125, 257, commonData->fgcolor); // getdisplay().drawRect(270, 20, 125, 257, commonData->fgcolor);

View File

@@ -247,8 +247,8 @@ public:
if(key == 1){ // Mode switch if(key == 1){ // Mode switch
if(mode == 'N'){ if(mode == 'N'){
mode = 'L'; mode = 'L';
} else if (mode == 'L') { // } else if (mode == 'L') {
mode = 'X'; // mode = 'X';
} else { } else {
mode = 'N'; mode = 'N';
} }

View File

@@ -0,0 +1,202 @@
const uint8_t IBM8x8pxBitmaps[] PROGMEM = {
0x00, /* 0x20 space */
0x6F, 0xF6, 0x60, 0x60, /* 0x21 exclam */
0xDE, 0xF6, /* 0x22 quotedbl */
0x6C, 0xDB, 0xFB, 0x6F, 0xED, 0x9B, 0x00, /* 0x23 numbersign */
0x31, 0xFC, 0x1E, 0x0F, 0xE3, 0x00, /* 0x24 dollar */
0xC7, 0x98, 0x61, 0x86, 0x78, 0xC0, /* 0x25 percent */
0x38, 0xD8, 0xE3, 0xBD, 0xD9, 0x9D, 0x80, /* 0x26 ampersand */
0x6F, 0x00, /* 0x27 quotesingle */
0x36, 0xCC, 0xC6, 0x30, /* 0x28 parenleft */
0xC6, 0x33, 0x36, 0xC0, /* 0x29 parenright */
0x66, 0x3C, 0xFF, 0x3C, 0x66, /* 0x2A asterisk */
0x30, 0xCF, 0xCC, 0x30, /* 0x2B plus */
0x6F, 0x00, /* 0x2C comma */
0xFC, /* 0x2D hyphen */
0xF0, /* 0x2E period */
0x06, 0x18, 0x61, 0x86, 0x18, 0x20, 0x00, /* 0x2F slash */
0x7D, 0x8F, 0x3E, 0xFF, 0x7C, 0xDF, 0x00, /* 0x30 zero */
0x31, 0xC3, 0x0C, 0x30, 0xCF, 0xC0, /* 0x31 one */
0x7B, 0x30, 0xCE, 0x63, 0x1F, 0xC0, /* 0x32 two */
0x7B, 0x30, 0xCE, 0x0F, 0x37, 0x80, /* 0x33 three */
0x1C, 0x79, 0xB6, 0x6F, 0xE1, 0x87, 0x80, /* 0x34 four */
0xFF, 0x0F, 0x83, 0x0F, 0x37, 0x80, /* 0x35 five */
0x39, 0x8C, 0x3E, 0xCF, 0x37, 0x80, /* 0x36 six */
0xFF, 0x30, 0xC6, 0x30, 0xC3, 0x00, /* 0x37 seven */
0x7B, 0x3C, 0xDE, 0xCF, 0x37, 0x80, /* 0x38 eight */
0x7B, 0x3C, 0xDF, 0x0C, 0x67, 0x00, /* 0x39 nine */
0xF0, 0xF0, /* 0x3A colon */
0x6C, 0x37, 0x80, /* 0x3B semicolon */
0x19, 0x99, 0x86, 0x18, 0x60, /* 0x3C less */
0xFC, 0x00, 0x3F, /* 0x3D equal */
0xC3, 0x0C, 0x33, 0x33, 0x00, /* 0x3E greater */
0x7B, 0x30, 0xC6, 0x30, 0x03, 0x00, /* 0x3F question */
0x7D, 0x8F, 0x7E, 0xFD, 0xF8, 0x1E, 0x00, /* 0x40 at */
0x31, 0xEC, 0xF3, 0xFF, 0x3C, 0xC0, /* 0x41 A */
0xFC, 0xCD, 0x9B, 0xE6, 0x6C, 0xFF, 0x00, /* 0x42 B */
0x3C, 0xCF, 0x06, 0x0C, 0x0C, 0xCF, 0x00, /* 0x43 C */
0xF8, 0xD9, 0x9B, 0x36, 0x6D, 0xBE, 0x00, /* 0x44 D */
0xFE, 0xC5, 0xA3, 0xC6, 0x8C, 0x7F, 0x80, /* 0x45 E */
0xFE, 0xC5, 0xA3, 0xC6, 0x8C, 0x3C, 0x00, /* 0x46 F */
0x3C, 0xCF, 0x06, 0x0C, 0xEC, 0xCF, 0x80, /* 0x47 G */
0xCF, 0x3C, 0xFF, 0xCF, 0x3C, 0xC0, /* 0x48 H */
0xF6, 0x66, 0x66, 0xF0, /* 0x49 I */
0x1E, 0x18, 0x30, 0x6C, 0xD9, 0x9E, 0x00, /* 0x4A J */
0xE6, 0xCD, 0xB3, 0xC6, 0xCC, 0xF9, 0x80, /* 0x4B K */
0xF0, 0xC1, 0x83, 0x06, 0x2C, 0xFF, 0x80, /* 0x4C L */
0xC7, 0xDF, 0xFF, 0xFD, 0x78, 0xF1, 0x80, /* 0x4D M */
0xC7, 0xCF, 0xDE, 0xFC, 0xF8, 0xF1, 0x80, /* 0x4E N */
0x38, 0xDB, 0x1E, 0x3C, 0x6D, 0x8E, 0x00, /* 0x4F O */
0xFC, 0xCD, 0x9B, 0xE6, 0x0C, 0x3C, 0x00, /* 0x50 P */
0x7B, 0x3C, 0xF3, 0xDD, 0xE1, 0xC0, /* 0x51 Q */
0xFC, 0xCD, 0x9B, 0xE6, 0xCC, 0xF9, 0x80, /* 0x52 R */
0x7B, 0x3E, 0x1C, 0x1F, 0x37, 0x80, /* 0x53 S */
0xFE, 0xD3, 0x0C, 0x30, 0xC7, 0x80, /* 0x54 T */
0xCF, 0x3C, 0xF3, 0xCF, 0x3F, 0xC0, /* 0x55 U */
0xCF, 0x3C, 0xF3, 0xCD, 0xE3, 0x00, /* 0x56 V */
0xC7, 0x8F, 0x1E, 0xBF, 0xFD, 0xF1, 0x80, /* 0x57 W */
0xC7, 0x8D, 0xB1, 0xC3, 0x8D, 0xB1, 0x80, /* 0x58 X */
0xCF, 0x3C, 0xDE, 0x30, 0xC7, 0x80, /* 0x59 Y */
0xFF, 0x8E, 0x30, 0xC3, 0x2C, 0xFF, 0x80, /* 0x5A Z */
0xFC, 0xCC, 0xCC, 0xF0, /* 0x5B bracketleft */
0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, /* 0x5C backslash */
0xF3, 0x33, 0x33, 0xF0, /* 0x5D bracketright */
0x10, 0x71, 0xB6, 0x30, /* 0x5E asciicircum */
0xFF, /* 0x5F underscore */
0xD9, 0x80, /* 0x60 grave */
0x78, 0x19, 0xF6, 0x67, 0x60, /* 0x61 a */
0xE0, 0xC1, 0x83, 0xE6, 0x6C, 0xF7, 0x00, /* 0x62 b */
0x7B, 0x3C, 0x33, 0x78, /* 0x63 c */
0x1C, 0x18, 0x33, 0xEC, 0xD9, 0x9D, 0x80, /* 0x64 d */
0x7B, 0x3F, 0xF0, 0x78, /* 0x65 e */
0x39, 0xB6, 0x3C, 0x61, 0x8F, 0x00, /* 0x66 f */
0x77, 0x9B, 0x33, 0xE0, 0xDF, 0x00, /* 0x67 g */
0xE0, 0xC1, 0xB3, 0xB6, 0x6C, 0xF9, 0x80, /* 0x68 h */
0x60, 0xE6, 0x66, 0xF0, /* 0x69 i */
0x0C, 0x00, 0xC3, 0x0F, 0x3C, 0xDE, /* 0x6A j */
0xE0, 0xC1, 0x9B, 0x67, 0x8D, 0xB9, 0x80, /* 0x6B k */
0xE6, 0x66, 0x66, 0xF0, /* 0x6C l */
0xCD, 0xFF, 0xFE, 0xBC, 0x60, /* 0x6D m */
0xFB, 0x3C, 0xF3, 0xCC, /* 0x6E n */
0x7B, 0x3C, 0xF3, 0x78, /* 0x6F o */
0xDC, 0xCD, 0x9B, 0xE6, 0x1E, 0x00, /* 0x70 p */
0x77, 0x9B, 0x33, 0xE0, 0xC3, 0xC0, /* 0x71 q */
0xDC, 0xED, 0x9B, 0x0F, 0x00, /* 0x72 r */
0x7F, 0x07, 0x83, 0xF8, /* 0x73 s */
0x23, 0x3E, 0xC6, 0x34, 0xC0, /* 0x74 t */
0xCD, 0x9B, 0x36, 0x67, 0x60, /* 0x75 u */
0xCF, 0x3C, 0xDE, 0x30, /* 0x76 v */
0xC7, 0xAF, 0xFF, 0xF6, 0xC0, /* 0x77 w */
0xC6, 0xD8, 0xE3, 0x6C, 0x60, /* 0x78 x */
0xCF, 0x3C, 0xDF, 0x0F, 0xE0, /* 0x79 y */
0xFE, 0x63, 0x19, 0xFC, /* 0x7A z */
0x1C, 0xC3, 0x38, 0x30, 0xC1, 0xC0, /* 0x7B braceleft */
0xFC, 0xFC, /* 0x7C bar */
0xE0, 0xC3, 0x07, 0x30, 0xCE, 0x00, /* 0x7D braceright */
0x77, 0xB8, /* 0x7E asciitilde */
0x10, 0x71, 0xB6, 0x3C, 0x7F, 0xC0 /* 0x7F uni007F */
};
const GFXglyph IBM8x8pxGlyphs[] PROGMEM = {
{ 0, 1, 1, 2, 0, -1 }, /* 0x20 space */
{ 1, 4, 7, 5, 0, -7 }, /* 0x21 exclam */
{ 5, 5, 3, 6, 0, -7 }, /* 0x22 quotedbl */
{ 7, 7, 7, 8, 0, -7 }, /* 0x23 numbersign */
{ 14, 6, 7, 7, 0, -7 }, /* 0x24 dollar */
{ 20, 7, 6, 8, 0, -6 }, /* 0x25 percent */
{ 26, 7, 7, 8, 0, -7 }, /* 0x26 ampersand */
{ 33, 3, 3, 4, 0, -7 }, /* 0x27 quotesingle */
{ 35, 4, 7, 5, 0, -7 }, /* 0x28 parenleft */
{ 39, 4, 7, 5, 0, -7 }, /* 0x29 parenright */
{ 43, 8, 5, 9, 0, -6 }, /* 0x2A asterisk */
{ 48, 6, 5, 7, 0, -6 }, /* 0x2B plus */
{ 52, 3, 3, 4, 0, -2 }, /* 0x2C comma */
{ 54, 6, 1, 7, 0, -4 }, /* 0x2D hyphen */
{ 55, 2, 2, 3, 0, -2 }, /* 0x2E period */
{ 56, 7, 7, 8, 0, -7 }, /* 0x2F slash */
{ 63, 7, 7, 8, 0, -7 }, /* 0x30 zero */
{ 70, 6, 7, 7, 0, -7 }, /* 0x31 one */
{ 76, 6, 7, 7, 0, -7 }, /* 0x32 two */
{ 82, 6, 7, 7, 0, -7 }, /* 0x33 three */
{ 88, 7, 7, 8, 0, -7 }, /* 0x34 four */
{ 95, 6, 7, 7, 0, -7 }, /* 0x35 five */
{ 101, 6, 7, 7, 0, -7 }, /* 0x36 six */
{ 107, 6, 7, 7, 0, -7 }, /* 0x37 seven */
{ 113, 6, 7, 7, 0, -7 }, /* 0x38 eight */
{ 119, 6, 7, 7, 0, -7 }, /* 0x39 nine */
{ 125, 2, 6, 3, 0, -6 }, /* 0x3A colon */
{ 127, 3, 6, 4, 0, -6 }, /* 0x3B semicolon */
{ 130, 5, 7, 6, 0, -7 }, /* 0x3C less */
{ 135, 6, 4, 7, 0, -5 }, /* 0x3D equal */
{ 138, 5, 7, 6, 0, -7 }, /* 0x3E greater */
{ 143, 6, 7, 7, 0, -7 }, /* 0x3F question */
{ 149, 7, 7, 8, 0, -7 }, /* 0x40 at */
{ 156, 6, 7, 7, 0, -7 }, /* 0x41 A */
{ 162, 7, 7, 8, 0, -7 }, /* 0x42 B */
{ 169, 7, 7, 8, 0, -7 }, /* 0x43 C */
{ 176, 7, 7, 8, 0, -7 }, /* 0x44 D */
{ 183, 7, 7, 8, 0, -7 }, /* 0x45 E */
{ 190, 7, 7, 8, 0, -7 }, /* 0x46 F */
{ 197, 7, 7, 8, 0, -7 }, /* 0x47 G */
{ 204, 6, 7, 7, 0, -7 }, /* 0x48 H */
{ 210, 4, 7, 5, 0, -7 }, /* 0x49 I */
{ 214, 7, 7, 8, 0, -7 }, /* 0x4A J */
{ 221, 7, 7, 8, 0, -7 }, /* 0x4B K */
{ 228, 7, 7, 8, 0, -7 }, /* 0x4C L */
{ 235, 7, 7, 8, 0, -7 }, /* 0x4D M */
{ 242, 7, 7, 8, 0, -7 }, /* 0x4E N */
{ 249, 7, 7, 8, 0, -7 }, /* 0x4F O */
{ 256, 7, 7, 8, 0, -7 }, /* 0x50 P */
{ 263, 6, 7, 7, 0, -7 }, /* 0x51 Q */
{ 269, 7, 7, 8, 0, -7 }, /* 0x52 R */
{ 276, 6, 7, 7, 0, -7 }, /* 0x53 S */
{ 282, 6, 7, 7, 0, -7 }, /* 0x54 T */
{ 288, 6, 7, 7, 0, -7 }, /* 0x55 U */
{ 294, 6, 7, 7, 0, -7 }, /* 0x56 V */
{ 300, 7, 7, 8, 0, -7 }, /* 0x57 W */
{ 307, 7, 7, 8, 0, -7 }, /* 0x58 X */
{ 314, 6, 7, 7, 0, -7 }, /* 0x59 Y */
{ 320, 7, 7, 8, 0, -7 }, /* 0x5A Z */
{ 327, 4, 7, 5, 0, -7 }, /* 0x5B bracketleft */
{ 331, 7, 7, 8, 0, -7 }, /* 0x5C backslash */
{ 338, 4, 7, 5, 0, -7 }, /* 0x5D bracketright */
{ 342, 7, 4, 8, 0, -7 }, /* 0x5E asciicircum */
{ 346, 8, 1, 9, 0, 0 }, /* 0x5F underscore */
{ 347, 3, 3, 4, 0, -7 }, /* 0x60 grave */
{ 349, 7, 5, 8, 0, -5 }, /* 0x61 a */
{ 354, 7, 7, 8, 0, -7 }, /* 0x62 b */
{ 361, 6, 5, 7, 0, -5 }, /* 0x63 c */
{ 365, 7, 7, 8, 0, -7 }, /* 0x64 d */
{ 372, 6, 5, 7, 0, -5 }, /* 0x65 e */
{ 376, 6, 7, 7, 0, -7 }, /* 0x66 f */
{ 382, 7, 6, 8, 0, -5 }, /* 0x67 g */
{ 388, 7, 7, 8, 0, -7 }, /* 0x68 h */
{ 395, 4, 7, 5, 0, -7 }, /* 0x69 i */
{ 399, 6, 8, 7, 0, -7 }, /* 0x6A j */
{ 405, 7, 7, 8, 0, -7 }, /* 0x6B k */
{ 412, 4, 7, 5, 0, -7 }, /* 0x6C l */
{ 416, 7, 5, 8, 0, -5 }, /* 0x6D m */
{ 421, 6, 5, 7, 0, -5 }, /* 0x6E n */
{ 425, 6, 5, 7, 0, -5 }, /* 0x6F o */
{ 429, 7, 6, 8, 0, -5 }, /* 0x70 p */
{ 435, 7, 6, 8, 0, -5 }, /* 0x71 q */
{ 441, 7, 5, 8, 0, -5 }, /* 0x72 r */
{ 446, 6, 5, 7, 0, -5 }, /* 0x73 s */
{ 450, 5, 7, 6, 0, -7 }, /* 0x74 t */
{ 455, 7, 5, 8, 0, -5 }, /* 0x75 u */
{ 460, 6, 5, 7, 0, -5 }, /* 0x76 v */
{ 464, 7, 5, 8, 0, -5 }, /* 0x77 w */
{ 469, 7, 5, 8, 0, -5 }, /* 0x78 x */
{ 474, 6, 6, 7, 0, -5 }, /* 0x79 y */
{ 479, 6, 5, 7, 0, -5 }, /* 0x7A z */
{ 483, 6, 7, 7, 0, -7 }, /* 0x7B braceleft */
{ 489, 2, 7, 3, 0, -7 }, /* 0x7C bar */
{ 491, 6, 7, 7, 0, -7 }, /* 0x7D braceright */
{ 497, 7, 2, 8, 0, -7 }, /* 0x7E asciitilde */
{ 499, 7, 6, 8, 0, -6 } /* 0x7F uni007F */
};
const GFXfont IBM8x8px PROGMEM = {
(uint8_t *)IBM8x8pxBitmaps,
(GFXglyph *)IBM8x8pxGlyphs,
0x20, 0x7F, 8 };

View File

@@ -344,6 +344,8 @@ void OBP60Task(GwApi *api){
tN2kMsg N2kMsg; tN2kMsg N2kMsg;
QueueHandle_t keyboardQueue = api->getKbQueue();
LOG_DEBUG(GwLog::LOG,"obp60task started"); LOG_DEBUG(GwLog::LOG,"obp60task started");
for (auto it=allPages.pages.begin();it != allPages.pages.end();it++){ for (auto it=allPages.pages.begin();it != allPages.pages.end();it++){
LOG_DEBUG(GwLog::LOG,"found registered page %s",(*it)->pageName.c_str()); LOG_DEBUG(GwLog::LOG,"found registered page %s",(*it)->pageName.c_str());
@@ -613,8 +615,17 @@ void OBP60Task(GwApi *api){
setFlashLED(true); setFlashLED(true);
} }
// Keyboard messages from remote
uint8_t remotekey = 0;
if (xQueueReceive(keyboardQueue, &remotekey, 0) == pdPASS) {
LOG_DEBUG(GwLog::LOG, "OBP received remote key: %d", remotekey);
// inject into internal keyboard queue
xQueueSend(allParameters.queue, &remotekey, 0);
}
// Check the keyboard message // Check the keyboard message
int keyboardMessage=0; int keyboardMessage=0;
while (xQueueReceive(allParameters.queue,&keyboardMessage,0)){ while (xQueueReceive(allParameters.queue,&keyboardMessage,0)){
LOG_DEBUG(GwLog::LOG,"new key from keyboard %d",keyboardMessage); LOG_DEBUG(GwLog::LOG,"new key from keyboard %d",keyboardMessage);
keypressed = true; keypressed = true;

View File

@@ -189,6 +189,10 @@ public:
{ {
return api->getQueue(); return api->getQueue();
} }
virtual QueueHandle_t getKbQueue()
{
return api->getKbQueue();
}
virtual void sendN2kMessage(const tN2kMsg &msg,bool convert) virtual void sendN2kMessage(const tN2kMsg &msg,bool convert)
{ {
GWSYNCHRONIZED(mainLock); GWSYNCHRONIZED(mainLock);

View File

@@ -158,6 +158,8 @@ GwCounter<unsigned long> countNMEA2KIn("countNMEA2000in");
GwCounter<unsigned long> countNMEA2KOut("countNMEA2000out"); GwCounter<unsigned long> countNMEA2KOut("countNMEA2000out");
GwIntervalRunner timers; GwIntervalRunner timers;
QueueHandle_t keyboardQueue = NULL;
bool checkPass(String hash){ bool checkPass(String hash){
return config.checkPass(hash); return config.checkPass(hash);
} }
@@ -269,6 +271,10 @@ public:
{ {
return &mainQueue; return &mainQueue;
} }
virtual QueueHandle_t getKbQueue()
{
return keyboardQueue;
}
virtual void sendN2kMessage(const tN2kMsg &msg,bool convert) virtual void sendN2kMessage(const tN2kMsg &msg,bool convert)
{ {
handleN2kMessage(msg,sourceId,!convert); handleN2kMessage(msg,sourceId,!convert);
@@ -860,6 +866,8 @@ void setup() {
webserver.begin(); webserver.begin();
xdrMappings.begin(); xdrMappings.begin();
logger.flush(); logger.flush();
// remote keyboard support
keyboardQueue = xQueueCreate(10, sizeof(uint8_t));
GwConverterConfig converterConfig; GwConverterConfig converterConfig;
converterConfig.init(&config,&logger); converterConfig.init(&config,&logger);
nmea0183Converter= N2kDataToNMEA0183::create(&logger, &boatData, nmea0183Converter= N2kDataToNMEA0183::create(&logger, &boatData,
@@ -869,7 +877,8 @@ void setup() {
, ,
config.getString(config.talkerId,String("GP")), config.getString(config.talkerId,String("GP")),
&xdrMappings, &xdrMappings,
converterConfig converterConfig,
keyboardQueue
); );
toN2KConverter= NMEA0183DataToN2K::create(&logger,&boatData,[](const tN2kMsg &msg, int sourceId)->bool{ toN2KConverter= NMEA0183DataToN2K::create(&logger,&boatData,[](const tN2kMsg &msg, int sourceId)->bool{

View File

@@ -88,6 +88,16 @@
"description":"the brightness of the led (0..255)", "description":"the brightness of the led (0..255)",
"category":"system" "category":"system"
}, },
{
"name": "swBankInstance",
"type": "number",
"default": 0,
"min": 0,
"max": 252,
"check": "checkMinMax",
"description": "the instance of switch bank to receive data for (0..252)",
"category": "system"
},
{ {
"name": "talkerId", "name": "talkerId",
"label": "NMEA0183 ID", "label": "NMEA0183 ID",