#ifndef BRIDGE_H #define BRIDGE_H #include #include #include #include "rmapoperations.h" class bridge : public QWidget { Q_OBJECT public: explicit bridge(QWidget *parent = 0); ~bridge(); unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0); unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0); virtual unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication); virtual unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0) = 0; virtual unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0) = 0; virtual unsigned int getLinkStatus(unsigned char link) = 0; unsigned char rmapTargetLogicalAddress ; unsigned char rmapSourceLogicalAddress ; RMAP_command_codes commandCode; QGridLayout *bridge_LAYOUT; QSemaphore *rmapPacketSEMAPHORE; QSemaphore *ccsdsPacketSEMAPHORE; char *spwPacket; char* rmapPacket; unsigned char *ccsdsPacket; signals: void sendMessage(QString message); void isOpen(bool); void RMAP_write_reply_setText(QString); void appendToLog(QString); void ccsdsPacketAvailable(unsigned char*, unsigned int); public slots: unsigned int Open(); unsigned int Close(); virtual int receiveSPWPacket(unsigned char requestID) = 0; void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;} void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;} void sourceHasChanged(int target) {rmapSourceLogicalAddress = (unsigned char) target;} private: }; #endif // BRIDGE_H