Communication interface using a TCP/IP socket.
More...
#include <SocketInterface.hpp>
|
| | SocketInterface (const std::string &ip="192.168.100.100", int port=9004) |
| | Open a TCP socket connection to the scanner.
|
| |
| | ~SocketInterface () override |
| |
| std::string | describe () const override |
| | Return a human-readable description of this interface.
|
| |
| void | startFtpServer (const std::string &address, int port, const std::string &mountPoint, int threadPoolSize=4) |
| | Start a local FTP server for receiving data from the scanner.
|
| |
| | ~AsioInterface () override=default |
| |
| std::string | sendCommand (const std::string &command) override |
| | Sends a command over the Asio stream and reads the response.
|
| |
| std::string | sendCommandUnlocked (const std::string &command) override |
| | Sends a command without acquiring the communication mutex.
|
| |
| virtual | ~ICommInterface ()=default |
| |
| void | setCommFormat (CommFormat format) |
| | Set the communication framing format.
|
| |
| CommFormat | getCommFormat () |
| | Get the current communication framing format.
|
| |
|
| std::string | ip |
| | Scanner IP address.
|
| |
| int | port |
| | Scanner command port.
|
| |
| std::unique_ptr< fineftp::FtpServer > | pFtpServer = nullptr |
| | FTP server instance (heap-allocated because FtpServer is non-copyable).
|
| |
Communication interface using a TCP/IP socket.
Connects to the scanner's Ethernet command port via Asio TCP socket.
◆ SocketInterface()
| OpenSRX::SocketInterface::SocketInterface |
( |
const std::string & | ip = "192.168.100.100", |
|
|
int | port = 9004 ) |
Open a TCP socket connection to the scanner.
- Parameters
-
| ip | Scanner IP address (e.g. "192.168.100.100"). |
| port | Scanner command port (default 9004). |
◆ ~SocketInterface()
| OpenSRX::SocketInterface::~SocketInterface |
( |
| ) |
|
|
override |
◆ describe()
| std::string OpenSRX::SocketInterface::describe |
( |
| ) |
const |
|
inlineoverridevirtual |
Return a human-readable description of this interface.
- Returns
- e.g. "/dev/ttyUSB0" or "192.168.1.100:9004".
Implements OpenSRX::ICommInterface.
◆ startFtpServer()
| void OpenSRX::SocketInterface::startFtpServer |
( |
const std::string & | address, |
|
|
int | port, |
|
|
const std::string & | mountPoint, |
|
|
int | threadPoolSize = 4 ) |
Start a local FTP server for receiving data from the scanner.
- Parameters
-
| address | Local address to bind to. |
| port | FTP port to listen on. |
| mountPoint | Local filesystem path to serve. |
| threadPoolSize | Number of FTP server threads. |
◆ ip
| std::string OpenSRX::SocketInterface::ip |
|
private |
◆ pFtpServer
| std::unique_ptr<fineftp::FtpServer> OpenSRX::SocketInterface::pFtpServer = nullptr |
|
private |
FTP server instance (heap-allocated because FtpServer is non-copyable).
◆ port
| int OpenSRX::SocketInterface::port |
|
private |
The documentation for this class was generated from the following file: