Robox Library for Cpp: BCC/31 module 1.0.0
RLibCpp BCC/31 protocol implementation
Public Member Functions | Public Attributes | List of all members
OperationData Class Reference

The base operation data for all client operations. More...

#include <client.h>

Inheritance diagram for OperationData:
ErrorData AlarmHistoryClearData AlarmHistoryInfoData AlarmHistoryListData AlarmStackClearAllData AlarmStackClearData AlarmStackClearSpecData AlarmStackGetData AlarmStackInfoData AlarmStackListData BaseWriteVariableData CanC402InfoData CanEmcyReadData CanNmtReadData CanNmtWriteData CanObjReadData CanObjWriteData CanPdoReadData CanRbxChDiagData CanRbxWsDiagData DataLoadSequenceData DataSaveSequenceData DownloadSequenceData FbEcatNmtData FbEntryData FbIfData FbLoadFirmwareData FbNmtData FlashDirData FlashDiskBackpupData FlashDiskCreateData FlashDiskDeleteData FlashFileDeleteData FlashFileInfoData FlashFileLoadData FlashFileRenameData FlashFileSaveData FlashFolderCreateData FlashFolderDeleteData FlashFolderInfoData FlashFormatData FlashSetAttributesData PingData ReadVariableData ReleaseAllVariablesData ReleaseVariableData ReportCmdData ReportInfoData ReportListData SysReportCmdData SysReportInfoData SysReportListData SystemInfoData

Public Member Functions

void setState (uint64_t senderId, ActivityStates state, uint64_t data=0)
 Set the activity state.
 
void setProgress (uint64_t senderId, int32_t min, int32_t max, int32_t cur)
 Set the activity progress.
 
- Public Member Functions inherited from ErrorData
 ErrorData ()
 Class contructor.
 
void setErrorFromMessage (Message *src)
 Set error information from a source message.
 
void clearError ()
 Clear the error information.
 
void setError (Message::ErrCodes errCode)
 Set the error information.
 
void setError (Message::ErrCodes errCode, uint16_t errExtra)
 Set the error information.
 
Message::ErrCodes nackErrCode () const
 Get the received NACK error code : if the value equals Message::errCodesNoError then no NACK message was received.
 
uint16_t nackErrExtra () const
 Get the optional error extra data of the last NACK message received from the remote device.
 

Public Attributes

Signal3< uint64_t, ActivityStates, uint64_t > stateChanged
 Signal emitted when the state of the operation changes.
 
Signal4< uint64_t, int32_t, int32_t, int32_t > progressChanged
 Signal emitted when the progress of the operation changes.
 

Additional Inherited Members

- Protected Member Functions inherited from ErrorData
void setNackErrCode (Message::ErrCodes value)
 Set the received NACK error code : if the value equals Message::errCodesNoError then no NACK message was received.
 
void setNackErrExtra (uint16_t value)
 Set the optional error extra data of the last NACK message received from the remote device.
 
uint16_t nackErrFlags () const
 Get the error information validity flags.
 
void setNackErrFlags (uint16_t value)
 Set the error information validity flags.
 

Detailed Description

The base operation data for all client operations.

Example of use of state changed and progress changed events:

// Request method
void LoadMyTask1(Client *client)
{
// Prepare the command to load a task into a flash
data.setSource("C:\\Local\\MyTask1.elf");
data.setTarget("/fa/mytask1.elf");
data.stateChanged.connect(stateChanged);
// or if event handler are non static member function of class (e.g. MyClass *obj)
// data.progressChanged.connect(obj, &MyClass::progressChanged);
// data.stateChanged.connect(obj, &MyClass::stateChanged);
// Execute the command
if (client->flashFileLoad(data) == Globals::resSuccess)
{
// ...
}
}
// Call back for the progress changed event
void progressChanged(uint64_t senderId, int32_t min, int32_t max, int32_t cur)
{
// ...
}
// Call back for the state changed event
stateChanged(uint64_t senderId, RLibCpp::Bcc::ClientStruct::ActivityStates state, uint64_t param)
{
// ...
}
Communication client declaration.
Definition client.h:4639
Globals::Results flashFileLoad(ClientStruct::FlashFileLoadData &data)
Load a file to the flash of the connected device.
The data for the flashFileLoad method.
Definition client.h:915
void setFlags(Flagss value)
Set the operation flags. [IN].
void setSource(String value)
Set the source file name. [IN].
void setTarget(String value)
Set the target file name. [IN].
@ fOverwrite
Overwrite target file.
Definition client.h:930
Signal3< uint64_t, ActivityStates, uint64_t > stateChanged
Signal emitted when the state of the operation changes.
Definition client.h:267
Signal4< uint64_t, int32_t, int32_t, int32_t > progressChanged
Signal emitted when the progress of the operation changes.
Definition client.h:276
@ resSuccess
The operation completed successfully.
Definition globals.h:39
ActivityStates
The available operation states.
Definition client.h:65

Member Function Documentation

◆ setProgress()

void setProgress ( uint64_t senderId,
int32_t min,
int32_t max,
int32_t cur )

Set the activity progress.

Parameters
senderIdThe identifier of the object firing the event
minMinimum progress value.
maxMaximum progress value.
curCurrent progress value.

◆ setState()

void setState ( uint64_t senderId,
ActivityStates state,
uint64_t data = 0 )

Set the activity state.

Parameters
senderIdThe identifier of the object firing the event
stateThe activity state string.
dataOptional data for state

Member Data Documentation

◆ progressChanged

Signal4<uint64_t, int32_t, int32_t, int32_t> progressChanged

Signal emitted when the progress of the operation changes.

Parameters
senderIdThe identifier of the object firing the event
minMinimum progress value.
maxMaximum progress value.
curCurrent progress value.

◆ stateChanged

Signal3<uint64_t, ActivityStates, uint64_t> stateChanged

Signal emitted when the state of the operation changes.

Parameters
senderIdThe identifier of the object firing the event
stateThe activity state string
dataOptional data for state