Encoders and decoders for the ISO 22133 communication protocol.
Navigate to the project directory and create a build directory. Then run cmake and finally build the project:
mkdir build && cd build
cmake ..
make
Install the compilers
sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
Change to the build directory, then compile and build with the toolchain
cmake .. -DCMAKE_TOOLCHAIN_FILE=../Toolchain_arm.cmake
make
After building the project, run
make test
To use the encoders and decoders in other languages than C/C++, use the below procedure
- Install swig by downloading swig from their webpage, the download should include a pre-compiled build for windows.
- Add the path to the pre-compiled swig.exe file that you downloaded to path variabel in system enviroment.
- Download a C/C++ compiler such as Visual Studio(_MSC_VER) or MinGW (preferable 64bit,GNUC, MINGW32 ).
- Add the path to the downloaded pre-compiled compiler to system enviroment in windows path variabel.
- Test that you can access swig run in cmd.
This will give you version number of your swig etc.
swig -version
- Test you compiler by running the command to run the compiler, this will be different depending on your compiler.
On MinGW:
This will give output for the MinGW compiler.
g++ --version
- Start your python virtual environment or use your base environment at your own risk.
- Start terminal and move to iso22133 folder to the setup.py file folder.
- Run the following command(It will build the python extension):
python setup.py build_ext
- Now install the extension to your python virtual enviroment or add the generated .pyd (i think) file to your path in system enviroment.
- For installation run in terminal:
python setup.py install
- First install SWIG run:
sudo apt install swig
In the build directory, remove old content, if needed, then:
cmake -DWITH_SWIG=TRUE -DSWIG_WITH_PYTHON=TRUE ..
make
If you want it installed on the local machine:
sudo make install
-
Make sure you have Java JDK is installed.
-
Make sure the iso22133.i file includes the line %javaconst(1)
-
Run the following command which will create all the necessary java files.
swig -java iso22133.i
-
Compile using. ((Pick jdk applicaple to your machine))
gcc -fPIC -Wall -c positioning.c iso22133.c iso22133_wrap.c -I/usr/lib/jvm/jdk-15.0.2/include/ -I/usr/lib/jvm/jdk-15.0.2/include/linux/
-
Create .so file
gcc -shared positioning.o iso22133_wrap.o iso22133.o -o libiso22133.so
-
Copy your .so file to your other JNI libs or add the current folder to the path using:
export LD_LIBRARY_PATH=. #ksh
-
You should now be able to use this to create and compile a simple java test program such as this:
public class isotest { static { System.loadLibrary("iso22133"); } public static void main(String argv[]) { timeval heabTime = new timeval(); System.out.println(ControlCenterStatusType.CONTROL_CENTER_STATUS_ABORT); iso22133 iso = new iso22133(); iso.encodeHEABMessage(heabTime, ControlCenterStatusType.CONTROL_CENTER_STATUS_RUNNING, "datatadatadata", 22, '1'); } }