#include <MipLogInterface.h>
Public Member Functions | |
MipLogInterface (MipManager *mipmanager) | |
Constructor. | |
void | SetMipManager (MipManager *mipmanager) |
Sets the MipManager. This method is automatically invoked when mipmanager->SetLogInterface is called. | |
MipManager * | GetMipManager () |
Returns the MipManager. | |
virtual void | OnDataReceived (MipBus *mipbus, unsigned char *data, int len)=0 |
(abstract) Called when data is received. | |
virtual void | OnUnexpectedDataReceived (MipBus *mipbus, unsigned char *data, int len)=0 |
(abstract) Called when unexpected data is received. That means, some data is received without having issued a command. This may happen if another device is on the same bus or if a Mip is executing some command when it is plugged in. | |
virtual void | OnSendPacket (MipBus *mipbus, const unsigned char *data, int len)=0 |
(abstract) Called before a packet is sent. | |
virtual void | OnBeforeClose (MipBus *mipbus)=0 |
(abstract) Called before the serial port of a MipBus is closed. | |
virtual void | OnAfterOpen (MipBus *mipbus)=0 |
(abstract) Called right after opening the serial port of a MipBus. | |
virtual void | OnAfterOpenError (MipBus *mipbus)=0 |
(abstract) Called if an error occured when opening a serial port. | |
Protected Member Functions | |
std::string | DataToString (unsigned char *packet, int len) |
Turns a piece of data (e.g. a packet) into hexadecimal representation. | |
Protected Attributes | |
MipManager * | mMipManager |
The associated MipManager object. |
This is an abstract interface intended for logging. It allows to catch various internal events of the MipManager and the MipBus objects.
To use this interface, create a subclass of it and implement its abstract methods. Attach your class to the MipManager using: