BPNGClientLib
Library for accessing the Telemotive data logger devices
Public Member Functions | List of all members
BPNGLoggerDetector Class Reference
Inheritance diagram for BPNGLoggerDetector:
IBPNGClientListener

Public Member Functions

template<typename IP >
 BPNGLoggerDetector (IP &&_ip, unsigned int _debug)
 CTOR.
 
virtual void onBPNGDeviceDetected (OnlineLoggerInfo *info)
 Called to notify a detected logger in network. More...
 
virtual void onBPNGDeviceDisappeared (OnlineLoggerInfo *info)
 Called to notify a disappeared logger. More...
 
virtual void onBPNGDeviceStateChange (OnlineLoggerInfo *info)
 Called to notify a logger's state change. More...
 
virtual int onProgressDataDownload (int percentCompleted)
 Called to indicate the current progress of a data transfer. More...
 
virtual int onProgressDataDownload (int percentCompleted, uint64_t downloadedSize, uint64_t totalSize)
 Called to indicate the current progress of a data transfer. More...
 
virtual int onProgressConversion (int percentCompleted, const char *status)
 Called to indicate the current progress of file conversion. More...
 
virtual int onProgressDeletion (int percentCompleted)
 Called to indicate the current progress of file deletion. More...
 
virtual int onTargetPathTooLong (char *newTarget, int maxSize)
 Called on a too long target directory. More...
 
virtual int getOverwritingPermission (const char *filePath)
 Called on existing output trace files. More...
 
virtual void onFirmwareUpdateProgress (int percentage, int step, int substep, const char *desc)
 Called on firmware update progress.
 
virtual void onFirmwareUpdateError (int errorId)
 
virtual int onCriticalDiskSpace (uint64_t freeSpace, uint64_t neededSpace, const char *drive, const char *msg)
 Called in case of not enough free diskspace. More...
 
virtual void onLoggerConnected (bool isConnected)
 
virtual void onStatusMessage (const char *statusMsg)
 Called to send additional information of the current process to the calling app. More...
 
virtual int onGetLogReportProgress (int percentage, const char *desc)
 
virtual void onWarning (BPNGWarningCode warningCode, const char *warnMsg)
 Called to inform about a warning. More...
 
virtual void onInvalidPwConfigFound (const char *)
 
virtual void onDownloadStart (int64_t totalAmountOfBytes)
 Notifies the listeners before the download starts about the total amount of bytes to be downloaded. More...
 
virtual void onLogInDataFailed ()
 
virtual void onResetLogInDataFailed ()
 
virtual void onFuncAccessDenied ()
 
virtual void onConversionStart (int64_t totalAmountOfBytes)
 Notifies the listeners before the conversion starts about the total amount of bytes to be converted. More...
 
virtual int onDataRecoverProgress (const char *test1, int test2)
 Called to send additional information of the current data recovery progress. More...
 
virtual const char * onLogInDataRequired (unsigned int test1)
 
virtual void onInvalidPwConfigFound (unsigned int)
 Called if invalid pw file found on device. More...
 
virtual const char * onExtractionPasswordRequired (unsigned int)
 
virtual bool isTerminateLiveDownloadRequest ()
 Called periodically on live download to query whether the permanent download should be finished.
 
OnlineLoggerInfo getLoggerInfoForIP (const char *ip) const
 
const std::string & getIP () const
 
std::vector< OnlineLoggerInfoWrappergetLoggerList (unsigned searchTimeOut)
 
std::vector< TSLClusterImplgetTSLs (const std::vector< OnlineLoggerInfoWrapper > &tslChain)
 
void excludeRCTFromTSL (TSLClusterImpl &loggersInNetwork)
 
- Public Member Functions inherited from IBPNGClientListener
virtual const char *WINAPI onLogInDataRequired (unsigned mbnr)=0
 Called on accessing password protected functions. More...
 

Member Function Documentation

◆ excludeRCTFromTSL()

void BPNGLoggerDetector::excludeRCTFromTSL ( TSLClusterImpl loggersInNetwork)

Remove RCT from TSL for spezific functions like delete data.

Parameters
loggersInNetworkTSL Chain to check for rct devices

◆ getLoggerList()

std::vector<OnlineLoggerInfoWrapper> BPNGLoggerDetector::getLoggerList ( unsigned  searchTimeOut)

Returns a vector of detected BPNGDevice in local networks.

