doc groups
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
/*! \file pibinarylog.h
|
||||
* \brief Binary log
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Binary log
|
||||
* \~russian Бинарный лог
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Class for write binary data to logfile, and read or playback this data
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file pican.h
|
||||
* \brief CAN device
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english CAN device
|
||||
* \~russian Устройство CAN
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
CAN
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file piconfig.h
|
||||
* \brief Configuration parser and writer
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Configuration files parser and writer
|
||||
* \~russian Разбор и запись конфигурационных файлов
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Configuration parser and writer
|
||||
@@ -330,7 +333,7 @@ public:
|
||||
bool open(const PIString & path, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite);
|
||||
|
||||
//! Read configuration string "string" in mode "mode"
|
||||
bool open(PIString * string, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite);\
|
||||
bool open(PIString * string, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite);
|
||||
|
||||
bool isOpened() const;
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file pidir.h
|
||||
* \brief Local directory
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Local directory
|
||||
* \~russian Локальная директория
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Directory
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file piethernet.h
|
||||
* \brief Ethernet device
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Ethernet device
|
||||
* \~russian Устройство Ethernet
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Ethernet, UDP/TCP Broadcast/Multicast
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file pifile.h
|
||||
* \brief Local file
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Local file
|
||||
* \~russian Локальный файл
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
File
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
/*! \file pigpio.h
|
||||
* \brief GPIO
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english GPIO
|
||||
* \~russian GPIO
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file piiobytearray.h
|
||||
* \brief PIIODevice wrapper around PIByteArray
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english PIIODevice wrapper around PIByteArray
|
||||
* \~russian Обертка PIIODevice вокруг PIByteArray
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PIIODevice wrapper around PIByteArray
|
||||
|
||||
@@ -23,95 +23,101 @@
|
||||
#include "pipropertystorage.h"
|
||||
|
||||
|
||||
/*! \class PIIODevice
|
||||
* \brief Base class for input/output classes
|
||||
*
|
||||
* \section PIIODevice_sec0 Synopsis
|
||||
* This class provide open/close logic, threaded read/write and virtual input/output
|
||||
* functions \a read() and \a write(). You should implement pure virtual
|
||||
* function \a openDevice() in your subclass.
|
||||
*
|
||||
* \section PIIODevice_sec1 Open and close
|
||||
* PIIODevice have boolean variable indicated open status. Returns of functions
|
||||
* \a openDevice() and \a closeDevice() change this variable.
|
||||
*
|
||||
* \section PIIODevice_sec2 Threaded read
|
||||
* PIIODevice based on PIThread, so it`s overload \a run() to exec \a read()
|
||||
* in background thread. If read is successful virtual function \a threadedRead()
|
||||
* is executed. Default implementation of this function execute external static
|
||||
* function set by \a setThreadedReadSlot() with data set by \a setThreadedReadData().
|
||||
* Extrenal static function should have format \n
|
||||
* bool func_name(void * Threaded_read_data, uchar * readed_data, int readed_size)\n
|
||||
* Threaded read starts with function \a startThreadedRead().
|
||||
*
|
||||
* \section PIIODevice_sec3 Threaded write
|
||||
* PIIODevice aggregate another PIThread to perform a threaded write by function
|
||||
* \a writeThreaded(). This function add task to internal queue and return
|
||||
* queue entry ID. You should start write thread by function \a startThreadedWrite.
|
||||
* On successful write event \a threadedWriteEvent is raised with two arguments -
|
||||
* task ID and written bytes count.
|
||||
*
|
||||
* \section PIIODevice_sec4 Internal buffer
|
||||
* PIIODevice have internal buffer for threaded read, and \a threadedRead() function
|
||||
* receive pointer to this buffer in first argument. You can adjust size of this buffer
|
||||
* by function \a setThreadedReadBufferSize() \n
|
||||
* Default size of this buffer is 4096 bytes.
|
||||
*
|
||||
* \section PIIODevice_sec5 Reopen
|
||||
* When threaded read is begin its call \a open() if device is closed. While threaded
|
||||
* read running PIIODevice check if device opened every read and if not call \a open()
|
||||
* every reopen timeout if reopen enabled. Reopen timeout is set by \a setReopenTimeout(),
|
||||
* reopen enable is set by \a setReopenEnabled().
|
||||
*
|
||||
* \section PIIODevice_sec6 Configuration
|
||||
* This is virtual function \a configureDevice() which executes when \a configure()
|
||||
* executes. This function takes two arguments: "e_main" and "e_parent" as void*. There
|
||||
* are pointers to PIConfig::Entry entries of section "section" and their parent. If
|
||||
* there is no parent "e_parent" = 0. Function \a configure() set three parameters of
|
||||
* device: "reopenEnabled", "reopenTimeout" and "threadedReadBufferSize", then execute
|
||||
* function \a configureDevice().
|
||||
* \n Each ancestor of %PIIODevice reimlements \a configureDevice() function to be able
|
||||
* to be confured from configuration file. This parameters described at section
|
||||
* "Configurable parameters" in the class reference. \n Usage example:
|
||||
* \snippet piiodevice.cpp configure
|
||||
* Implementation example:
|
||||
* \snippet piiodevice.cpp configureDevice
|
||||
*
|
||||
* \section PIIODevice_sec7 Creating devices by unambiguous string
|
||||
* There are some virtual functions to describe child class without its declaration.
|
||||
* \n \a fullPathPrefix() should returns unique prefix of device
|
||||
* \n \a constructFullPath() should returns full unambiguous string, contains prefix and all device parameters
|
||||
* \n \a configureFromFullPath() provide configuring device from full unambiguous string without prefix and "://"
|
||||
* \n Macro PIIODEVICE should be used instead of PIOBJECT
|
||||
* \n Macro REGISTER_DEVICE should be used after definition of class, i.e. at the last line of *.cpp file
|
||||
* \n \n If custom I/O device corresponds there rules, it can be returned by function \a createFromFullPath().
|
||||
* \n Each PIP I/O device has custom unambiguous string description:
|
||||
* * PIFile: "file://<path>"
|
||||
* * PIBinaryLog: "binlog://<logDir>[:<filePrefix>][:<defaultID>]"
|
||||
* * PISerial: "ser://<device>:<speed(50|...|115200)>[:<dataBitsCount(6|7|8)>][:<parity(N|E|O)>][:<stopBits(1|2)>]"
|
||||
* * PIEthernet: UDP "eth://UDP:<readIP>:<readPort>:<sendIP>:<sendPort>[:<multicast(mcast:<ip>)>]"
|
||||
* * PIEthernet: TCP "eth://TCP:<IP>:<Port>"
|
||||
* * PIUSB: "usb://<vid>:<pid>[:<deviceNumber>][:<readEndpointNumber>][:<writeEndpointNumber>]"
|
||||
* \n \n Examples:
|
||||
* * PIFile: "file://../text.txt"
|
||||
* * PIBinaryLog: "binlog://../logs/:mylog_:1"
|
||||
* * PISerial: "ser:///dev/ttyUSB0:9600:8:N:1", equivalent "ser:///dev/ttyUSB0:9600"
|
||||
* * PIEthernet: "eth://TCP:127.0.0.1:16666", "eth://UDP:192.168.0.5:16666:192.168.0.6:16667:mcast:234.0.2.1:mcast:234.0.2.2"
|
||||
* * PIUSB: "usb://0bb4:0c86:1:1:2"
|
||||
* \n \n
|
||||
* So, custom I/O device can be created with next call:
|
||||
* \code{cpp}
|
||||
* // creatring devices
|
||||
* PISerial * ser = (PISerial * )PIIODevice::createFromFullPath("ser://COM1:115200");
|
||||
* PIEthernet * eth = (PIEthernet * )PIIODevice::createFromFullPath("eth://UDP:127.0.0.1:4001:127.0.0.1:4002");
|
||||
* // examine devices
|
||||
* piCout << ser << ser->properties();
|
||||
* piCout << eth << eth->properties();
|
||||
* \endcode
|
||||
*
|
||||
* \section PIIODevice_ex0 Example
|
||||
* \snippet piiodevice.cpp 0
|
||||
*/
|
||||
//! \addtogroup IO
|
||||
//! \{
|
||||
//! \class PIIODevice piiodevice.h
|
||||
//! \brief
|
||||
//! \~english Base class for input/output classes
|
||||
//! \~russian Базовый класс утройств ввода/вывода
|
||||
//!
|
||||
//! \~\details
|
||||
//! \section PIIODevice_sec0 Synopsis
|
||||
//! This class provide open/close logic, threaded read/write and virtual input/output
|
||||
//! functions \a read() and \a write(). You should implement pure virtual
|
||||
//! function \a openDevice() in your subclass.
|
||||
//!
|
||||
//! \section PIIODevice_sec1 Open and close
|
||||
//! PIIODevice have boolean variable indicated open status. Returns of functions
|
||||
//! \a openDevice() and \a closeDevice() change this variable.
|
||||
//!
|
||||
//! \section PIIODevice_sec2 Threaded read
|
||||
//! PIIODevice based on PIThread, so it`s overload \a run() to exec \a read()
|
||||
//! in background thread. If read is successful virtual function \a threadedRead()
|
||||
//! is executed. Default implementation of this function execute external static
|
||||
//! function set by \a setThreadedReadSlot() with data set by \a setThreadedReadData().
|
||||
//! Extrenal static function should have format \n
|
||||
//! bool func_name(void * Threaded_read_data, uchar * readed_data, int readed_size)\n
|
||||
//! Threaded read starts with function \a startThreadedRead().
|
||||
//!
|
||||
//! \section PIIODevice_sec3 Threaded write
|
||||
//! PIIODevice aggregate another PIThread to perform a threaded write by function
|
||||
//! \a writeThreaded(). This function add task to internal queue and return
|
||||
//! queue entry ID. You should start write thread by function \a startThreadedWrite.
|
||||
//! On successful write event \a threadedWriteEvent is raised with two arguments -
|
||||
//! task ID and written bytes count.
|
||||
//!
|
||||
//! \section PIIODevice_sec4 Internal buffer
|
||||
//! PIIODevice have internal buffer for threaded read, and \a threadedRead() function
|
||||
//! receive pointer to this buffer in first argument. You can adjust size of this buffer
|
||||
//! by function \a setThreadedReadBufferSize() \n
|
||||
//! Default size of this buffer is 4096 bytes.
|
||||
//!
|
||||
//! \section PIIODevice_sec5 Reopen
|
||||
//! When threaded read is begin its call \a open() if device is closed. While threaded
|
||||
//! read running PIIODevice check if device opened every read and if not call \a open()
|
||||
//! every reopen timeout if reopen enabled. Reopen timeout is set by \a setReopenTimeout(),
|
||||
//! reopen enable is set by \a setReopenEnabled().
|
||||
//!
|
||||
//! \section PIIODevice_sec6 Configuration
|
||||
//! This is virtual function \a configureDevice() which executes when \a configure()
|
||||
//! executes. This function takes two arguments: "e_main" and "e_parent" as void*. There
|
||||
//! are pointers to PIConfig::Entry entries of section "section" and their parent. If
|
||||
//! there is no parent "e_parent" = 0. Function \a configure() set three parameters of
|
||||
//! device: "reopenEnabled", "reopenTimeout" and "threadedReadBufferSize", then execute
|
||||
//! function \a configureDevice().
|
||||
//! \n Each ancestor of %PIIODevice reimlements \a configureDevice() function to be able
|
||||
//! to be confured from configuration file. This parameters described at section
|
||||
//! "Configurable parameters" in the class reference. \n Usage example:
|
||||
//! \snippet piiodevice.cpp configure
|
||||
//! Implementation example:
|
||||
//! \snippet piiodevice.cpp configureDevice
|
||||
//!
|
||||
//! \section PIIODevice_sec7 Creating devices by unambiguous string
|
||||
//! There are some virtual functions to describe child class without its declaration.
|
||||
//! \n \a fullPathPrefix() should returns unique prefix of device
|
||||
//! \n \a constructFullPath() should returns full unambiguous string, contains prefix and all device parameters
|
||||
//! \n \a configureFromFullPath() provide configuring device from full unambiguous string without prefix and "://"
|
||||
//! \n Macro PIIODEVICE should be used instead of PIOBJECT
|
||||
//! \n Macro REGISTER_DEVICE should be used after definition of class, i.e. at the last line of *.cpp file
|
||||
//! \n \n If custom I/O device corresponds there rules, it can be returned by function \a createFromFullPath().
|
||||
//! \n Each PIP I/O device has custom unambiguous string description:
|
||||
//! * PIFile: "file://<path>"
|
||||
//! * PIBinaryLog: "binlog://<logDir>[:<filePrefix>][:<defaultID>]"
|
||||
//! * PISerial: "ser://<device>:<speed(50|...|115200)>[:<dataBitsCount(6|7|8)>][:<parity(N|E|O)>][:<stopBits(1|2)>]"
|
||||
//! * PIEthernet: UDP "eth://UDP:<readIP>:<readPort>:<sendIP>:<sendPort>[:<multicast(mcast:<ip>)>]"
|
||||
//! * PIEthernet: TCP "eth://TCP:<IP>:<Port>"
|
||||
//! * PIUSB: "usb://<vid>:<pid>[:<deviceNumber>][:<readEndpointNumber>][:<writeEndpointNumber>]"
|
||||
//! \n \n Examples:
|
||||
//! * PIFile: "file://../text.txt"
|
||||
//! * PIBinaryLog: "binlog://../logs/:mylog_:1"
|
||||
//! * PISerial: "ser:///dev/ttyUSB0:9600:8:N:1", equivalent "ser:///dev/ttyUSB0:9600"
|
||||
//! * PIEthernet: "eth://TCP:127.0.0.1:16666", "eth://UDP:192.168.0.5:16666:192.168.0.6:16667:mcast:234.0.2.1:mcast:234.0.2.2"
|
||||
//! * PIUSB: "usb://0bb4:0c86:1:1:2"
|
||||
//! \n \n
|
||||
//! So, custom I/O device can be created with next call:
|
||||
//! \code{cpp}
|
||||
//! // creatring devices
|
||||
//! PISerial * ser = (PISerial * )PIIODevice::createFromFullPath("ser://COM1:115200");
|
||||
//! PIEthernet * eth = (PIEthernet * )PIIODevice::createFromFullPath("eth://UDP:127.0.0.1:4001:127.0.0.1:4002");
|
||||
//! // examine devices
|
||||
//! piCout << ser << ser->properties();
|
||||
//! piCout << eth << eth->properties();
|
||||
//! \endcode
|
||||
//!
|
||||
//! \section PIIODevice_ex0 Example
|
||||
//! \snippet piiodevice.cpp 0
|
||||
//!
|
||||
//! \}
|
||||
|
||||
|
||||
PIMutex PIIODevice::nfp_mutex;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file piiodevice.h
|
||||
* \brief Abstract input/output device
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Abstract input/output device
|
||||
* \~russian Базовый класс утройств ввода/вывода
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Abstract input/output device
|
||||
|
||||
@@ -16,6 +16,38 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
//! \defgroup IO
|
||||
//! \~\brief
|
||||
//! \~english Input/output devices.
|
||||
//! \~russian Устройства ввода/вывода.
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english \section cmake_module Building with CMake
|
||||
//! \~russian \section cmake_module Сборка с использованием CMake
|
||||
//!
|
||||
//! \code
|
||||
//! find_package(PIP REQUIRED)
|
||||
//! target_link_libraries([target] PIP)
|
||||
//! \endcode
|
||||
//!
|
||||
//! \~english \par Common
|
||||
//! \~russian \par Общее
|
||||
//!
|
||||
//! \~english
|
||||
//! These files provides base IO device, many realizations and utilites to work with %PIIODevice
|
||||
//!
|
||||
//! \~russian
|
||||
//! Эти файлы обеспечивают базовый класс устройства ввода/вывода, много реализаций и утилит
|
||||
//! для работы с %PIIODevice
|
||||
//!
|
||||
//! \~\authors
|
||||
//! \~english
|
||||
//! Ivan Pelipenko peri4ko@yandex.ru;
|
||||
//! Andrey Bychkov work.a.b@yandex.ru;
|
||||
//! \~russian
|
||||
//! Иван Пелипенко peri4ko@yandex.ru;
|
||||
//! Андрей Бычков work.a.b@yandex.ru;
|
||||
//!
|
||||
|
||||
#ifndef PIIODEVICESMODULE_H
|
||||
#define PIIODEVICESMODULE_H
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file piiostring.h
|
||||
* \brief PIIODevice wrapper around PIString
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english PIIODevice wrapper around PIString
|
||||
* \~russian Обертка PIIODevice вокруг PIString
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PIIODevice wrapper around PIString
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file pipeer.h
|
||||
* \brief Peering net node
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Peering net node
|
||||
* \~russian Элемент пиринговой сети
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Peer - named I/O ethernet node, forming self-organized peering network
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file piserial.h
|
||||
* \brief Serial device
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Serial device
|
||||
* \~russian Последовательный порт
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
COM
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file pisharedmemory.h
|
||||
* \brief Shared memory
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Shared memory
|
||||
* \~russian Разделяемая память
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Shared Memory
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file pispi.h
|
||||
* \brief SPI device
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english SPI device
|
||||
* \~russian Устройство SPI
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
SPI
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file pitransparentdevice.h
|
||||
* \brief PIIODevice that pass write to read
|
||||
*/
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english PIIODevice that pass write to read
|
||||
* \~russian PIIODevice который транслирует запись на чтение
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PIIODevice that pass write to read
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/*! \file piusb.h
|
||||
* \brief USB device
|
||||
*/
|
||||
* \ingroup USB
|
||||
* \~\brief
|
||||
* \~english USB device
|
||||
* \~russian Устройство USB
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
USB, based on libusb
|
||||
@@ -19,6 +22,37 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
//! \defgroup USB
|
||||
//! \~\brief
|
||||
//! \~english USB support via libusb
|
||||
//! \~russian Поддержка USB с помощью libusb
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english \section cmake_module Building with CMake
|
||||
//! \~russian \section cmake_module Сборка с использованием CMake
|
||||
//!
|
||||
//! \code
|
||||
//! find_package(PIP REQUIRED)
|
||||
//! target_link_libraries([target] PIP::USB)
|
||||
//! \endcode
|
||||
//!
|
||||
//! \~english \par Common
|
||||
//! \~russian \par Общее
|
||||
//!
|
||||
//! \~english
|
||||
//! These files provides works with raw USB device
|
||||
//!
|
||||
//! \~russian
|
||||
//! Эти файлы обеспечивают работу с сырым USB устройством
|
||||
//!
|
||||
//! \~\authors
|
||||
//! \~english
|
||||
//! Ivan Pelipenko peri4ko@yandex.ru;
|
||||
//! Andrey Bychkov work.a.b@yandex.ru;
|
||||
//! \~russian
|
||||
//! Иван Пелипенко peri4ko@yandex.ru;
|
||||
//! Андрей Бычков work.a.b@yandex.ru;
|
||||
//!
|
||||
|
||||
#ifndef PIUSB_H
|
||||
#define PIUSB_H
|
||||
|
||||
Reference in New Issue
Block a user