Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/m0078 ddg 544 add gnss foundation documentation #701

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions ApplicationDeveloperGuide/gnss.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
.. _chapter.gnss:

====
GNSS
====

Principle
=========

The GNSS Foundation Library.

Functional Description
======================

Interactions with the GNSS API goes through a GNSS manager. This manager works around a state machine.
To perform read operations to retrieve GNSS data, the machine must be in a STARTED state.
Transitions between the states are controlled by the user.
:ref:`The following graph <fig_gnss-state-machine>`: details the different states, their function and transitions.

.. _fig_gnss-state-machine:
.. figure:: images/gnss-state-machine.*
:alt: GNSS state machine.
:align: center
:scale: 75%

GNSS State Machine.

After each operations, the method `getState()` can be called on the GNSS manager instance to check weither or not the state has been successfully changed.

Turning the GNSS Engine ON
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: java

// Retrieve the GNSS instance
GnssManager gnssManager = GnssManager.getInstance();

// Initialize the manager and native components
gnssManager.initializeManager();

// Switch the GNSS Engine ON
gnssManager.switchOn();

Retrieving GNSS data
~~~~~~~~~~~~~~~~~~~~

.. code-block:: java

// Read data
gnssManager.readPosition();

// Check timestamp of latest data read to confirm a fix was found.
long timestamp = gnssManager.getTime();

// Retrieve alitude data from engine
gnssManager.getAltitude()

Turning the GNSS Engine OFF
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: java

// Retrieve the GNSS instance
GnssManager gnssManager = GnssManager.getInstance();

// Switch the GNSS Engine OFF
gnssManager.switchOff();

// Close every native components and the manager.
gnssManager.closeManager();

.. note::

`readPosition()` call will throw an IOException if an error occured during data reading, however, timestamp will still be updated.


Use
===

The `GNSS API Module`_ must be added to the :ref:`module.ivy <mmm_module_description>` of the MicroEJ
Application project to use the Event Queue Foundation Library.

.. code-block:: xml

<dependency org="ej.api" name="gnss" rev="2.0.0"/>

To use this API, your VEE Port must implement a compatible version.
Please refer to the :ref:`VEE Porting Guide <pack_gnss>` to port GNSS for your project.

.. _GNSS API Module: https://forge.microej.com/artifactory/microej-developer-repository-release/ej/api/gnss/

..
| Copyright 2023, MicroEJ Corp. Content in this space is free
for read and redistribute. Except if otherwise stated, modification
is subject to MicroEJ Corp prior approval.
| MicroEJ is a trademark of MicroEJ Corp. All other trademarks and
copyrights are the property of their respective owners.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified ApplicationDeveloperGuide/images/networking_overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ApplicationDeveloperGuide/images/networking_overview.pptx
Binary file not shown.
1 change: 1 addition & 0 deletions ApplicationDeveloperGuide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Application Developer Guide
eventQueue
characterEncoding
limitations
gnss

..
| Copyright 2008-2023, MicroEJ Corp. Content in this space is free
Expand Down
34 changes: 34 additions & 0 deletions VEEPortingGuide/appendix/javalibs/gnss.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
GNSS
====

Error Messages
--------------

When an exception is thrown by the implementation of the GNSS API, the
error message

``GNSS-<APIversion>:E=<messageId>``

is issued, where ``<messageId>`` meaning is defined in the next table:

.. table:: GNSS Error Messages

+-------------+--------------------------------------------------------+
| Message ID | Description |
+=============+========================================================+
| -1 | Unknown GNSS native error. |
+-------------+--------------------------------------------------------+
| -2 | An error occurred during data read. |
+-------------+--------------------------------------------------------+
| -3 | Read data is invalid. |
+-------------+--------------------------------------------------------+
| -4 | An operation needing the GNSS engine to be started was |
| | attemtped with the engine off. |
+-------------+--------------------------------------------------------+