Parameters
searchTimeOutthe search timeout in seconds
Returns
vector of BPNGDevice

◆ getOverwritingPermission()

virtual int BPNGLoggerDetector::getOverwritingPermission ( const char *  filePath)
virtual

Called on existing output trace files.

When an output trace file already exists this function is called. The listener has the possibility to return one of following values: -1: no, don't overwrite file -2: no, overwrite neither this nor any following file 1: yes, overwrite file 2: yes, overwrite this and all following files 0: cancel conversion

Implements IBPNGClientListener.

◆ getTSLs()

std::vector<TSLClusterImpl> BPNGLoggerDetector::getTSLs ( const std::vector< OnlineLoggerInfoWrapper > &  tslChain)

Checks a vector of BPNGDevice for TSL chains. Combines the devices with same tslNetworkId (except -1) to TSLCluster.

Parameters
loggersInNetworkthe BPNGDevice in network found by getLoggerList(unsigned searchTimeOut)
Returns
vector of TSLCluster

◆ onBPNGDeviceDetected()

virtual void BPNGLoggerDetector::onBPNGDeviceDetected ( OnlineLoggerInfo info)
virtual

Called to notify a detected logger in network.

All char* of the passed OnlineLoggerInfo* are only valid for the time of the function call. Please ensure to copy the string values.

Implements IBPNGClientListener.

◆ onBPNGDeviceDisappeared()

virtual void BPNGLoggerDetector::onBPNGDeviceDisappeared ( OnlineLoggerInfo info)
virtual

Called to notify a disappeared logger.

All char* of the passed OnlineLoggerInfo* are only valid for the time of the function call. Please ensure to copy the string values.

Implements IBPNGClientListener.

◆ onBPNGDeviceStateChange()

virtual void BPNGLoggerDetector::onBPNGDeviceStateChange ( OnlineLoggerInfo info)
virtual

Called to notify a logger's state change.

All char* of the passed OnlineLoggerInfo* are only valid for the time of the function call. Please ensure to copy the string values.

Implements IBPNGClientListener.

◆ onConversionStart()

virtual void BPNGLoggerDetector::onConversionStart ( int64_t  totalAmountOfBytes)
virtual

Notifies the listeners before the conversion starts about the total amount of bytes to be converted.

Parameters
totalAmountOfBytesTotal data size to be converted

Implements IBPNGClientListener.

◆ onCriticalDiskSpace()

virtual int BPNGLoggerDetector::onCriticalDiskSpace ( uint64_t  freeSpace,
uint64_t  neededSpace,
const char *  drive,
const char *  msg 
)
virtual

Called in case of not enough free diskspace.

This notifies the listener about not enough free disk space for data download or conversion. The user can continue or abort the process. Returning 0 will abort the process. In some cases continuing without providing more disk space will call this function immediately again.

Parameters
freeSpaceAmount of free space
neededSpaceAmount of needed space
driveName of the drive where to store data
msgAdditional message to display
Returns
return 0 when process should be aborted, 1 to ignore

Implements IBPNGClientListener.

◆ onDataRecoverProgress()

virtual int BPNGLoggerDetector::onDataRecoverProgress ( const char *  statusMsg,
int  percentage 
)
inlinevirtual

Called to send additional information of the current data recovery progress.

This function transmit message informations for the data recovery process. Those messages are only for information purpose. The information contains a String information about the current data recovery process and int value which contains a percent value for progressbar

Implements IBPNGClientListener.

◆ onDownloadStart()

virtual void BPNGLoggerDetector::onDownloadStart ( int64_t  totalAmountOfBytes)
virtual

Notifies the listeners before the download starts about the total amount of bytes to be downloaded.

Parameters
totalAmountOfBytesTotal data size to be downloaded

Implements IBPNGClientListener.

◆ onExtractionPasswordRequired()

virtual const char* BPNGLoggerDetector::onExtractionPasswordRequired ( unsigned  retryCount)
inlinevirtual

Notifies the listeners that a password for an archive extraction is required, this will be called on EVERY archive that needs a password nethertheless a password was already entered. Already entered passwords should be handled by the callbacked instance.

Parameters
retryCountnumber of attempty on one file, on zero its first try The callbacked instance can save a password list and try every password on the list, if retryCount is zero the list should be handled from the start. If no password is left return 0.

Implements IBPNGClientListener.

◆ onGetLogReportProgress()

