To create an application using API-CAN(LNX), create the application as follows for each language.
Please do not edit the header file and definition module.
■gcc
・Copy the API-CAN(LNX) C header file (ccan/samples/inc/ccan.h) to the directory containing the program to be created.
・Include the header file in the source code.
Description example :
#include "ccan.h"
・Link with the linker option at compile time.
Description example :
gcc -Wall filename.c -o
filename -lccan
~~~~~~
For more information, please refer to the sample program source code, Makefile, and so on.
■Python
Module include
・External function library module
To call the functions in our shared library with Python program, the external function library module (ctypes) is required.
Therefore, import the external function library module in the source code.
Description example :
import ctypes
・API-CAN(LNX) definition module
To use the API-CAN(LNX) functions in Python, the ccan.py file is required.
Copy the API-CAN(LNX) definition module (ccan/samples/inc/ccan.py) to the directory containing the program to be created.
Import the API-CAN(LNX) definition module in the source code.
Description example :
import ccan
Program execution
The description for executing program is as follows.
Description example (When executing the can_communication sample in Python3.10) :
python3.10 can_communication.py
For more information, please refer to the sample program source code.