..
| Copyright 2023, MicroEJ Corp. Content in this space is free
for read and redistribute. Except if otherwise stated, modification
is subject to MicroEJ Corp prior approval.
| MicroEJ is a trademark of MicroEJ Corp. All other trademarks and
copyrights are the property of their respective owners.
1 change: 1 addition & 0 deletions VEEPortingGuide/appendix/javalibs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ MicroEJ Foundation Libraries
ecom
ecom-comm
fs
gnss
net
ssl

Expand Down
21 changes: 21 additions & 0 deletions VEEPortingGuide/appendix/llapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,27 @@ Two C header files are provided:
Defines a set of functions that the BSP must implement to do some I/O
operations on files (open, read, write, close, etc.).

.. _LLGNSS-API-SECTION:

LLGNSS: GNSS
============

Naming Convention
-----------------

The Low Level GNSS API (LLGNSS), relies on functions that need to
be implemented by engineers in a driver. The names of these functions
match the ``LLGNSS_IMPL_*`` pattern.

Header Files
------------

One header file is provided:

- LLGNSS_impl.h

Defines the set of functions that the BSP must implement to manage and configure
GNSS engine.

.. _LLHAL-API-SECTION:

Expand Down
66 changes: 66 additions & 0 deletions VEEPortingGuide/gnss.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.. _pack_gnss:

====
GNSS
====


Principle
=========

The GNSS module defines a low-level GNSS framework for embedded
devices. It allows you to manage the underlying GNSS engine and retrieve data such as the longitude, latitude, velocity and time.


Functional Description
======================

The MicroEJ Application manages the GNSS engine using
GnssManager abstraction. The GNSS implementation made for each MicroEJ
Platform is responsible for surfacing the native File System specific
behavior.

GNSS Mock
=========

GNSS values on simulator can be control through an UI that could be activated and deactivated with the property : ``com.is2t.gnss.embedded.mock.ui``.

Dependencies
============

- ``LLGNSS_impl.h`` implementations (see
:ref:`LLGNSS-API-SECTION`).


Installation
============

The GNSS :ref:`Pack <pack_overview>` module must be installed in your VEE Port.

In the Platform configuration project, (``-configuration`` suffix), add
the following dependency to the :ref:`module.ivy <mmm_module_description>` file:

::

<dependency org="com.microej.pack.gnss" name="gnss-pack" rev="2.0.0" />

The Platform project must be rebuilt (:ref:`platform_build`).

Use
===

The `GNSS API Module`_ must be added to the :ref:`module.ivy <mmm_module_description>` of the MicroEJ
Application project to use the GNSS library.

.. code-block:: xml

<dependency org="com.microej.pack.gnss" name="gnss-pack" rev="2.0.0"/>

.. _GNSS API Module: https://forge.microej.com/artifactory/microej-developer-repository-release/ej/api/gnss/

..
| Copyright 2023, MicroEJ Corp. Content in this space is free
for read and redistribute. Except if otherwise stated, modification
is subject to MicroEJ Corp prior approval.
| MicroEJ is a trademark of MicroEJ Corp. All other trademarks and
copyrights are the property of their respective owners.
1 change: 1 addition & 0 deletions VEEPortingGuide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ VEE Porting Guide
bluetooth
packEventQueue
fs
gnss
hal
device
watchdog-timer
Expand Down
13 changes: 13 additions & 0 deletions VEEPortingGuide/platformQualification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,19 @@ FS Pack

.. _test_suite_versioning_bluetooth:

GNSS Pack
---------

.. list-table:: GNSS API Implementation and Validation
:widths: 20 10 10

* - GNSS Pack
- GNSS API
- Java Test Suite
* - 2.0.0
- `2.0.0 <https://forge.microej.com/artifactory/microej-developer-repository-release/ej/api/gnss/2.0.0/>`__
- `2.0.0 <https://forge.microej.com/artifactory/microej-developer-repository-release/com/microej/pack/gnss/gnss-testsuite/2.0.0/>`__

BLUETOOTH Pack
--------------

Expand Down