##// END OF EJS Templates
Étiquette socexplorer-plugins-0.7-5 ajoutée à la révision 7f21c0e03b63
Étiquette socexplorer-plugins-0.7-5 ajoutée à la révision 7f21c0e03b63

File last commit:

r82:f085b545eb20 socexplorer-plugins-0.7-2 default
r93:50d45b307e37 default
Show More
abstractspwbridge.h
110 lines | 3.4 KiB | text/x-c | CLexer
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 /*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 --
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-------------------------------------------------------------------------------*/
/*-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@member.fsf.org
----------------------------------------------------------------------------*/
First init /!\ outdated spwplugin!
r0 #ifndef ABSTRACTSPWBRIDGE_H
#define ABSTRACTSPWBRIDGE_H
#include <QObject>
Alexis Jeandet
Backported SPW work from GRESB branch.
r78 #include <QThread>
#include <QMutex>
#include <QSemaphore>
First init /!\ outdated spwplugin!
r0 #include <socexplorerplugin.h>
Jeandet Alexis
Working Snapshot
r1 #define RMAP_MAX_XFER_SIZE 4000 //slightly less than 16kBytes
First init /!\ outdated spwplugin!
r0 #include <spw.h>
Jeandet Alexis
Some work on GRESB driver for spwplugin.
r25 class RMAP_Answer
{
public:
RMAP_Answer(int ID,char* data,int len)
{
transactionID = ID;
this->data = data;
this->len = len;
}
int transactionID;
char* data;
int len;
};
First init /!\ outdated spwplugin!
r0 class abstractSpwBridge : public QObject
{
Q_OBJECT
public:
explicit abstractSpwBridge(socexplorerplugin *parent);
Jeandet Alexis
Sync
r24 ~abstractSpwBridge();
First init /!\ outdated spwplugin!
r0 QWidget *getGUI();
public slots:
virtual bool connectBridge();
virtual bool disconnectBridge();
virtual unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0)=0;
virtual unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0)=0;
virtual int pushRMAPPacket(char* packet,int size)=0;
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 signals:
void setConnected(bool connected);
Jeandet Alexis
Sync
r18 void pushPacketOverTCP(char* packet,int size);
First init /!\ outdated spwplugin!
r0 protected:
socexplorerplugin* plugin;
QWidget* p_GUI;
private:
};
Alexis Jeandet
Backported SPW work from GRESB branch.
r78 class abstractSpwManager: public QThread
{
Q_OBJECT
public:
explicit abstractSpwManager(socexplorerplugin *plugin = 0,QObject* parent=0);
~abstractSpwManager();
Alexis Jeandet
Removed crash on spwplugin while closing the manager thread didn't quit correctly.
r82 virtual void run(){};
Alexis Jeandet
Backported SPW work from GRESB branch.
r78 virtual bool connectBridge()=0;
virtual bool disconnectBridge()=0;
int getRMAPtransactionID();
int getRMAPanswer(int transactionID,char** buffer);
virtual bool sendPacket(char* packet,int size)=0;
int RMAPtimeout;
int linkNumber;
int sourceLogicalAddress;
int destinationLogicalAddress;
int destinationKey;
signals:
void emitPacket(char* packet,int size);
void bytesReceivedFromSpw( unsigned int );
void bytesTransmittedToSpw( unsigned int);
void ccsdsPacketTransmittedToSpw( void );
public slots:
int getLinkNumber();
protected:
QList<RMAP_Answer*> RMAP_Answers;
QList<int> RMAP_pending_transaction_IDs;
QMutex *handleMutex,*RMAP_AnswersMtx,*RMAP_pending_transaction_IDsMtx;
QSemaphore* RMAP_AnswersSem;
socexplorerplugin* plugin;
bool connected;
void pushRmapPacket(char* packet,int len);
};
First init /!\ outdated spwplugin!
r0 #endif // ABSTRACTSPWBRIDGE_H