CanBusFactory
Source locationmrx/can/CanBusFactory.hpp
Enumerates SocketCAN interfaces and creates caller-owned bus proxies.
The factory validates interface names using Qt SerialBus and never connects a device as part of creation. The returned proxy is owned by its QObject parent, if provided, or by the caller otherwise.
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
QStringList | availableInterfaces static | Returns the SocketCAN interface names currently available to Qt. |
CanBusProxy* | create static | Creates a disconnected proxy for an available SocketCAN interface. |
static
availableInterfaces
Section titled “availableInterfaces”Source locationmrx/can/CanBusFactory.hpp
Returns the SocketCAN interface names currently available to Qt.
Returns
Section titled “Returns”Available interface names in Qt SerialBus enumeration order.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
errorMessage | QString* | Receives a backend error when enumeration fails. |
static
create
Section titled “create”Source locationmrx/can/CanBusFactory.hpp
Creates a disconnected proxy for an available SocketCAN interface.
Returns
Section titled “Returns”A disconnected proxy, or nullptr if validation or device creation fails.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
interfaceName | const QString& | Exact interface name returned by availableInterfaces(). |
parent | QObject* | Optional QObject owner for the returned proxy. |
errorMessage | QString* | Receives an explanatory error if creation fails. |