NubeIO / iot-engine

IoT Engine
5 stars 1 forks source link

Integrate GPIO functionalities #46

Open RaiBnod opened 5 years ago

RaiBnod commented 5 years ago

GPIO functionalities will be written on C/C++. And we need able to call that functions from Java for doing GPIO operations.

Parent ticket: #42

RaiBnod commented 5 years ago

Hello @Aidan275, as you already did some code on C for doing GPIO operation. Can you please share the code.

I have created just a base class for generating the JNI libraries for doing communication with native C on commit: https://github.com/NubeIO/iot-engine/commit/d72c5204f26825abbafdf17bd4ea08d5ed4972d4.

RaiBnod commented 5 years ago

Adding additional info:

BBBiO example: https://github.com/Aidan275/BBBiO Parent ticket: https://github.com/NubeIO/NubeEdge28/issues/1

RaiBnod commented 5 years ago

@Aidan275 I had forked your C++ code and did small changes https://github.com/RaiBnod/BBBiO for testing. And for Java JNI call, I had made a Java micro-service base https://github.com/NubeIO/iot-engine/commit/478e478095eb1d2cd1c0144c3ae46e47080dcd56, where we can generate native library. With the help of the native build library and that Java native functional interface we can able to communicate with C.

But currently, it only supports digital read/write operations. And still we following todo tasks to complete on C:

Could you please help me on this.

cooperbrindle commented 5 years ago

Additional Information

Prepare C/C++ code (SPI/PWM/GPIO of BBB) with APIs which can be called from Java (http://jonisalonen.com/2012/calling-c-from-java-is-easy)

Main functions needed at the moment are:

Resources:

zero88 commented 5 years ago

Java need to provide interface and build a header file then C++ implementation should be in https://github.com/NubeIO/BBBiO

zero88 commented 5 years ago

70