virtual int BPNGLoggerDetector::onGetLogReportProgress ( int  percentage,
const char *  desc 
)
virtual

Called on creation of log report

Returns
return value 0 indicates an abort request from the implementing class

Implements IBPNGClientListener.

◆ onInvalidPwConfigFound()

virtual void BPNGLoggerDetector::onInvalidPwConfigFound ( unsigned  mbnr)
inlinevirtual

Called if invalid pw file found on device.

An error may occure on transfering the password configuration to the device, as a result the password configuration is invalid and needs to be reset to default. Inform the user.

Implements IBPNGClientListener.

◆ onProgressConversion()

virtual int BPNGLoggerDetector::onProgressConversion ( int  percentCompleted,
const char *  status 
)
virtual

Called to indicate the current progress of file conversion.

This function notifies the listener about the conversion progress of the raw Telemotive trace data. If the percentCompleted value has changed, but the status is still the same, the application passes an empty string as status to the function.

Parameters
percentCompletedPercent of the entire conversion process (from 0...100%), -1 indicates the same value as from last function call
statusStatus of the conversion process (e.g. "Converting trace data. Block 5 of 32")
Returns
return value 0 indicates an abort request from the implementing class

Implements IBPNGClientListener.

◆ onProgressDataDownload() [1/2]

virtual int BPNGLoggerDetector::onProgressDataDownload ( int  percentCompleted)
virtual

Called to indicate the current progress of a data transfer.

Deprecated:
This function version is deprecated. Use the onProgressDataDownload() with three arguments.

This function notifies the listener about the download progress of the raw Telemotive trace data.

Parameters
percentCompletedPercentage of the entire download process (from 0...100%). A negative value can be passed if only the abort request is checked. A negative value of -1 indicates a broken ftp connection.
Returns
return value 0 indicates an abort request from the implementing class

Implements IBPNGClientListener.

◆ onProgressDataDownload() [2/2]

virtual int BPNGLoggerDetector::onProgressDataDownload ( int  percentCompleted,
uint64_t  downloadedSize,
uint64_t  totalSize 
)
virtual

Called to indicate the current progress of a data transfer.

This function notifies the listener about the download progress of the raw Telemotive trace data.

Parameters
percentCompletedPercentage of the entire download process (from 0...100%). A negative value can be passed if only the abort request is checked. A negative value of -1 indicates a broken ftp connection.
downloadedSizeAmount of bytes already downloaded
totalSizeTotal size to be downloaded
Returns
return value 0 indicates an abort request from the implementing class

Implements IBPNGClientListener.

◆ onProgressDeletion()

virtual int BPNGLoggerDetector::onProgressDeletion ( int  percentCompleted)
virtual

Called to indicate the current progress of file deletion.

This function notifies the listener about the deletion progress of the raw Telemotive trace data.

Parameters
percentCompletedPercentage of the entire deletion process (from 0...100%). A negative value can be passed if only the abort request is checked. A negative value of -1 indicates a broken ftp connection.
Returns
return value 0 indicates an abort request from the implementing class

Implements IBPNGClientListener.

◆ onStatusMessage()

virtual void BPNGLoggerDetector::onStatusMessage ( const char *  statusMsg)
virtual

Called to send additional information of the current process to the calling app.

This function transmit message strings to the listener class. Those messages are only for imformation purpose. The receiver doesn't have to react on it but can display it on the screen.

Implements IBPNGClientListener.

◆ onTargetPathTooLong()

virtual int BPNGLoggerDetector::onTargetPathTooLong ( char *  newTarget,
int  maxSize 
)
virtual

Called on a too long target directory.

Called when the resulting file name of the converted files or the files of an offline data set is longer than the maximum allowed size of the file system (Windows 260). The lib user has to pass a new (shorter) base target directory to the passed char array with strcpy. The memory of the array is already allocated by the library and it's size is maxSize. When a new directory was set the value 1 must be returned. Returning another value than 1 will abort the current process with an error result.

Implements IBPNGClientListener.

◆ onWarning()

virtual void BPNGLoggerDetector::onWarning ( BPNGWarningCode  warningCode,
const char *  warnMsg 
)
virtual

Called to inform about a warning.

This function transmit a warning message to the listener class. Warnings have a WARING_CODE and a warning message. Warnings do not interrupt the current process but should be noticed from the user to possibly initiate further provisions.

Implements IBPNGClientListener.


The documentation for this class was generated from the following file: