Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5257d85
Initial empty repository
kevlhop Dec 17, 2025
692e3a2
api-mockup: add Apache 2.0 license
kevlhop Dec 18, 2025
e463351
api-mockup: add MQTT communication using Mosquitto library
kevlhop Dec 18, 2025
0e417d0
api-mockup: add gapi main file
kevlhop Dec 18, 2025
eba41ad
api-mockup: add Makefile for building gapi with mosquitto
kevlhop Dec 18, 2025
aef7a23
api-mockup: add clang-format and clang-tidy checks
kevlhop Dec 18, 2025
80f27c7
api-mockup: add dockerize environment for building and linting
kevlhop Dec 18, 2025
efe5870
api-mockup: add README
kevlhop Dec 18, 2025
7f48855
gapi_mosquitto: set MQTT username and password
kevlhop Dec 19, 2025
f83b837
gapi_mosquitto: add QoS parameter to subscribe and publish functions
kevlhop Dec 19, 2025
d24295c
api-mockup: add schemas submodule
kevlhop Dec 23, 2025
908f3bb
Makefile: add compilation of protobuf schemas
kevlhop Dec 23, 2025
2b4fff2
gapi-mockup: add build directory and move source files
kevlhop Dec 23, 2025
3397988
gapi_mosquitto: add topic handler registration function
kevlhop Dec 23, 2025
5862f7d
gapi: add platform discovery message handlers
kevlhop Dec 23, 2025
194698e
Makefile: modify compilation of schemas
kevlhop Dec 24, 2025
48a75a2
clang-format: adjust continuation indent width
kevlhop Dec 30, 2025
7eed5f8
gapi_discovery: add platform discovery response message
kevlhop Dec 24, 2025
f79b01e
gapi_mosquitto: don't exit program after sending message or on error
kevlhop Dec 29, 2025
8af2dc8
gapi_discovery: add application manifest req
kevlhop Dec 29, 2025
a710df9
gapi_mosquitto: remove sent_mid tracking
kevlhop Dec 30, 2025
3b48a84
src: add instantaneous data sending thread
kevlhop Dec 30, 2025
29ada38
gapi_instantaneous: add mock instantaneous data retrieval and publishing
kevlhop Dec 30, 2025
b968dad
gapi_instantaneous: add phase_n assignment
kevlhop Jan 20, 2026
28da7ab
gapi: add waveform data message handler
kevlhop Jan 20, 2026
3d90f0b
gapi_discovery: add function to get waveform info from discovery
kevlhop Jan 21, 2026
853fa46
gapi_waveform: build the response based on platform info
kevlhop Jan 21, 2026
5418119
gapi_discovery: replace malloc+strcat by asprintf
kevlhop Jan 21, 2026
4eba2c2
.github: add a ci on github to validate the api-mockup
kevlhop Jan 29, 2026
e3d7e08
ci-api-mockup: fix indentation
kevlhop Jan 29, 2026
eb21ee3
ci-api-mockup: build the application before linting
kevlhop Jan 29, 2026
05c67a7
gitmodules: change submodule URL to use HTTPS
kevlhop Jan 29, 2026
edddd76
src: add fflush to ensure they are printed immediately
kevlhop Mar 30, 2026
d614d65
api-mockup: update schema and MQTT topic structure
kevlhop Mar 30, 2026
9f612b4
.cqfd/Dockerfile: replace the default mirror to avoid timeouts
kevlhop Apr 17, 2026
1a29d46
gapi: handle disconnection and reconnection to broker
kevlhop Apr 16, 2026
c0c11c8
gapi_mosquitto: do not use clean session
kevlhop Apr 17, 2026
8663ebc
Dockerfile: update to ubuntu:26.04
kevlhop May 28, 2026
6179ddf
gapi: update GEISA schemas version
kevlhop May 26, 2026
67d212e
gapi: add a test application to validate the API calls
kevlhop May 28, 2026
8adfbdb
gapi_discovery: update discovery response following schemas updates
kevlhop May 28, 2026
897b8a5
README: update required dependencies following schemas update
kevlhop May 29, 2026
e5c383d
cqfd: add possibility to compile for arm64 architecture
kevlhop May 29, 2026
2ff2245
gapi: split discovery and manifest handlers into separate files
kevlhop May 29, 2026
70df14b
gapi_instantaneous: update instantaneous data with latest schemas
kevlhop May 29, 2026
b9f8020
gapi_waveform: update waveform with latest schemas
kevlhop May 29, 2026
af92c61
Makefile: avoid failing if nanopb/*.o doesn't exist
kevlhop Jun 3, 2026
3e42a05
gapi_discovery: add required sensor_id field to sensor descriptors
kevlhop Jun 3, 2026
9ae4e7d
gapi_instantaneous: initialize response with default values
kevlhop Jun 3, 2026
8dfa12e
gapi_waveform: do not free socket_path before message encoding
kevlhop Jun 22, 2026
ff33a66
gapi_waveform: add waveform thread to handle incoming connections
kevlhop Jun 22, 2026
b374db3
gapi_waveform: fix waveform socket cleanup in api_waveform_deinit()
kevlhop Jun 22, 2026
c9c62f5
gapi_discovery: add a second waveform for API mockup application
kevlhop Jun 22, 2026
45b9d6f
schemas: update schemas to the latest version
kevlhop Jun 24, 2026
0339a9a
gapi_waveform: add error messages to stderr when waveform request fails
kevlhop Jun 24, 2026
2cfc28e
src: add gapi_actuator skeleton
kevlhop Jun 24, 2026
0be958b
gapi_actuator: implement actuator get/set requests
kevlhop Jun 24, 2026
f5807d1
test: add a test application to send actuator get/set requests
kevlhop Jun 25, 2026
7b2153b
src: add sensor API support
kevlhop Jul 24, 2026
fc5ca3e
test: add test_app_sensor to test the sensor API
kevlhop Jul 24, 2026
2f2d8c8
sensor: add a not readable sensor
kevlhop Jul 24, 2026
3c50bb9
gapi_sensor: remove useless function arguments
kevlhop Jul 27, 2026
71a0fd7
Import GEISA API mockup history
swegener-rtp Jul 31, 2026
3c3d18e
Integrate GEISA API mockup into Community
swegener-rtp Jul 31, 2026
ae70b4e
Finalize API mockup Community migration
swegener-rtp Jul 31, 2026
30efe6b
Merge current Community main into API mockup migration..
swegener-rtp Jul 31, 2026
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@

# Wakaama ADM client mockup
/example-implementations/adm/lwm2m-client/wakaama/ @ndam-sfl @kevlhop @swegener-rtp

# GEISA API mockup
/example-implementations/api/api-mockup/ @kevlhop @swegener-rtp
56 changes: 56 additions & 0 deletions .github/workflows/api-mockup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: API mockup

on:
pull_request:
paths:
- "example-implementations/api/api-mockup/**"
- ".gitmodules"
- ".github/workflows/api-mockup.yml"
push:
branches:
- main
paths:
- "example-implementations/api/api-mockup/**"
- ".gitmodules"
- ".github/workflows/api-mockup.yml"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: example-implementations/api/api-mockup

steps:
- name: Check out Community
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install --yes \
build-essential \
clang-format \
clang-tidy \
libmosquitto-dev \
pkg-config \
protobuf-compiler \
python3-pip \
python3-venv

- name: Set up development environment
run: make setup-dev

- name: Build
run: |
make clean
make all

- name: Check formatting and lint
run: make lint
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "api-mockup-schemas"]
path = example-implementations/api/api-mockup/schemas
url = https://github.com/geisa/schemas.git
[submodule "api-mockup-nanopb"]
path = example-implementations/api/api-mockup/nanopb
url = https://github.com/nanopb/nanopb.git
[submodule "platforms/nxp-imx93-yocto/sources/poky"]
path = platforms/nxp-imx93-yocto/sources/poky
url = https://git.yoctoproject.org/poky
Expand Down
8 changes: 8 additions & 0 deletions example-implementations/api/api-mockup/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BasedOnStyle: llvm
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ContinuationIndentWidth: 8
BreakStringLiterals: false
2 changes: 2 additions & 0 deletions example-implementations/api/api-mockup/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Checks: 'readability-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,-cppcoreguidelines-avoid-non-const-global-variables,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling'
WarningsAsErrors: '*'
25 changes: 25 additions & 0 deletions example-implementations/api/api-mockup/.cqfd/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2025 Southern California Edison.

FROM ubuntu:26.04

ENV DEBIAN_FRONTEND=noninteractive

#To be removed when the issue with the default mirror is resolved.
RUN sed -i \
-e 's|http://archive.ubuntu.com/ubuntu|http://fr.archive.ubuntu.com/ubuntu|g' \
-e 's|http://security.ubuntu.com/ubuntu|http://fr.archive.ubuntu.com/ubuntu|g' \
/etc/apt/sources.list.d/ubuntu.sources

RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
clang-format \
clang-tidy \
libmosquitto-dev \
libprotobuf-c-dev \
pkg-config \
protobuf-compiler \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/
14 changes: 14 additions & 0 deletions example-implementations/api/api-mockup/.cqfdrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[project]
org='geisa'
name='api-mockup'

[build]
command='make setup-dev all'

[lint]
command='make setup-dev lint'

[build_arm64]
command='make setup-dev all'
docker_run_args='--platform linux/arm64'
docker_build_args='--platform linux/arm64'
2 changes: 2 additions & 0 deletions example-implementations/api/api-mockup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
.venv/
201 changes: 201 additions & 0 deletions example-implementations/api/api-mockup/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Loading
Loading