34
—
SOFTWARE
GENERAL MANUAL — SEP 8, 2022 — RELEASE: V1.0.2
•
•
•
•
•
•
•
•
6.3 C++ API library
6.3.1 qbdevice C/C++ API v6
6.3.2 Installation
To install all the requirements for your specific operating system, please refer to
To compile the C/C++ API library:
open a terminal (for Linux and macOS users), or the command prompt (for Windows users);
navigate to the
"src"
directory inside the downloaded package;
execute the
"make"
command.
Under
"lib_unix"
or
"lib_win"
directory you will find the newly created static
library
"libqbmove_comm.a"
that can be linked in your own application.
Basic functions
In most cases these are all the necessary functions to integrate the
qb SoftHand2 Research
within
your
system.
int RS485ListPorts(char **serial_ports)
: retrieves all the serial ports connected to the
system, returns their number, and fills the given argument with the connected serial port names;
void openRS485(comm_settings *file_descriptor, const char *serial_port)
: opens the
serial communication by acquiring the serial port resource and sets the given file descriptor
accordingly;
void closeRS485(comm_settings *file_descriptor)
: closes the serial communication and
frees the serial resource;
void commActivate(comm_settings *file_descriptor, int device_id, char activate)
:
activates (or deactivates) the motor on the
qb SoftHand2
with the given id, respectively if
"activate"
is
"0x03"
(or
"0x00"
);
int commGetActivate(comm_settings *file_descriptor, int device_id, char
*activate)
: fills
"activate"
with the activation status of the motor on the
qb SoftHand2
with the
given id, and returns 0 on success;
NOTE:
Do not forget to include the
"qbmove_communications.h"
when linking the API library in
your project.
Содержание SoftHand2 Research
Страница 4: ...8 5 The USB flash drive is not working 44...