Skip to content

Add support for SignalK.#91

Draft
sebastien-rosset wants to merge 1 commit intorgleason:masterfrom
sebastien-rosset:signalk
Draft

Add support for SignalK.#91
sebastien-rosset wants to merge 1 commit intorgleason:masterfrom
sebastien-rosset:signalk

Conversation

@sebastien-rosset
Copy link

This is WIP. It cannot be merged until Android supports API-19.

@rgleason
Copy link
Owner

rgleason commented Feb 9, 2025

@bdbcat @sebastien-rosset Is there a way in CMakeLists.txt to have "if Android set api 118, else set api 119" ?
Then have an if statement in the src code for android, which does not show or allow use of signalK?

@sebastien-rosset
Copy link
Author

Yes it should be possible. Though if api-19 support is added soon in the Android fit repo, it might be worth waiting a bit.

@sebastien-rosset
Copy link
Author

Currently, OpenCPN requires an exact match between a plugin's declared API version and the supported API versions in OpenCPN's plugin loader. This creates unnecessary restrictions where plugins must target a specific API version even when they could work with newer versions.

    virtual int GetMinAPIVersionMajor() { return GetAPIVersionMajor(); }
    virtual int GetMinAPIVersionMinor() { return GetAPIVersionMinor(); }

// New methods to query host OpenCPN API version
extern "C" DECL_EXP int GetHostAPIVersionMajor(void);
extern "C" DECL_EXP int GetHostAPIVersionMinor(void);

For example, the VDR plugin could implement GetMinAPIVersionMinor() to return 15, meaning older version of OpenCPN are supported. And then the VDR plugin would:

  1. Enable NMEA 2000 if GetHostAPIVersionMajor() returns 18 or above.
  2. Enable SignalK if GetHostAPIVersionMajor() returns 19 or above.

Of course, this wouldn't work now because none of these functions exist.

Conditionally add SignalK support except Android.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants