CANpie FD
CAN programming interface environment - Version 3.08
|
The QCanNetworkSettings provides the functionality to access parameters of a QCanNetwork.
Inherits QObject.
Signals | |
void | objectReceived (const CAN_Channel_e teChannelV, QJsonObject clNetworkSettingsV) |
Public Member Functions | |
QCanNetworkSettings (const CAN_Channel_e teChannelV=eCAN_CHANNEL_1, QObject *pclParentV=Q_NULLPTR) | |
void | connectToServer (const QHostAddress clServerAddressV=QHostAddress::LocalHost, const uint16_t uwPortV=QCAN_WEB_SOCKET_DEFAULT_PORT, const QString &clOriginR="", const uint32_t flags=0) |
void | closeConnection (void) |
int32_t | dataBitrate (void) |
QString | dataBitrateString (void) |
int32_t | errorCount (void) |
int32_t | frameCount (void) |
bool | isValid (void) |
QString | name (void) |
int32_t | nominalBitrate (void) |
QString | nominalBitrateString (void) |
void | reset (void) |
void | setBitrate (int32_t slNomBitRateV, int32_t slDatBitRateV=eCAN_BITRATE_NONE) |
void | setMode (const CAN_Mode_e teModeV) |
CAN_State_e | state (void) |
QString | stateString (void) |
QCanNetworkSettings::QCanNetworkSettings | ( | const CAN_Channel_e | teChannelV = eCAN_CHANNEL_1 , |
QObject * | pclParentV = Q_NULLPTR |
||
) |
[in] | teChannelV | - CAN channel |
[in] | pclParentV | - Pointer to QObject parent class |
Construct a QCanNetworkSettings object for the channel teChannelV.
void QCanNetworkSettings::closeConnection | ( | void | ) |
The method closes a WebSocket connection to a QCanNetwork class.
void QCanNetworkSettings::connectToServer | ( | const QHostAddress | clServerAddressV = QHostAddress::LocalHost , |
const uint16_t | uwPortV = QCAN_WEB_SOCKET_DEFAULT_PORT , |
||
const QString & | clOriginR = "" , |
||
const uint32_t | flags = 0 |
||
) |
[in] | clServerAddressV | - IPv4 or IPv6 address of QCanNetwork class |
[in] | uwPortV | - port number of QCanNetwork class |
[in] | clOriginR | - origin of the client |
[in] | flags | - reserved |
The method opens a WebSocket connection to a QCanNetwork class defined by clServerAddressV and uwPortV.
The origin of the client defined by clOriginR is as specified in RFC 6454. The origin is not required for non-web browser clients (see RFC 6455). The origin may not contain new line characters, otherwise the connection will be aborted immediately during the handshake phase.
int32_t QCanNetworkSettings::dataBitrate | ( | void | ) |
Return the current data bit-rate of the selected network in [bits/s]. If the bit-rate value is not valid (not configured) the function returns QCan::eCAN_BITRATE_NONE. The result of this function is equivalent to QCanNetwork::dataBitrate().
QString QCanNetworkSettings::dataBitrateString | ( | void | ) |
Return the current data bit-rate of the selected network as string object. If the bit-rate value is not valid (not configured) the function returns "None".
int32_t QCanNetworkSettings::errorCount | ( | void | ) |
Return the current data bit-rate of the selected network as string object. If the bit-rate value is not valid (not configured) the function returns "None".
int32_t QCanNetworkSettings::frameCount | ( | void | ) |
Return the current data bit-rate of the selected network as string object. If the bit-rate value is not valid (not configured) the function returns "None".
bool QCanNetworkSettings::isValid | ( | void | ) |
True
if valid data availableThe function returns True
if a connection has been established to a QCanNetwork and the received JSON data has a vaild format.
QString QCanNetworkSettings::name | ( | void | ) |
Return the name of the selected network as string object. If a CAN interface is attached to the network the function also returns the name of the CAN interface.
int32_t QCanNetworkSettings::nominalBitrate | ( | void | ) |
Return the current nominal bit-rate of the selected network in [bits/s]. If the bit-rate value is not valid (not configured) the function returns QCan::eCAN_BITRATE_NONE.
QString QCanNetworkSettings::nominalBitrateString | ( | void | ) |
Return the current nominal bit-rate of the selected network as string object. If the bit-rate value is not valid (not configured) the function returns "None".
|
signal |
[in] | teChannelV | - CAN channel |
[in] | clNetworkSettingsV | - JSON data |
This signal is emitted after a new object was received from a QCanNetwork instance. The JSON data has the following format:
void QCanNetworkSettings::reset | ( | void | ) |
Reset the network.
void QCanNetworkSettings::setBitrate | ( | int32_t | slNomBitRateV, |
int32_t | slDatBitRateV = eCAN_BITRATE_NONE |
||
) |
[in] | slNomBitRateV | Nominal bit-rate |
[in] | slDatBitRateV | Data bit-rate |
Set the bit-rate of the network.
void QCanNetworkSettings::setMode | ( | const CAN_Mode_e | teModeV | ) |
[in] | teModeV | Requested CAN mode |
Set the CAN mode of the network.
CAN_State_e QCanNetworkSettings::state | ( | void | ) |
QString QCanNetworkSettings::stateString | ( | void | ) |
Return the current CAN state of the selected network as string object.