##// END OF EJS Templates
SpwPlugin:...
jeandet -
r65:67168ff4b6e7 default
parent child
Show More
@@ -0,0 +1,57
1 #include "fakestardundeespwusbgui.h"
2 #include "ui_fakestardundeespwusbgui.h"
3 #include "fakestardundeespwusb_lib.h"
4
5 FakeStardundeeSpwUsbGui::FakeStardundeeSpwUsbGui(QWidget *parent) :
6 QWidget(parent),
7 ui(new Ui::FakeStardundeeSpwUsbGui)
8 {
9 ui->setupUi(this);
10 }
11
12 FakeStardundeeSpwUsbGui::~FakeStardundeeSpwUsbGui()
13 {
14 delete ui;
15 }
16
17 void FakeStardundeeSpwUsbGui::update()
18 {
19 const QList<funcToresolve> stat=FakeStarDundeeSpwUSB_Lib::status();
20 QTableWidgetItem* item;
21 this->ui->symbolsList->clear();
22 this->ui->symbolsList->setHorizontalHeaderLabels(QStringList()<<"Symbol"<<"Status");
23 this->ui->symbolsList->setRowCount(stat.count());
24 for(int i=0;i<stat.count();i++)
25 {
26 item=new QTableWidgetItem(stat[i].symbolName);
27 item->setFlags(item->flags()^Qt::ItemIsEditable);
28 this->ui->symbolsList->setItem(i,0,item);
29 if(*(stat[i].function)==NULL)
30 {
31 item=new QTableWidgetItem("Not found");
32 item->setForeground(Qt::red);
33 item->setFlags(item->flags()^Qt::ItemIsEditable);
34 this->ui->symbolsList->setItem(i,1,item);
35 }
36 else
37 {
38 item=new QTableWidgetItem("Loaded");
39 item->setForeground(Qt::green);
40 item->setFlags(item->flags()^Qt::ItemIsEditable);
41 this->ui->symbolsList->setItem(i,1,item);
42 }
43 }
44 this->ui->symbolsList->resizeColumnsToContents();
45 }
46
47 void FakeStardundeeSpwUsbGui::changeEvent(QEvent *e)
48 {
49 QWidget::changeEvent(e);
50 switch (e->type()) {
51 case QEvent::LanguageChange:
52 ui->retranslateUi(this);
53 break;
54 default:
55 break;
56 }
57 }
@@ -0,0 +1,25
1 #ifndef FAKESTARDUNDEESPWUSBGUI_H
2 #define FAKESTARDUNDEESPWUSBGUI_H
3
4 #include <QWidget>
5
6 namespace Ui {
7 class FakeStardundeeSpwUsbGui;
8 }
9
10 class FakeStardundeeSpwUsbGui : public QWidget
11 {
12 Q_OBJECT
13
14 public:
15 explicit FakeStardundeeSpwUsbGui(QWidget *parent = 0);
16 ~FakeStardundeeSpwUsbGui();
17 void update();
18 protected:
19 void changeEvent(QEvent *e);
20
21 private:
22 Ui::FakeStardundeeSpwUsbGui *ui;
23 };
24
25 #endif // FAKESTARDUNDEESPWUSBGUI_H
@@ -0,0 +1,84
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>FakeStardundeeSpwUsbGui</class>
4 <widget class="QWidget" name="FakeStardundeeSpwUsbGui">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>612</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Form</string>
15 </property>
16 <layout class="QGridLayout" name="gridLayout">
17 <item row="1" column="1">
18 <widget class="QPushButton" name="closeQpb">
19 <property name="text">
20 <string>close</string>
21 </property>
22 </widget>
23 </item>
24 <item row="1" column="0">
25 <spacer name="horizontalSpacer">
26 <property name="orientation">
27 <enum>Qt::Horizontal</enum>
28 </property>
29 <property name="sizeHint" stdset="0">
30 <size>
31 <width>40</width>
32 <height>20</height>
33 </size>
34 </property>
35 </spacer>
36 </item>
37 <item row="0" column="0" colspan="2">
38 <widget class="QTableWidget" name="symbolsList">
39 <property name="alternatingRowColors">
40 <bool>true</bool>
41 </property>
42 <property name="sortingEnabled">
43 <bool>true</bool>
44 </property>
45 <attribute name="horizontalHeaderShowSortIndicator" stdset="0">
46 <bool>true</bool>
47 </attribute>
48 <attribute name="verticalHeaderShowSortIndicator" stdset="0">
49 <bool>false</bool>
50 </attribute>
51 <column>
52 <property name="text">
53 <string>Symbol</string>
54 </property>
55 </column>
56 <column>
57 <property name="text">
58 <string>Status</string>
59 </property>
60 </column>
61 </widget>
62 </item>
63 </layout>
64 </widget>
65 <resources/>
66 <connections>
67 <connection>
68 <sender>closeQpb</sender>
69 <signal>clicked()</signal>
70 <receiver>FakeStardundeeSpwUsbGui</receiver>
71 <slot>close()</slot>
72 <hints>
73 <hint type="sourcelabel">
74 <x>560</x>
75 <y>275</y>
76 </hint>
77 <hint type="destinationlabel">
78 <x>305</x>
79 <y>149</y>
80 </hint>
81 </hints>
82 </connection>
83 </connections>
84 </ui>
@@ -1,653 +1,665
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "fakestardundeespwusb_lib.h"
22 #include "fakestardundeespwusb_lib.h"
23 #include <QDebug>
23 #include <QDebug>
24
24
25
25
26 char (*resolved_USBSpaceWire_Open)(star_device_handle *phDevice, int nDeviceNum)=NULL;
26 char (*resolved_USBSpaceWire_Open)(star_device_handle *phDevice, int nDeviceNum)=NULL;
27 void (*resolved_USBSpaceWire_Close)(star_device_handle hDevice)=NULL;
27 void (*resolved_USBSpaceWire_Close)(star_device_handle hDevice)=NULL;
28 U32 (*resolved_USBSpaceWire_ListDevices)()=NULL;
28 U32 (*resolved_USBSpaceWire_ListDevices)()=NULL;
29 char (*resolved_USBSpaceWire_GetSerialNumber)(star_device_handle hDevice, U8 pSerialNumber[11])=NULL;
29 char (*resolved_USBSpaceWire_GetSerialNumber)(star_device_handle hDevice, U8 pSerialNumber[11])=NULL;
30 void (*resolved_USBSpaceWire_EnableNetworkMode)(star_device_handle hDevice, char enable)=NULL;
30 void (*resolved_USBSpaceWire_EnableNetworkMode)(star_device_handle hDevice, char enable)=NULL;
31 char (*resolved_USBSpaceWire_RegisterReceiveOnAllPorts)(star_device_handle hDevice)=NULL;
31 char (*resolved_USBSpaceWire_RegisterReceiveOnAllPorts)(star_device_handle hDevice)=NULL;
32 char (*resolved_USBSpaceWire_UnregisterReceiveOnAllPorts)(star_device_handle hDevice)=NULL;
32 char (*resolved_USBSpaceWire_UnregisterReceiveOnAllPorts)(star_device_handle hDevice)=NULL;
33 char (*resolved_USBSpaceWire_ClearEndpoints)(star_device_handle hDevice)=NULL;
33 char (*resolved_USBSpaceWire_ClearEndpoints)(star_device_handle hDevice)=NULL;
34 void (*resolved_USBSpaceWire_SetTimeout)(star_device_handle hDevice, double timeout)=NULL;
34 void (*resolved_USBSpaceWire_SetTimeout)(star_device_handle hDevice, double timeout)=NULL;
35 char (*resolved_USBSpaceWire_TC_Reset)(star_device_handle hDevice)=NULL;
35 char (*resolved_USBSpaceWire_TC_Reset)(star_device_handle hDevice)=NULL;
36 char (*resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection)(star_device_handle hDevice,char enable)=NULL;
36 char (*resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection)(star_device_handle hDevice,char enable)=NULL;
37 U32 (*resolved_USBSpaceWire_TC_GetClockFrequency)(star_device_handle hDevice)=NULL;
37 U32 (*resolved_USBSpaceWire_TC_GetClockFrequency)(star_device_handle hDevice)=NULL;
38 char (*resolved_USBSpaceWire_TC_SetAutoTickInFrequency)(star_device_handle hDevice, U32 frequency)=NULL;
38 char (*resolved_USBSpaceWire_TC_SetAutoTickInFrequency)(star_device_handle hDevice, U32 frequency)=NULL;
39 char (*resolved_USBSpaceWire_TC_EnableAutoTickIn)(star_device_handle hDevice, char enableAutoTickIns, char enableAllPorts)=NULL;
39 char (*resolved_USBSpaceWire_TC_EnableAutoTickIn)(star_device_handle hDevice, char enableAutoTickIns, char enableAllPorts)=NULL;
40 char (*resolved_USBSpaceWire_TC_PerformTickIn)(star_device_handle hDevice, U8 timein)=NULL;
40 char (*resolved_USBSpaceWire_TC_PerformTickIn)(star_device_handle hDevice, U8 timein)=NULL;
41 U32 (*resolved_USBSpaceWire_GetDriverSendBufferSize)(star_device_handle hDevice)=NULL;
41 U32 (*resolved_USBSpaceWire_GetDriverSendBufferSize)(star_device_handle hDevice)=NULL;
42 U32 (*resolved_USBSpaceWire_GetDriverReadBufferSize)(star_device_handle hDevice)=NULL;
42 U32 (*resolved_USBSpaceWire_GetDriverReadBufferSize)(star_device_handle hDevice)=NULL;
43 char (*resolved_USBSpaceWire_IsReadThrottling)(star_device_handle hDevice)=NULL;
43 char (*resolved_USBSpaceWire_IsReadThrottling)(star_device_handle hDevice)=NULL;
44
44
45 char (*resolved_USBSpaceWire_WaitOnReadPacketAvailable)(star_device_handle hDevice, double timeout)=NULL;
45 char (*resolved_USBSpaceWire_WaitOnReadPacketAvailable)(star_device_handle hDevice, double timeout)=NULL;
46 USB_SPACEWIRE_STATUS (*resolved_USBSpaceWire_SendPacket)(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, char bWait,USB_SPACEWIRE_ID *identifier)=NULL;
46 USB_SPACEWIRE_STATUS (*resolved_USBSpaceWire_SendPacket)(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, char bWait,USB_SPACEWIRE_ID *identifier)=NULL;
47 char (*resolved_USBSpaceWire_FreeSend)(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)=NULL;
47 char (*resolved_USBSpaceWire_FreeSend)(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)=NULL;
48 USB_SPACEWIRE_STATUS (*resolved_USBSpaceWire_ReadPackets)(star_device_handle hDevice, void *pBuffer, U32 nBufferSize,U32 nPacketNum, char bWait, PUSB_SPACEWIRE_PACKET_PROPERTIES properties,USB_SPACEWIRE_ID *identifier)=NULL;
48 USB_SPACEWIRE_STATUS (*resolved_USBSpaceWire_ReadPackets)(star_device_handle hDevice, void *pBuffer, U32 nBufferSize,U32 nPacketNum, char bWait, PUSB_SPACEWIRE_PACKET_PROPERTIES properties,USB_SPACEWIRE_ID *identifier)=NULL;
49 char (*resolved_USBSpaceWire_FreeRead)(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)=NULL;
49 char (*resolved_USBSpaceWire_FreeRead)(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)=NULL;
50 SPACEWIRE_TRAFFIC_TYPE (*resolved_USBSpaceWire_GetReadTrafficType)(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)=NULL;
50 SPACEWIRE_TRAFFIC_TYPE (*resolved_USBSpaceWire_GetReadTrafficType)(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)=NULL;
51 USB_SPACEWIRE_EOP_TYPE (*resolved_USBSpaceWire_GetReadEOPStatus)(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties,U32 nPacketNum)=NULL;
51 USB_SPACEWIRE_EOP_TYPE (*resolved_USBSpaceWire_GetReadEOPStatus)(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties,U32 nPacketNum)=NULL;
52
52
53 void (*resolved_CFGSpaceWire_EnableRMAP)(char useRMAP)=NULL;
53 void (*resolved_CFGSpaceWire_EnableRMAP)(char useRMAP)=NULL;
54 void (*resolved_CFGSpaceWire_SetRMAPDestinationKey)(U8 destinationKey)=NULL;
54 void (*resolved_CFGSpaceWire_SetRMAPDestinationKey)(U8 destinationKey)=NULL;
55 void (*resolved_CFGSpaceWire_StackClear)(void)=NULL;
55 void (*resolved_CFGSpaceWire_StackClear)(void)=NULL;
56 void (*resolved_CFGSpaceWire_AddrStackPush)(U8 dwAddress)=NULL;
56 void (*resolved_CFGSpaceWire_AddrStackPush)(U8 dwAddress)=NULL;
57 void (*resolved_CFGSpaceWire_RetAddrStackPush)(U8 dwAddress)=NULL;
57 void (*resolved_CFGSpaceWire_RetAddrStackPush)(U8 dwAddress)=NULL;
58 int (*resolved_CFGSpaceWire_SetBrickBaseTransmitRate)(star_device_handle hDevice, U32 dwBaseClk, U32 dwBaseDvdr, U32 dwEnableClk)=NULL;
58 int (*resolved_CFGSpaceWire_SetBrickBaseTransmitRate)(star_device_handle hDevice, U32 dwBaseClk, U32 dwBaseDvdr, U32 dwEnableClk)=NULL;
59 int (*resolved_CFGSpaceWire_GetLinkStatusControl)(star_device_handle hDevice, U32 dwLinkNum, U32 *dwStatusControl)=NULL;
59 int (*resolved_CFGSpaceWire_GetLinkStatusControl)(star_device_handle hDevice, U32 dwLinkNum, U32 *dwStatusControl)=NULL;
60 void (*resolved_CFGSpaceWire_LSEnableAutoStart)(U32 *dwStatusControl, char bEnabled)=NULL;
60 void (*resolved_CFGSpaceWire_LSEnableAutoStart)(U32 *dwStatusControl, char bEnabled)=NULL;
61 void (*resolved_CFGSpaceWire_LSEnableStart)(U32 *dwStatusControl, char bEnabled)=NULL;
61 void (*resolved_CFGSpaceWire_LSEnableStart)(U32 *dwStatusControl, char bEnabled)=NULL;
62 void (*resolved_CFGSpaceWire_LSEnableDisabled)(U32 *dwStatusControl, char bEnabled)=NULL;
62 void (*resolved_CFGSpaceWire_LSEnableDisabled)(U32 *dwStatusControl, char bEnabled)=NULL;
63 void (*resolved_CFGSpaceWire_LSEnableTristate)(U32 *dwStatusControl, char bEnabled)=NULL;
63 void (*resolved_CFGSpaceWire_LSEnableTristate)(U32 *dwStatusControl, char bEnabled)=NULL;
64 void (*resolved_CFGSpaceWire_LSPortType)(U32 dwStatusControl, U32 *dwPortType)=NULL;
64 void (*resolved_CFGSpaceWire_LSPortType)(U32 dwStatusControl, U32 *dwPortType)=NULL;
65 void (*resolved_CFGSpaceWire_LSSetOperatingSpeed)(U32 *dwStatusControl, U32 dwOperatingSpeed)=NULL;
65 void (*resolved_CFGSpaceWire_LSSetOperatingSpeed)(U32 *dwStatusControl, U32 dwOperatingSpeed)=NULL;
66 void (*resolved_CFGSpaceWire_LSConfigErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
66 void (*resolved_CFGSpaceWire_LSConfigErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
67 void (*resolved_CFGSpaceWire_LSExternalErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
67 void (*resolved_CFGSpaceWire_LSExternalErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
68 void (*resolved_CFGSpaceWire_LSErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
68 void (*resolved_CFGSpaceWire_LSErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
69 void (*resolved_CFGSpaceWire_LSLinkState)(U32 dwStatusControl, U32 *dwLinkStatus)=NULL;
69 void (*resolved_CFGSpaceWire_LSLinkState)(U32 dwStatusControl, U32 *dwLinkStatus)=NULL;
70 void (*resolved_CFGSpaceWire_LSIsLinkRunning)(U32 dwStatusControl, char *isLinkRunning)=NULL;
70 void (*resolved_CFGSpaceWire_LSIsLinkRunning)(U32 dwStatusControl, char *isLinkRunning)=NULL;
71 void (*resolved_CFGSpaceWire_LSIsAutoStart)(U32 dwStatusControl, char *isAutoStart)=NULL;
71 void (*resolved_CFGSpaceWire_LSIsAutoStart)(U32 dwStatusControl, char *isAutoStart)=NULL;
72 void (*resolved_CFGSpaceWire_LSIsStart)(U32 dwStatusControl, char *isStart)=NULL;
72 void (*resolved_CFGSpaceWire_LSIsStart)(U32 dwStatusControl, char *isStart)=NULL;
73 void (*resolved_CFGSpaceWire_LSIsDisabled)(U32 dwStatusControl, char *isDisabled)=NULL;
73 void (*resolved_CFGSpaceWire_LSIsDisabled)(U32 dwStatusControl, char *isDisabled)=NULL;
74 void (*resolved_CFGSpaceWire_LSIsTristate)(U32 dwStatusControl, char *isTristate)=NULL;
74 void (*resolved_CFGSpaceWire_LSIsTristate)(U32 dwStatusControl, char *isTristate)=NULL;
75 void (*resolved_CFGSpaceWire_LSOperatingSpeed)(U32 dwStatusControl, U32 *dwOperatingSpeed)=NULL;
75 void (*resolved_CFGSpaceWire_LSOperatingSpeed)(U32 dwStatusControl, U32 *dwOperatingSpeed)=NULL;
76 void (*resolved_CFGSpaceWire_LSOutputPortConnection)(U32 dwStatusControl, U32 *dwOutputPortConnection)=NULL;
76 void (*resolved_CFGSpaceWire_LSOutputPortConnection)(U32 dwStatusControl, U32 *dwOutputPortConnection)=NULL;
77 int (*resolved_CFGSpaceWire_SetLinkStatusControl)(star_device_handle hDevice, U32 dwLinkNum, U32 dwStatusControl)=NULL;
77 int (*resolved_CFGSpaceWire_SetLinkStatusControl)(star_device_handle hDevice, U32 dwLinkNum, U32 dwStatusControl)=NULL;
78 int (*resolved_CFGSpaceWire_SetAsInterface)(star_device_handle hDevice, char bEnabled, char bAddIdentifier)=NULL;
78 int (*resolved_CFGSpaceWire_SetAsInterface)(star_device_handle hDevice, char bEnabled, char bAddIdentifier)=NULL;
79 int (*resolved_CFGSpaceWire_ClearRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress)=NULL;
79 int (*resolved_CFGSpaceWire_ClearRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress)=NULL;
80 void (*resolved_CFGSpaceWire_RTBuildRoutingTableEntry)(U32 *dwRoutingTableEntry,U32 dwOutputPorts, char bDelHead, char bPriority)=NULL;
80 void (*resolved_CFGSpaceWire_RTBuildRoutingTableEntry)(U32 *dwRoutingTableEntry,U32 dwOutputPorts, char bDelHead, char bPriority)=NULL;
81 int (*resolved_CFGSpaceWire_SetRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress, U32 dwRoutingTableEntry)=NULL;
81 int (*resolved_CFGSpaceWire_SetRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress, U32 dwRoutingTableEntry)=NULL;
82 int (*resolved_CFGSpaceWire_GetRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress, U32 *dwRoutingTableEntry)=NULL;
82 int (*resolved_CFGSpaceWire_GetRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress, U32 *dwRoutingTableEntry)=NULL;
83 void (*resolved_CFGSpaceWire_RTIsEnabled)(U32 dwRoutingTableEntry, char *bEnabled)=NULL;
83 void (*resolved_CFGSpaceWire_RTIsEnabled)(U32 dwRoutingTableEntry, char *bEnabled)=NULL;
84 void (*resolved_CFGSpaceWire_RTIsDelHead)(U32 dwRoutingTableEntry, char *bDelHead)=NULL;
84 void (*resolved_CFGSpaceWire_RTIsDelHead)(U32 dwRoutingTableEntry, char *bDelHead)=NULL;
85 void (*resolved_CFGSpaceWire_RTIsPriority)(U32 dwRoutingTableEntry, char *bPriority)=NULL;
85 void (*resolved_CFGSpaceWire_RTIsPriority)(U32 dwRoutingTableEntry, char *bPriority)=NULL;
86 void (*resolved_CFGSpaceWire_RTGetOutputPorts)(U32 dwRoutingTableEntry, U32 *dwOutputPorts)=NULL;
86 void (*resolved_CFGSpaceWire_RTGetOutputPorts)(U32 dwRoutingTableEntry, U32 *dwOutputPorts)=NULL;
87 int (*resolved_CFGSpaceWire_GetTickEnableStatus)(star_device_handle hDevice, U32 *dwTickEnableStatus)=NULL;
87 int (*resolved_CFGSpaceWire_GetTickEnableStatus)(star_device_handle hDevice, U32 *dwTickEnableStatus)=NULL;
88 int (*resolved_CFGSpaceWire_SetTickEnableStatus)(star_device_handle hDevice, U32 dwTickEnableStatus)=NULL;
88 int (*resolved_CFGSpaceWire_SetTickEnableStatus)(star_device_handle hDevice, U32 dwTickEnableStatus)=NULL;
89
89
90
90
91 typedef struct funcToresolve
91
92 {
93 void (** function)();
94 const char* symbolName;
95 }funcToresolve;
96
92
97 QList<funcToresolve> funcTable=QList<funcToresolve>()
93 QList<funcToresolve> funcTable=QList<funcToresolve>()
98 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_Open,"USBSpaceWire_Open"}
94 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_Open,"USBSpaceWire_Open"}
99 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_Close,"USBSpaceWire_Close"}
95 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_Close,"USBSpaceWire_Close"}
100 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_ListDevices,"USBSpaceWire_ListDevices"}
96 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_ListDevices,"USBSpaceWire_ListDevices"}
101 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetSerialNumber,"USBSpaceWire_GetSerialNumber"}
97 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetSerialNumber,"USBSpaceWire_GetSerialNumber"}
102 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_EnableNetworkMode,"USBSpaceWire_EnableNetworkMode"}
98 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_EnableNetworkMode,"USBSpaceWire_EnableNetworkMode"}
103 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_RegisterReceiveOnAllPorts,"USBSpaceWire_RegisterReceiveOnAllPorts"}
99 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_RegisterReceiveOnAllPorts,"USBSpaceWire_RegisterReceiveOnAllPorts"}
104 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_UnregisterReceiveOnAllPorts,"USBSpaceWire_UnregisterReceiveOnAllPorts"}
100 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_UnregisterReceiveOnAllPorts,"USBSpaceWire_UnregisterReceiveOnAllPorts"}
105 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_ClearEndpoints,"USBSpaceWire_ClearEndpoints"}
101 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_ClearEndpoints,"USBSpaceWire_ClearEndpoints"}
106 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_SetTimeout,"USBSpaceWire_SetTimeout"}
102 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_SetTimeout,"USBSpaceWire_SetTimeout"}
107 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_Reset,"USBSpaceWire_TC_Reset"}
103 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_Reset,"USBSpaceWire_TC_Reset"}
108 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection,"USBSpaceWire_TC_EnableExternalTimecodeSelection"}
104 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection,"USBSpaceWire_TC_EnableExternalTimecodeSelection"}
109 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_GetClockFrequency,"USBSpaceWire_TC_GetClockFrequency"}
105 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_GetClockFrequency,"USBSpaceWire_TC_GetClockFrequency"}
110 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_SetAutoTickInFrequency,"USBSpaceWire_TC_SetAutoTickInFrequency"}
106 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_SetAutoTickInFrequency,"USBSpaceWire_TC_SetAutoTickInFrequency"}
111 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_EnableAutoTickIn,"USBSpaceWire_TC_EnableAutoTickIn"}
107 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_EnableAutoTickIn,"USBSpaceWire_TC_EnableAutoTickIn"}
112 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_PerformTickIn,"USBSpaceWire_TC_PerformTickIn"}
108 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_PerformTickIn,"USBSpaceWire_TC_PerformTickIn"}
113 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetDriverSendBufferSize,"USBSpaceWire_GetDriverSendBufferSize"}
109 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetDriverSendBufferSize,"USBSpaceWire_GetDriverSendBufferSize"}
114 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetDriverReadBufferSize,"USBSpaceWire_GetDriverReadBufferSize"}
110 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetDriverReadBufferSize,"USBSpaceWire_GetDriverReadBufferSize"}
115 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_IsReadThrottling,"USBSpaceWire_IsReadThrottling"}
111 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_IsReadThrottling,"USBSpaceWire_IsReadThrottling"}
116 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_WaitOnReadPacketAvailable,"USBSpaceWire_WaitOnReadPacketAvailable"}
112 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_WaitOnReadPacketAvailable,"USBSpaceWire_WaitOnReadPacketAvailable"}
117 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_SendPacket,"USBSpaceWire_SendPacket"}
113 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_SendPacket,"USBSpaceWire_SendPacket"}
118 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_FreeSend,"USBSpaceWire_FreeSend"}
114 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_FreeSend,"USBSpaceWire_FreeSend"}
119 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_ReadPackets,"USBSpaceWire_ReadPackets"}
115 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_ReadPackets,"USBSpaceWire_ReadPackets"}
120 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_FreeRead,"USBSpaceWire_FreeRead"}
116 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_FreeRead,"USBSpaceWire_FreeRead"}
121 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetReadTrafficType,"USBSpaceWire_GetReadTrafficType"}
117 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetReadTrafficType,"USBSpaceWire_GetReadTrafficType"}
122 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetReadEOPStatus,"USBSpaceWire_GetReadEOPStatus"}
118 <<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetReadEOPStatus,"USBSpaceWire_GetReadEOPStatus"}
123 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_EnableRMAP,"CFGSpaceWire_EnableRMAP"}
119 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_EnableRMAP,"CFGSpaceWire_EnableRMAP"}
124 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetRMAPDestinationKey,"CFGSpaceWire_SetRMAPDestinationKey"}
120 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetRMAPDestinationKey,"CFGSpaceWire_SetRMAPDestinationKey"}
125 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_StackClear,"CFGSpaceWire_StackClear"}
121 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_StackClear,"CFGSpaceWire_StackClear"}
126 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_AddrStackPush,"CFGSpaceWire_AddrStackPush"}
122 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_AddrStackPush,"CFGSpaceWire_AddrStackPush"}
127 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RetAddrStackPush,"CFGSpaceWire_RetAddrStackPush"}
123 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RetAddrStackPush,"CFGSpaceWire_RetAddrStackPush"}
128 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetBrickBaseTransmitRate,"CFGSpaceWire_SetBrickBaseTransmitRate"}
124 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetBrickBaseTransmitRate,"CFGSpaceWire_SetBrickBaseTransmitRate"}
129 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetLinkStatusControl,"CFGSpaceWire_GetLinkStatusControl"}
125 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetLinkStatusControl,"CFGSpaceWire_GetLinkStatusControl"}
130 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableAutoStart,"CFGSpaceWire_LSEnableAutoStart"}
126 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableAutoStart,"CFGSpaceWire_LSEnableAutoStart"}
131 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableStart,"CFGSpaceWire_LSEnableStart"}
127 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableStart,"CFGSpaceWire_LSEnableStart"}
132 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableDisabled,"CFGSpaceWire_LSEnableDisabled"}
128 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableDisabled,"CFGSpaceWire_LSEnableDisabled"}
133 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableTristate,"CFGSpaceWire_LSEnableTristate"}
129 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableTristate,"CFGSpaceWire_LSEnableTristate"}
134 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSPortType,"CFGSpaceWire_LSPortType"}
130 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSPortType,"CFGSpaceWire_LSPortType"}
135 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSSetOperatingSpeed,"CFGSpaceWire_LSSetOperatingSpeed"}
131 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSSetOperatingSpeed,"CFGSpaceWire_LSSetOperatingSpeed"}
136 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSConfigErrorStatus,"CFGSpaceWire_LSConfigErrorStatus"}
132 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSConfigErrorStatus,"CFGSpaceWire_LSConfigErrorStatus"}
137 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSExternalErrorStatus,"CFGSpaceWire_LSExternalErrorStatus"}
133 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSExternalErrorStatus,"CFGSpaceWire_LSExternalErrorStatus"}
138 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSErrorStatus,"CFGSpaceWire_LSErrorStatus"}
134 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSErrorStatus,"CFGSpaceWire_LSErrorStatus"}
139 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSLinkState,"CFGSpaceWire_LSLinkState"}
135 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSLinkState,"CFGSpaceWire_LSLinkState"}
140 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsLinkRunning,"CFGSpaceWire_LSIsLinkRunning"}
136 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsLinkRunning,"CFGSpaceWire_LSIsLinkRunning"}
141 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsAutoStart,"CFGSpaceWire_LSIsAutoStart"}
137 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsAutoStart,"CFGSpaceWire_LSIsAutoStart"}
142 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsStart,"CFGSpaceWire_LSIsStart"}
138 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsStart,"CFGSpaceWire_LSIsStart"}
143 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsDisabled,"CFGSpaceWire_LSIsDisabled"}
139 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsDisabled,"CFGSpaceWire_LSIsDisabled"}
144 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsTristate,"CFGSpaceWire_LSIsTristate"}
140 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsTristate,"CFGSpaceWire_LSIsTristate"}
145 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSOperatingSpeed,"CFGSpaceWire_LSOperatingSpeed"}
141 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSOperatingSpeed,"CFGSpaceWire_LSOperatingSpeed"}
146 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSOutputPortConnection,"CFGSpaceWire_LSOutputPortConnection"}
142 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSOutputPortConnection,"CFGSpaceWire_LSOutputPortConnection"}
147 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetLinkStatusControl,"CFGSpaceWire_SetLinkStatusControl"}
143 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetLinkStatusControl,"CFGSpaceWire_SetLinkStatusControl"}
148 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetAsInterface,"CFGSpaceWire_SetAsInterface"}
144 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetAsInterface,"CFGSpaceWire_SetAsInterface"}
149 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_ClearRoutingTableEntry,"CFGSpaceWire_ClearRoutingTableEntry"}
145 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_ClearRoutingTableEntry,"CFGSpaceWire_ClearRoutingTableEntry"}
150 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTBuildRoutingTableEntry,"CFGSpaceWire_RTBuildRoutingTableEntry"}
146 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTBuildRoutingTableEntry,"CFGSpaceWire_RTBuildRoutingTableEntry"}
151 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetRoutingTableEntry,"CFGSpaceWire_SetRoutingTableEntry"}
147 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetRoutingTableEntry,"CFGSpaceWire_SetRoutingTableEntry"}
152 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetRoutingTableEntry,"CFGSpaceWire_GetRoutingTableEntry"}
148 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetRoutingTableEntry,"CFGSpaceWire_GetRoutingTableEntry"}
153 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsEnabled,"CFGSpaceWire_RTIsEnabled"}
149 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsEnabled,"CFGSpaceWire_RTIsEnabled"}
154 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsDelHead,"CFGSpaceWire_RTIsDelHead"}
150 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsDelHead,"CFGSpaceWire_RTIsDelHead"}
155 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsPriority,"CFGSpaceWire_RTIsPriority"}
151 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsPriority,"CFGSpaceWire_RTIsPriority"}
156 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTGetOutputPorts,"CFGSpaceWire_RTGetOutputPorts"}
152 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTGetOutputPorts,"CFGSpaceWire_RTGetOutputPorts"}
157 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetTickEnableStatus,"CFGSpaceWire_GetTickEnableStatus"}
153 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetTickEnableStatus,"CFGSpaceWire_GetTickEnableStatus"}
158 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetTickEnableStatus,"CFGSpaceWire_SetTickEnableStatus"};
154 <<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetTickEnableStatus,"CFGSpaceWire_SetTickEnableStatus"};
159
155
160
156
161
157
162 FakeStarDundeeSpwUSB_Lib::FakeStarDundeeSpwUSB_Lib()
158 FakeStarDundeeSpwUSB_Lib::FakeStarDundeeSpwUSB_Lib()
163 {
159 {
164
160
165 }
161 }
166
162
167 void FakeStarDundeeSpwUSB_Lib::resolve()
163 void FakeStarDundeeSpwUSB_Lib::resolve()
168 {
164 {
169 QLibrary cfgLib;
165 QLibrary cfgLib;
170 QLibrary usbLib;
166 QLibrary usbLib;
171 usbLib.setFileName("/home/spacewire/usb/spw_usb_driver_v2.68/lib/x86_64/libSpaceWireUSBAPI.so");
167 usbLib.setFileName("/home/spacewire/usb/spw_usb_driver_v2.68/lib/x86_64/libSpaceWireUSBAPI.so");
172 cfgLib.setFileName("/home/spacewire/usb/spw_usb_driver_v2.68/lib/x86_64/libConfigLibraryUSB.so");
168 cfgLib.setFileName("/home/spacewire/usb/spw_usb_driver_v2.68/lib/x86_64/libConfigLibraryUSB.so");
173 usbLib.load();
169 usbLib.load();
174 cfgLib.load();
170 cfgLib.load();
175 if(usbLib.isLoaded()&&cfgLib.isLoaded())
171 if(usbLib.isLoaded()&&cfgLib.isLoaded())
176 {
172 {
177 for(int i=0;i<funcTable.count();i++)
173 for(int i=0;i<funcTable.count();i++)
178 {
174 {
179 QString symbolName = funcTable[i].symbolName;
175 QString symbolName = funcTable[i].symbolName;
180 if(!symbolName.contains("USBSpaceWire_"))
176 if(!symbolName.contains("USBSpaceWire_"))
181 {
177 {
182 *(funcTable[i].function) = usbLib.resolve(funcTable[i].symbolName);
178 *(funcTable[i].function) = usbLib.resolve(funcTable[i].symbolName);
183 if(*(funcTable[i].function)==NULL)
179 if(*(funcTable[i].function)==NULL)
184 *(funcTable[i].function) = cfgLib.resolve(funcTable[i].symbolName);
180 *(funcTable[i].function) = cfgLib.resolve(funcTable[i].symbolName);
185 }
181 }
186 else
182 else
187 {
183 {
188 *(funcTable[i].function) = cfgLib.resolve(funcTable[i].symbolName);
184 *(funcTable[i].function) = cfgLib.resolve(funcTable[i].symbolName);
189 if(*(funcTable[i].function)==NULL)
185 if(*(funcTable[i].function)==NULL)
190 *(funcTable[i].function) = usbLib.resolve(funcTable[i].symbolName);
186 *(funcTable[i].function) = usbLib.resolve(funcTable[i].symbolName);
191 }
187 }
192 }
188 }
193 }
189 }
194 }
190 }
195
191
192 bool FakeStarDundeeSpwUSB_Lib::fullresolved()
193 {
194 bool success=true;
195 for(int i=0;i<funcTable.count();i++)
196 {
197 if(*(funcTable[i].function)==NULL)
198 success=false;
199 }
200 return success;
201 }
202
203 const QList<funcToresolve> &FakeStarDundeeSpwUSB_Lib::status()
204 {
205 return funcTable;
206 }
207
196
208
197
209
198 char USBSpaceWire_Open(star_device_handle *phDevice, int nDeviceNum)
210 char USBSpaceWire_Open(star_device_handle *phDevice, int nDeviceNum)
199 {
211 {
200 if(resolved_USBSpaceWire_Open!=NULL)
212 if(resolved_USBSpaceWire_Open!=NULL)
201 return resolved_USBSpaceWire_Open(phDevice, nDeviceNum);
213 return resolved_USBSpaceWire_Open(phDevice, nDeviceNum);
202 return 0;
214 return 0;
203 }
215 }
204
216
205
217
206 void USBSpaceWire_Close(star_device_handle hDevice)
218 void USBSpaceWire_Close(star_device_handle hDevice)
207 {
219 {
208 if(resolved_USBSpaceWire_Close!=NULL)
220 if(resolved_USBSpaceWire_Close!=NULL)
209 resolved_USBSpaceWire_Close(hDevice);
221 resolved_USBSpaceWire_Close(hDevice);
210 }
222 }
211
223
212
224
213 U32 USBSpaceWire_ListDevices()
225 U32 USBSpaceWire_ListDevices()
214 {
226 {
215 if(resolved_USBSpaceWire_ListDevices!=NULL)
227 if(resolved_USBSpaceWire_ListDevices!=NULL)
216 return resolved_USBSpaceWire_ListDevices();
228 return resolved_USBSpaceWire_ListDevices();
217 return 0;
229 return 0;
218 }
230 }
219
231
220
232
221 char USBSpaceWire_GetSerialNumber(star_device_handle hDevice, U8 pSerialNumber[])
233 char USBSpaceWire_GetSerialNumber(star_device_handle hDevice, U8 pSerialNumber[])
222 {
234 {
223 if(resolved_USBSpaceWire_GetSerialNumber!=NULL)
235 if(resolved_USBSpaceWire_GetSerialNumber!=NULL)
224 return resolved_USBSpaceWire_GetSerialNumber(hDevice,pSerialNumber);
236 return resolved_USBSpaceWire_GetSerialNumber(hDevice,pSerialNumber);
225 return 0;
237 return 0;
226 }
238 }
227
239
228
240
229 void USBSpaceWire_EnableNetworkMode(star_device_handle hDevice, char enable)
241 void USBSpaceWire_EnableNetworkMode(star_device_handle hDevice, char enable)
230 {
242 {
231 if(resolved_USBSpaceWire_EnableNetworkMode!=NULL)
243 if(resolved_USBSpaceWire_EnableNetworkMode!=NULL)
232 resolved_USBSpaceWire_EnableNetworkMode(hDevice,enable);
244 resolved_USBSpaceWire_EnableNetworkMode(hDevice,enable);
233 }
245 }
234
246
235
247
236 char USBSpaceWire_RegisterReceiveOnAllPorts(star_device_handle hDevice)
248 char USBSpaceWire_RegisterReceiveOnAllPorts(star_device_handle hDevice)
237 {
249 {
238 if(resolved_USBSpaceWire_RegisterReceiveOnAllPorts!=NULL)
250 if(resolved_USBSpaceWire_RegisterReceiveOnAllPorts!=NULL)
239 return resolved_USBSpaceWire_RegisterReceiveOnAllPorts(hDevice);
251 return resolved_USBSpaceWire_RegisterReceiveOnAllPorts(hDevice);
240 return 0;
252 return 0;
241 }
253 }
242
254
243
255
244 char USBSpaceWire_UnregisterReceiveOnAllPorts(star_device_handle hDevice)
256 char USBSpaceWire_UnregisterReceiveOnAllPorts(star_device_handle hDevice)
245 {
257 {
246 if(resolved_USBSpaceWire_UnregisterReceiveOnAllPorts!=NULL)
258 if(resolved_USBSpaceWire_UnregisterReceiveOnAllPorts!=NULL)
247 return resolved_USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice);
259 return resolved_USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice);
248 return 0;
260 return 0;
249 }
261 }
250
262
251
263
252 char USBSpaceWire_ClearEndpoints(star_device_handle hDevice)
264 char USBSpaceWire_ClearEndpoints(star_device_handle hDevice)
253 {
265 {
254 if(resolved_USBSpaceWire_ClearEndpoints!=NULL)
266 if(resolved_USBSpaceWire_ClearEndpoints!=NULL)
255 return resolved_USBSpaceWire_ClearEndpoints(hDevice);
267 return resolved_USBSpaceWire_ClearEndpoints(hDevice);
256 return 0;
268 return 0;
257 }
269 }
258
270
259
271
260 void USBSpaceWire_SetTimeout(star_device_handle hDevice, double timeout)
272 void USBSpaceWire_SetTimeout(star_device_handle hDevice, double timeout)
261 {
273 {
262 if(resolved_USBSpaceWire_SetTimeout!=NULL)
274 if(resolved_USBSpaceWire_SetTimeout!=NULL)
263 resolved_USBSpaceWire_SetTimeout(hDevice,timeout);
275 resolved_USBSpaceWire_SetTimeout(hDevice,timeout);
264 }
276 }
265
277
266
278
267 char USBSpaceWire_TC_Reset(star_device_handle hDevice)
279 char USBSpaceWire_TC_Reset(star_device_handle hDevice)
268 {
280 {
269 if(resolved_USBSpaceWire_TC_Reset!=NULL)
281 if(resolved_USBSpaceWire_TC_Reset!=NULL)
270 return resolved_USBSpaceWire_TC_Reset(hDevice);
282 return resolved_USBSpaceWire_TC_Reset(hDevice);
271 return 0;
283 return 0;
272 }
284 }
273
285
274
286
275 char USBSpaceWire_TC_EnableExternalTimecodeSelection(star_device_handle hDevice, char enable)
287 char USBSpaceWire_TC_EnableExternalTimecodeSelection(star_device_handle hDevice, char enable)
276 {
288 {
277 if(resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection!=NULL)
289 if(resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection!=NULL)
278 return resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection(hDevice,enable);
290 return resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection(hDevice,enable);
279 return 0;
291 return 0;
280 }
292 }
281
293
282
294
283 U32 USBSpaceWire_TC_GetClockFrequency(star_device_handle hDevice)
295 U32 USBSpaceWire_TC_GetClockFrequency(star_device_handle hDevice)
284 {
296 {
285 if(resolved_USBSpaceWire_TC_GetClockFrequency!=NULL)
297 if(resolved_USBSpaceWire_TC_GetClockFrequency!=NULL)
286 return resolved_USBSpaceWire_TC_GetClockFrequency(hDevice);
298 return resolved_USBSpaceWire_TC_GetClockFrequency(hDevice);
287 return 0;
299 return 0;
288 }
300 }
289
301
290
302
291 char USBSpaceWire_TC_SetAutoTickInFrequency(star_device_handle hDevice, U32 frequency)
303 char USBSpaceWire_TC_SetAutoTickInFrequency(star_device_handle hDevice, U32 frequency)
292 {
304 {
293 if(resolved_USBSpaceWire_TC_SetAutoTickInFrequency!=NULL)
305 if(resolved_USBSpaceWire_TC_SetAutoTickInFrequency!=NULL)
294 return resolved_USBSpaceWire_TC_SetAutoTickInFrequency(hDevice,frequency);
306 return resolved_USBSpaceWire_TC_SetAutoTickInFrequency(hDevice,frequency);
295 return 0;
307 return 0;
296 }
308 }
297
309
298
310
299 char USBSpaceWire_TC_EnableAutoTickIn(star_device_handle hDevice, char enableAutoTickIns, char enableAllPorts)
311 char USBSpaceWire_TC_EnableAutoTickIn(star_device_handle hDevice, char enableAutoTickIns, char enableAllPorts)
300 {
312 {
301 if(resolved_USBSpaceWire_TC_EnableAutoTickIn!=NULL)
313 if(resolved_USBSpaceWire_TC_EnableAutoTickIn!=NULL)
302 return resolved_USBSpaceWire_TC_EnableAutoTickIn(hDevice,enableAutoTickIns,enableAllPorts);
314 return resolved_USBSpaceWire_TC_EnableAutoTickIn(hDevice,enableAutoTickIns,enableAllPorts);
303 return 0;
315 return 0;
304 }
316 }
305
317
306
318
307 char USBSpaceWire_TC_PerformTickIn(star_device_handle hDevice, U8 timein)
319 char USBSpaceWire_TC_PerformTickIn(star_device_handle hDevice, U8 timein)
308 {
320 {
309 if(resolved_USBSpaceWire_TC_PerformTickIn!=NULL)
321 if(resolved_USBSpaceWire_TC_PerformTickIn!=NULL)
310 return resolved_USBSpaceWire_TC_PerformTickIn(hDevice,timein);
322 return resolved_USBSpaceWire_TC_PerformTickIn(hDevice,timein);
311 return 0;
323 return 0;
312 }
324 }
313
325
314
326
315 U32 USBSpaceWire_GetDriverSendBufferSize(star_device_handle hDevice)
327 U32 USBSpaceWire_GetDriverSendBufferSize(star_device_handle hDevice)
316 {
328 {
317 if(resolved_USBSpaceWire_GetDriverSendBufferSize!=NULL)
329 if(resolved_USBSpaceWire_GetDriverSendBufferSize!=NULL)
318 return resolved_USBSpaceWire_GetDriverSendBufferSize(hDevice);
330 return resolved_USBSpaceWire_GetDriverSendBufferSize(hDevice);
319 return 0;
331 return 0;
320 }
332 }
321
333
322
334
323 U32 USBSpaceWire_GetDriverReadBufferSize(star_device_handle hDevice)
335 U32 USBSpaceWire_GetDriverReadBufferSize(star_device_handle hDevice)
324 {
336 {
325 if(resolved_USBSpaceWire_GetDriverReadBufferSize!=NULL)
337 if(resolved_USBSpaceWire_GetDriverReadBufferSize!=NULL)
326 return resolved_USBSpaceWire_GetDriverReadBufferSize(hDevice);
338 return resolved_USBSpaceWire_GetDriverReadBufferSize(hDevice);
327 return 0;
339 return 0;
328 }
340 }
329
341
330
342
331 char USBSpaceWire_IsReadThrottling(star_device_handle hDevice)
343 char USBSpaceWire_IsReadThrottling(star_device_handle hDevice)
332 {
344 {
333 if(resolved_USBSpaceWire_IsReadThrottling!=NULL)
345 if(resolved_USBSpaceWire_IsReadThrottling!=NULL)
334 return resolved_USBSpaceWire_IsReadThrottling(hDevice);
346 return resolved_USBSpaceWire_IsReadThrottling(hDevice);
335 return 0;
347 return 0;
336 }
348 }
337
349
338
350
339 char USBSpaceWire_WaitOnReadPacketAvailable(star_device_handle hDevice, double timeout)
351 char USBSpaceWire_WaitOnReadPacketAvailable(star_device_handle hDevice, double timeout)
340 {
352 {
341 if(resolved_USBSpaceWire_WaitOnReadPacketAvailable!=NULL)
353 if(resolved_USBSpaceWire_WaitOnReadPacketAvailable!=NULL)
342 return resolved_USBSpaceWire_WaitOnReadPacketAvailable(hDevice,timeout);
354 return resolved_USBSpaceWire_WaitOnReadPacketAvailable(hDevice,timeout);
343 return 0;
355 return 0;
344 }
356 }
345
357
346
358
347 USB_SPACEWIRE_STATUS USBSpaceWire_SendPacket(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, char bWait, USB_SPACEWIRE_ID *identifier)
359 USB_SPACEWIRE_STATUS USBSpaceWire_SendPacket(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, char bWait, USB_SPACEWIRE_ID *identifier)
348 {
360 {
349 if(resolved_USBSpaceWire_SendPacket!=NULL)
361 if(resolved_USBSpaceWire_SendPacket!=NULL)
350 return resolved_USBSpaceWire_SendPacket(hDevice,pBuffer,nBufferSize,bWait,identifier);
362 return resolved_USBSpaceWire_SendPacket(hDevice,pBuffer,nBufferSize,bWait,identifier);
351 return TRANSFER_ERROR_USB_ERROR;
363 return TRANSFER_ERROR_USB_ERROR;
352 }
364 }
353
365
354
366
355 char USBSpaceWire_FreeSend(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)
367 char USBSpaceWire_FreeSend(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)
356 {
368 {
357 if(resolved_USBSpaceWire_FreeSend!=NULL)
369 if(resolved_USBSpaceWire_FreeSend!=NULL)
358 return resolved_USBSpaceWire_FreeSend(hDevice,identifier);
370 return resolved_USBSpaceWire_FreeSend(hDevice,identifier);
359 return 0;
371 return 0;
360 }
372 }
361
373
362
374
363 USB_SPACEWIRE_STATUS USBSpaceWire_ReadPackets(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, U32 nPacketNum, char bWait, PUSB_SPACEWIRE_PACKET_PROPERTIES properties, USB_SPACEWIRE_ID *identifier)
375 USB_SPACEWIRE_STATUS USBSpaceWire_ReadPackets(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, U32 nPacketNum, char bWait, PUSB_SPACEWIRE_PACKET_PROPERTIES properties, USB_SPACEWIRE_ID *identifier)
364 {
376 {
365 if(resolved_USBSpaceWire_ReadPackets!=NULL)
377 if(resolved_USBSpaceWire_ReadPackets!=NULL)
366 return resolved_USBSpaceWire_ReadPackets(hDevice,pBuffer,nBufferSize, nPacketNum,bWait, properties,identifier);
378 return resolved_USBSpaceWire_ReadPackets(hDevice,pBuffer,nBufferSize, nPacketNum,bWait, properties,identifier);
367 return TRANSFER_ERROR_USB_ERROR;
379 return TRANSFER_ERROR_USB_ERROR;
368 }
380 }
369
381
370
382
371 char USBSpaceWire_FreeRead(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)
383 char USBSpaceWire_FreeRead(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)
372 {
384 {
373 if(resolved_USBSpaceWire_FreeRead!=NULL)
385 if(resolved_USBSpaceWire_FreeRead!=NULL)
374 return resolved_USBSpaceWire_FreeRead(hDevice,identifier);
386 return resolved_USBSpaceWire_FreeRead(hDevice,identifier);
375 return 0;
387 return 0;
376 }
388 }
377
389
378
390
379 SPACEWIRE_TRAFFIC_TYPE USBSpaceWire_GetReadTrafficType(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)
391 SPACEWIRE_TRAFFIC_TYPE USBSpaceWire_GetReadTrafficType(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)
380 {
392 {
381 if(resolved_USBSpaceWire_GetReadTrafficType!=NULL)
393 if(resolved_USBSpaceWire_GetReadTrafficType!=NULL)
382 return resolved_USBSpaceWire_GetReadTrafficType(pProperties,nPacketNum);
394 return resolved_USBSpaceWire_GetReadTrafficType(pProperties,nPacketNum);
383 return SPACEWIRE_TRAFFIC_UNKNOWN;
395 return SPACEWIRE_TRAFFIC_UNKNOWN;
384 }
396 }
385
397
386
398
387 USB_SPACEWIRE_EOP_TYPE USBSpaceWire_GetReadEOPStatus(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)
399 USB_SPACEWIRE_EOP_TYPE USBSpaceWire_GetReadEOPStatus(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)
388 {
400 {
389 if(resolved_USBSpaceWire_GetReadEOPStatus!=NULL)
401 if(resolved_USBSpaceWire_GetReadEOPStatus!=NULL)
390 return resolved_USBSpaceWire_GetReadEOPStatus(pProperties,nPacketNum);
402 return resolved_USBSpaceWire_GetReadEOPStatus(pProperties,nPacketNum);
391 return SPACEWIRE_USB_NO_EOP;
403 return SPACEWIRE_USB_NO_EOP;
392 }
404 }
393
405
394
406
395 void CFGSpaceWire_EnableRMAP(char useRMAP)
407 void CFGSpaceWire_EnableRMAP(char useRMAP)
396 {
408 {
397 if(resolved_CFGSpaceWire_EnableRMAP!=NULL)
409 if(resolved_CFGSpaceWire_EnableRMAP!=NULL)
398 resolved_CFGSpaceWire_EnableRMAP(useRMAP);
410 resolved_CFGSpaceWire_EnableRMAP(useRMAP);
399 }
411 }
400
412
401
413
402 void CFGSpaceWire_SetRMAPDestinationKey(U8 destinationKey)
414 void CFGSpaceWire_SetRMAPDestinationKey(U8 destinationKey)
403 {
415 {
404 if(resolved_CFGSpaceWire_SetRMAPDestinationKey!=NULL)
416 if(resolved_CFGSpaceWire_SetRMAPDestinationKey!=NULL)
405 resolved_CFGSpaceWire_SetRMAPDestinationKey(destinationKey);
417 resolved_CFGSpaceWire_SetRMAPDestinationKey(destinationKey);
406 }
418 }
407
419
408
420
409 void CFGSpaceWire_StackClear()
421 void CFGSpaceWire_StackClear()
410 {
422 {
411 if(resolved_CFGSpaceWire_StackClear!=NULL)
423 if(resolved_CFGSpaceWire_StackClear!=NULL)
412 resolved_CFGSpaceWire_StackClear();
424 resolved_CFGSpaceWire_StackClear();
413 }
425 }
414
426
415
427
416 void CFGSpaceWire_AddrStackPush(U8 dwAddress)
428 void CFGSpaceWire_AddrStackPush(U8 dwAddress)
417 {
429 {
418 if(resolved_CFGSpaceWire_AddrStackPush!=NULL)
430 if(resolved_CFGSpaceWire_AddrStackPush!=NULL)
419 resolved_CFGSpaceWire_AddrStackPush(dwAddress);
431 resolved_CFGSpaceWire_AddrStackPush(dwAddress);
420 }
432 }
421
433
422
434
423 void CFGSpaceWire_RetAddrStackPush(U8 dwAddress)
435 void CFGSpaceWire_RetAddrStackPush(U8 dwAddress)
424 {
436 {
425 if(resolved_CFGSpaceWire_RetAddrStackPush!=NULL)
437 if(resolved_CFGSpaceWire_RetAddrStackPush!=NULL)
426 resolved_CFGSpaceWire_RetAddrStackPush(dwAddress);
438 resolved_CFGSpaceWire_RetAddrStackPush(dwAddress);
427 }
439 }
428
440
429
441
430 int CFGSpaceWire_SetBrickBaseTransmitRate(star_device_handle hDevice, U32 dwBaseClk, U32 dwBaseDvdr, U32 dwEnableClk)
442 int CFGSpaceWire_SetBrickBaseTransmitRate(star_device_handle hDevice, U32 dwBaseClk, U32 dwBaseDvdr, U32 dwEnableClk)
431 {
443 {
432 if(resolved_CFGSpaceWire_SetBrickBaseTransmitRate!=NULL)
444 if(resolved_CFGSpaceWire_SetBrickBaseTransmitRate!=NULL)
433 return resolved_CFGSpaceWire_SetBrickBaseTransmitRate(hDevice, dwBaseClk, dwBaseDvdr, dwEnableClk);
445 return resolved_CFGSpaceWire_SetBrickBaseTransmitRate(hDevice, dwBaseClk, dwBaseDvdr, dwEnableClk);
434 return 0;
446 return 0;
435 }
447 }
436
448
437
449
438 int CFGSpaceWire_GetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 *dwStatusControl)
450 int CFGSpaceWire_GetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 *dwStatusControl)
439 {
451 {
440 if(resolved_CFGSpaceWire_GetLinkStatusControl!=NULL)
452 if(resolved_CFGSpaceWire_GetLinkStatusControl!=NULL)
441 return resolved_CFGSpaceWire_GetLinkStatusControl(hDevice, dwLinkNum, dwStatusControl);
453 return resolved_CFGSpaceWire_GetLinkStatusControl(hDevice, dwLinkNum, dwStatusControl);
442 return 0;
454 return 0;
443 }
455 }
444
456
445
457
446 void CFGSpaceWire_LSEnableAutoStart(U32 *dwStatusControl, char bEnabled)
458 void CFGSpaceWire_LSEnableAutoStart(U32 *dwStatusControl, char bEnabled)
447 {
459 {
448 if(resolved_CFGSpaceWire_LSEnableAutoStart!=NULL)
460 if(resolved_CFGSpaceWire_LSEnableAutoStart!=NULL)
449 resolved_CFGSpaceWire_LSEnableAutoStart(dwStatusControl, bEnabled);
461 resolved_CFGSpaceWire_LSEnableAutoStart(dwStatusControl, bEnabled);
450 }
462 }
451
463
452
464
453 void CFGSpaceWire_LSEnableStart(U32 *dwStatusControl, char bEnabled)
465 void CFGSpaceWire_LSEnableStart(U32 *dwStatusControl, char bEnabled)
454 {
466 {
455 if(resolved_CFGSpaceWire_LSEnableStart!=NULL)
467 if(resolved_CFGSpaceWire_LSEnableStart!=NULL)
456 resolved_CFGSpaceWire_LSEnableStart(dwStatusControl, bEnabled);
468 resolved_CFGSpaceWire_LSEnableStart(dwStatusControl, bEnabled);
457 }
469 }
458
470
459
471
460 void CFGSpaceWire_LSEnableDisabled(U32 *dwStatusControl, char bEnabled)
472 void CFGSpaceWire_LSEnableDisabled(U32 *dwStatusControl, char bEnabled)
461 {
473 {
462 if(resolved_CFGSpaceWire_LSEnableDisabled!=NULL)
474 if(resolved_CFGSpaceWire_LSEnableDisabled!=NULL)
463 resolved_CFGSpaceWire_LSEnableDisabled(dwStatusControl, bEnabled);
475 resolved_CFGSpaceWire_LSEnableDisabled(dwStatusControl, bEnabled);
464 }
476 }
465
477
466
478
467 void CFGSpaceWire_LSEnableTristate(U32 *dwStatusControl, char bEnabled)
479 void CFGSpaceWire_LSEnableTristate(U32 *dwStatusControl, char bEnabled)
468 {
480 {
469 if(resolved_CFGSpaceWire_LSEnableTristate!=NULL)
481 if(resolved_CFGSpaceWire_LSEnableTristate!=NULL)
470 resolved_CFGSpaceWire_LSEnableTristate(dwStatusControl, bEnabled);
482 resolved_CFGSpaceWire_LSEnableTristate(dwStatusControl, bEnabled);
471 }
483 }
472
484
473
485
474 void CFGSpaceWire_LSPortType(U32 dwStatusControl, U32 *dwPortType)
486 void CFGSpaceWire_LSPortType(U32 dwStatusControl, U32 *dwPortType)
475 {
487 {
476 if(resolved_CFGSpaceWire_LSPortType!=NULL)
488 if(resolved_CFGSpaceWire_LSPortType!=NULL)
477 resolved_CFGSpaceWire_LSPortType(dwStatusControl, dwPortType);
489 resolved_CFGSpaceWire_LSPortType(dwStatusControl, dwPortType);
478 }
490 }
479
491
480
492
481 void CFGSpaceWire_LSSetOperatingSpeed(U32 *dwStatusControl, U32 dwOperatingSpeed)
493 void CFGSpaceWire_LSSetOperatingSpeed(U32 *dwStatusControl, U32 dwOperatingSpeed)
482 {
494 {
483 if(resolved_CFGSpaceWire_LSSetOperatingSpeed!=NULL)
495 if(resolved_CFGSpaceWire_LSSetOperatingSpeed!=NULL)
484 resolved_CFGSpaceWire_LSSetOperatingSpeed(dwStatusControl, dwOperatingSpeed);
496 resolved_CFGSpaceWire_LSSetOperatingSpeed(dwStatusControl, dwOperatingSpeed);
485 }
497 }
486
498
487
499
488 void CFGSpaceWire_LSConfigErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
500 void CFGSpaceWire_LSConfigErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
489 {
501 {
490 if(resolved_CFGSpaceWire_LSConfigErrorStatus!=NULL)
502 if(resolved_CFGSpaceWire_LSConfigErrorStatus!=NULL)
491 resolved_CFGSpaceWire_LSConfigErrorStatus(dwStatusControl, dwErrorStatus);
503 resolved_CFGSpaceWire_LSConfigErrorStatus(dwStatusControl, dwErrorStatus);
492 }
504 }
493
505
494
506
495 void CFGSpaceWire_LSExternalErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
507 void CFGSpaceWire_LSExternalErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
496 {
508 {
497 if(resolved_CFGSpaceWire_LSExternalErrorStatus!=NULL)
509 if(resolved_CFGSpaceWire_LSExternalErrorStatus!=NULL)
498 resolved_CFGSpaceWire_LSExternalErrorStatus(dwStatusControl, dwErrorStatus);
510 resolved_CFGSpaceWire_LSExternalErrorStatus(dwStatusControl, dwErrorStatus);
499 }
511 }
500
512
501
513
502 void CFGSpaceWire_LSErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
514 void CFGSpaceWire_LSErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
503 {
515 {
504 if(resolved_CFGSpaceWire_LSErrorStatus!=NULL)
516 if(resolved_CFGSpaceWire_LSErrorStatus!=NULL)
505 resolved_CFGSpaceWire_LSErrorStatus(dwStatusControl, dwErrorStatus);
517 resolved_CFGSpaceWire_LSErrorStatus(dwStatusControl, dwErrorStatus);
506 }
518 }
507
519
508
520
509 void CFGSpaceWire_LSLinkState(U32 dwStatusControl, U32 *dwLinkStatus)
521 void CFGSpaceWire_LSLinkState(U32 dwStatusControl, U32 *dwLinkStatus)
510 {
522 {
511 if(resolved_CFGSpaceWire_LSLinkState!=NULL)
523 if(resolved_CFGSpaceWire_LSLinkState!=NULL)
512 resolved_CFGSpaceWire_LSLinkState(dwStatusControl, dwLinkStatus);
524 resolved_CFGSpaceWire_LSLinkState(dwStatusControl, dwLinkStatus);
513 }
525 }
514
526
515
527
516 void CFGSpaceWire_LSIsLinkRunning(U32 dwStatusControl, char *isLinkRunning)
528 void CFGSpaceWire_LSIsLinkRunning(U32 dwStatusControl, char *isLinkRunning)
517 {
529 {
518 if(resolved_CFGSpaceWire_LSIsLinkRunning!=NULL)
530 if(resolved_CFGSpaceWire_LSIsLinkRunning!=NULL)
519 resolved_CFGSpaceWire_LSIsLinkRunning(dwStatusControl, isLinkRunning);
531 resolved_CFGSpaceWire_LSIsLinkRunning(dwStatusControl, isLinkRunning);
520 }
532 }
521
533
522
534
523 void CFGSpaceWire_LSIsAutoStart(U32 dwStatusControl, char *isAutoStart)
535 void CFGSpaceWire_LSIsAutoStart(U32 dwStatusControl, char *isAutoStart)
524 {
536 {
525 if(resolved_CFGSpaceWire_LSIsAutoStart!=NULL)
537 if(resolved_CFGSpaceWire_LSIsAutoStart!=NULL)
526 resolved_CFGSpaceWire_LSIsAutoStart(dwStatusControl, isAutoStart);
538 resolved_CFGSpaceWire_LSIsAutoStart(dwStatusControl, isAutoStart);
527 }
539 }
528
540
529
541
530 void CFGSpaceWire_LSIsStart(U32 dwStatusControl, char *isStart)
542 void CFGSpaceWire_LSIsStart(U32 dwStatusControl, char *isStart)
531 {
543 {
532 if(resolved_CFGSpaceWire_LSIsStart!=NULL)
544 if(resolved_CFGSpaceWire_LSIsStart!=NULL)
533 resolved_CFGSpaceWire_LSIsStart(dwStatusControl, isStart);
545 resolved_CFGSpaceWire_LSIsStart(dwStatusControl, isStart);
534 }
546 }
535
547
536
548
537 void CFGSpaceWire_LSIsDisabled(U32 dwStatusControl, char *isDisabled)
549 void CFGSpaceWire_LSIsDisabled(U32 dwStatusControl, char *isDisabled)
538 {
550 {
539 if(resolved_CFGSpaceWire_LSIsDisabled!=NULL)
551 if(resolved_CFGSpaceWire_LSIsDisabled!=NULL)
540 resolved_CFGSpaceWire_LSIsDisabled(dwStatusControl, isDisabled);
552 resolved_CFGSpaceWire_LSIsDisabled(dwStatusControl, isDisabled);
541 }
553 }
542
554
543
555
544 void CFGSpaceWire_LSIsTristate(U32 dwStatusControl, char *isTristate)
556 void CFGSpaceWire_LSIsTristate(U32 dwStatusControl, char *isTristate)
545 {
557 {
546 if(resolved_CFGSpaceWire_LSIsTristate!=NULL)
558 if(resolved_CFGSpaceWire_LSIsTristate!=NULL)
547 resolved_CFGSpaceWire_LSIsTristate(dwStatusControl, isTristate);
559 resolved_CFGSpaceWire_LSIsTristate(dwStatusControl, isTristate);
548 }
560 }
549
561
550
562
551 void CFGSpaceWire_LSOperatingSpeed(U32 dwStatusControl, U32 *dwOperatingSpeed)
563 void CFGSpaceWire_LSOperatingSpeed(U32 dwStatusControl, U32 *dwOperatingSpeed)
552 {
564 {
553 if(resolved_CFGSpaceWire_LSOperatingSpeed!=NULL)
565 if(resolved_CFGSpaceWire_LSOperatingSpeed!=NULL)
554 resolved_CFGSpaceWire_LSOperatingSpeed(dwStatusControl, dwOperatingSpeed);
566 resolved_CFGSpaceWire_LSOperatingSpeed(dwStatusControl, dwOperatingSpeed);
555 }
567 }
556
568
557
569
558 void CFGSpaceWire_LSOutputPortConnection(U32 dwStatusControl, U32 *dwOutputPortConnection)
570 void CFGSpaceWire_LSOutputPortConnection(U32 dwStatusControl, U32 *dwOutputPortConnection)
559 {
571 {
560 if(resolved_CFGSpaceWire_LSOutputPortConnection!=NULL)
572 if(resolved_CFGSpaceWire_LSOutputPortConnection!=NULL)
561 resolved_CFGSpaceWire_LSOutputPortConnection(dwStatusControl, dwOutputPortConnection);
573 resolved_CFGSpaceWire_LSOutputPortConnection(dwStatusControl, dwOutputPortConnection);
562 }
574 }
563
575
564
576
565 int CFGSpaceWire_SetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 dwStatusControl)
577 int CFGSpaceWire_SetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 dwStatusControl)
566 {
578 {
567 if(resolved_CFGSpaceWire_SetLinkStatusControl!=NULL)
579 if(resolved_CFGSpaceWire_SetLinkStatusControl!=NULL)
568 return resolved_CFGSpaceWire_SetLinkStatusControl(hDevice, dwLinkNum, dwStatusControl);
580 return resolved_CFGSpaceWire_SetLinkStatusControl(hDevice, dwLinkNum, dwStatusControl);
569 return 0;
581 return 0;
570 }
582 }
571
583
572
584
573 int CFGSpaceWire_SetAsInterface(star_device_handle hDevice, char bEnabled, char bAddIdentifier)
585 int CFGSpaceWire_SetAsInterface(star_device_handle hDevice, char bEnabled, char bAddIdentifier)
574 {
586 {
575 if(resolved_CFGSpaceWire_SetAsInterface!=NULL)
587 if(resolved_CFGSpaceWire_SetAsInterface!=NULL)
576 return resolved_CFGSpaceWire_SetAsInterface(hDevice, bEnabled, bAddIdentifier);
588 return resolved_CFGSpaceWire_SetAsInterface(hDevice, bEnabled, bAddIdentifier);
577 return 0;
589 return 0;
578 }
590 }
579
591
580
592
581 int CFGSpaceWire_ClearRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress)
593 int CFGSpaceWire_ClearRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress)
582 {
594 {
583 if(resolved_CFGSpaceWire_ClearRoutingTableEntry!=NULL)
595 if(resolved_CFGSpaceWire_ClearRoutingTableEntry!=NULL)
584 return resolved_CFGSpaceWire_ClearRoutingTableEntry(hDevice,nLogicalAddress);
596 return resolved_CFGSpaceWire_ClearRoutingTableEntry(hDevice,nLogicalAddress);
585 return 0;
597 return 0;
586 }
598 }
587
599
588
600
589 void CFGSpaceWire_RTBuildRoutingTableEntry(U32 *dwRoutingTableEntry, U32 dwOutputPorts, char bDelHead, char bPriority)
601 void CFGSpaceWire_RTBuildRoutingTableEntry(U32 *dwRoutingTableEntry, U32 dwOutputPorts, char bDelHead, char bPriority)
590 {
602 {
591 if(resolved_CFGSpaceWire_RTBuildRoutingTableEntry!=NULL)
603 if(resolved_CFGSpaceWire_RTBuildRoutingTableEntry!=NULL)
592 resolved_CFGSpaceWire_RTBuildRoutingTableEntry(dwRoutingTableEntry, dwOutputPorts, bDelHead, bPriority);
604 resolved_CFGSpaceWire_RTBuildRoutingTableEntry(dwRoutingTableEntry, dwOutputPorts, bDelHead, bPriority);
593 }
605 }
594
606
595
607
596 int CFGSpaceWire_SetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 dwRoutingTableEntry)
608 int CFGSpaceWire_SetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 dwRoutingTableEntry)
597 {
609 {
598 if(resolved_CFGSpaceWire_SetRoutingTableEntry!=NULL)
610 if(resolved_CFGSpaceWire_SetRoutingTableEntry!=NULL)
599 return resolved_CFGSpaceWire_SetRoutingTableEntry(hDevice,nLogicalAddress, dwRoutingTableEntry);
611 return resolved_CFGSpaceWire_SetRoutingTableEntry(hDevice,nLogicalAddress, dwRoutingTableEntry);
600 return 0;
612 return 0;
601 }
613 }
602
614
603
615
604 int CFGSpaceWire_GetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 *dwRoutingTableEntry)
616 int CFGSpaceWire_GetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 *dwRoutingTableEntry)
605 {
617 {
606 if(resolved_CFGSpaceWire_GetRoutingTableEntry!=NULL)
618 if(resolved_CFGSpaceWire_GetRoutingTableEntry!=NULL)
607 return resolved_CFGSpaceWire_GetRoutingTableEntry(hDevice,nLogicalAddress, dwRoutingTableEntry);
619 return resolved_CFGSpaceWire_GetRoutingTableEntry(hDevice,nLogicalAddress, dwRoutingTableEntry);
608 return 0;
620 return 0;
609 }
621 }
610
622
611
623
612 void CFGSpaceWire_RTIsEnabled(U32 dwRoutingTableEntry, char *bEnabled)
624 void CFGSpaceWire_RTIsEnabled(U32 dwRoutingTableEntry, char *bEnabled)
613 {
625 {
614 if(resolved_CFGSpaceWire_RTIsEnabled!=NULL)
626 if(resolved_CFGSpaceWire_RTIsEnabled!=NULL)
615 resolved_CFGSpaceWire_RTIsEnabled( dwRoutingTableEntry, bEnabled);
627 resolved_CFGSpaceWire_RTIsEnabled( dwRoutingTableEntry, bEnabled);
616 }
628 }
617
629
618
630
619 void CFGSpaceWire_RTIsDelHead(U32 dwRoutingTableEntry, char *bDelHead)
631 void CFGSpaceWire_RTIsDelHead(U32 dwRoutingTableEntry, char *bDelHead)
620 {
632 {
621 if(resolved_CFGSpaceWire_RTIsDelHead!=NULL)
633 if(resolved_CFGSpaceWire_RTIsDelHead!=NULL)
622 resolved_CFGSpaceWire_RTIsDelHead( dwRoutingTableEntry, bDelHead);
634 resolved_CFGSpaceWire_RTIsDelHead( dwRoutingTableEntry, bDelHead);
623 }
635 }
624
636
625
637
626 void CFGSpaceWire_RTIsPriority(U32 dwRoutingTableEntry, char *bPriority)
638 void CFGSpaceWire_RTIsPriority(U32 dwRoutingTableEntry, char *bPriority)
627 {
639 {
628 if(resolved_CFGSpaceWire_RTIsPriority!=NULL)
640 if(resolved_CFGSpaceWire_RTIsPriority!=NULL)
629 resolved_CFGSpaceWire_RTIsPriority( dwRoutingTableEntry, bPriority);
641 resolved_CFGSpaceWire_RTIsPriority( dwRoutingTableEntry, bPriority);
630 }
642 }
631
643
632
644
633 void CFGSpaceWire_RTGetOutputPorts(U32 dwRoutingTableEntry, U32 *dwOutputPorts)
645 void CFGSpaceWire_RTGetOutputPorts(U32 dwRoutingTableEntry, U32 *dwOutputPorts)
634 {
646 {
635 if(resolved_CFGSpaceWire_RTGetOutputPorts!=NULL)
647 if(resolved_CFGSpaceWire_RTGetOutputPorts!=NULL)
636 resolved_CFGSpaceWire_RTGetOutputPorts( dwRoutingTableEntry, dwOutputPorts);
648 resolved_CFGSpaceWire_RTGetOutputPorts( dwRoutingTableEntry, dwOutputPorts);
637 }
649 }
638
650
639
651
640 int CFGSpaceWire_GetTickEnableStatus(star_device_handle hDevice, U32 *dwTickEnableStatus)
652 int CFGSpaceWire_GetTickEnableStatus(star_device_handle hDevice, U32 *dwTickEnableStatus)
641 {
653 {
642 if(resolved_CFGSpaceWire_GetTickEnableStatus!=NULL)
654 if(resolved_CFGSpaceWire_GetTickEnableStatus!=NULL)
643 return resolved_CFGSpaceWire_GetTickEnableStatus( hDevice, dwTickEnableStatus);
655 return resolved_CFGSpaceWire_GetTickEnableStatus( hDevice, dwTickEnableStatus);
644 return 0;
656 return 0;
645 }
657 }
646
658
647
659
648 int CFGSpaceWire_SetTickEnableStatus(star_device_handle hDevice, U32 dwTickEnableStatus)
660 int CFGSpaceWire_SetTickEnableStatus(star_device_handle hDevice, U32 dwTickEnableStatus)
649 {
661 {
650 if(resolved_CFGSpaceWire_SetTickEnableStatus!=NULL)
662 if(resolved_CFGSpaceWire_SetTickEnableStatus!=NULL)
651 return resolved_CFGSpaceWire_SetTickEnableStatus( hDevice, dwTickEnableStatus);
663 return resolved_CFGSpaceWire_SetTickEnableStatus( hDevice, dwTickEnableStatus);
652 return 0;
664 return 0;
653 }
665 }
@@ -1,372 +1,378
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #ifndef FAKESTARDUNDEESPWUSB_LIB_H
22 #ifndef FAKESTARDUNDEESPWUSB_LIB_H
23 #define FAKESTARDUNDEESPWUSB_LIB_H
23 #define FAKESTARDUNDEESPWUSB_LIB_H
24
24
25 typedef void *star_device_handle;
25 typedef void *star_device_handle;
26 typedef void * USB_SPACEWIRE_ID;
26 typedef void * USB_SPACEWIRE_ID;
27 typedef unsigned char U8;
27 typedef unsigned char U8;
28 typedef unsigned int U32;
28 typedef unsigned int U32;
29 //#include <spw_usb_api.h>
29 //#include <spw_usb_api.h>
30 //#include <spw_config_library.h>
30 //#include <spw_config_library.h>
31 #include <QLibrary>
31 #include <QLibrary>
32
32
33
33
34 /* Possible bit values */
34 /* Possible bit values */
35 #define BIT0 (0x00000001)
35 #define BIT0 (0x00000001)
36 #define BIT1 (0x00000002)
36 #define BIT1 (0x00000002)
37 #define BIT2 (0x00000004)
37 #define BIT2 (0x00000004)
38 #define BIT3 (0x00000008)
38 #define BIT3 (0x00000008)
39 #define BIT4 (0x00000010)
39 #define BIT4 (0x00000010)
40 #define BIT5 (0x00000020)
40 #define BIT5 (0x00000020)
41 #define BIT6 (0x00000040)
41 #define BIT6 (0x00000040)
42 #define BIT7 (0x00000080)
42 #define BIT7 (0x00000080)
43 #define BIT8 (0x00000100)
43 #define BIT8 (0x00000100)
44 #define BIT9 (0x00000200)
44 #define BIT9 (0x00000200)
45 #define BIT10 (0x00000400)
45 #define BIT10 (0x00000400)
46 #define BIT11 (0x00000800)
46 #define BIT11 (0x00000800)
47 #define BIT12 (0x00001000)
47 #define BIT12 (0x00001000)
48 #define BIT13 (0x00002000)
48 #define BIT13 (0x00002000)
49 #define BIT14 (0x00004000)
49 #define BIT14 (0x00004000)
50 #define BIT15 (0x00008000)
50 #define BIT15 (0x00008000)
51 #define BIT16 (0x00010000)
51 #define BIT16 (0x00010000)
52 #define BIT17 (0x00020000)
52 #define BIT17 (0x00020000)
53 #define BIT18 (0x00040000)
53 #define BIT18 (0x00040000)
54 #define BIT19 (0x00080000)
54 #define BIT19 (0x00080000)
55 #define BIT20 (0x00100000)
55 #define BIT20 (0x00100000)
56 #define BIT21 (0x00200000)
56 #define BIT21 (0x00200000)
57 #define BIT22 (0x00400000)
57 #define BIT22 (0x00400000)
58 #define BIT23 (0x00800000)
58 #define BIT23 (0x00800000)
59 #define BIT24 (0x01000000)
59 #define BIT24 (0x01000000)
60 #define BIT25 (0x02000000)
60 #define BIT25 (0x02000000)
61 #define BIT26 (0x04000000)
61 #define BIT26 (0x04000000)
62 #define BIT27 (0x08000000)
62 #define BIT27 (0x08000000)
63 #define BIT28 (0x10000000)
63 #define BIT28 (0x10000000)
64 #define BIT29 (0x20000000)
64 #define BIT29 (0x20000000)
65 #define BIT30 (0x40000000)
65 #define BIT30 (0x40000000)
66 #define BIT31 (0x80000000)
66 #define BIT31 (0x80000000)
67
67
68 /* SpaceWire Port errors */
68 /* SpaceWire Port errors */
69 #define CFG_SPACEWIRE_NO_ERRORS (0)
69 #define CFG_SPACEWIRE_NO_ERRORS (0)
70 #define CFG_SPACEWIRE_ERROR_ACTIVE (BIT0)
70 #define CFG_SPACEWIRE_ERROR_ACTIVE (BIT0)
71 #define CFG_SPACEWIRE_PACKET_ADDRESS_ERROR (BIT1)
71 #define CFG_SPACEWIRE_PACKET_ADDRESS_ERROR (BIT1)
72 #define CFG_SPACEWIRE_PORT_TIMEOUT_ERROR (BIT2)
72 #define CFG_SPACEWIRE_PORT_TIMEOUT_ERROR (BIT2)
73 #define CFG_SPACEWIRE_DISCONNECT_ERROR (BIT3)
73 #define CFG_SPACEWIRE_DISCONNECT_ERROR (BIT3)
74 #define CFG_SPACEWIRE_PARITY_ERROR (BIT4)
74 #define CFG_SPACEWIRE_PARITY_ERROR (BIT4)
75 #define CFG_SPACEWIRE_ESCAPE_ERROR (BIT5)
75 #define CFG_SPACEWIRE_ESCAPE_ERROR (BIT5)
76 #define CFG_SPACEWIRE_CREDIT_ERROR (BIT6)
76 #define CFG_SPACEWIRE_CREDIT_ERROR (BIT6)
77 #define CFG_SPACEWIRE_CHARACTER_SEQUENCE_ERROR (BIT7)
77 #define CFG_SPACEWIRE_CHARACTER_SEQUENCE_ERROR (BIT7)
78 #define CFG_SPACEWIRE_ERROR_BITS (BIT0 | BIT1 | BIT2 | BIT3 | \
78 #define CFG_SPACEWIRE_ERROR_BITS (BIT0 | BIT1 | BIT2 | BIT3 | \
79 BIT4 | BIT5 | BIT6 | BIT7)
79 BIT4 | BIT5 | BIT6 | BIT7)
80
80
81 /* Config Port errors */
81 /* Config Port errors */
82 #define CFG_CONFIG_NO_ERRORS (0)
82 #define CFG_CONFIG_NO_ERRORS (0)
83 #define CFG_CONFIG_ERROR_ACTIVE (BIT0)
83 #define CFG_CONFIG_ERROR_ACTIVE (BIT0)
84
84
85 /* Config Port errors (non-RMAP) */
85 /* Config Port errors (non-RMAP) */
86 #define CFG_CONFIG_PACKET_ADDRESS_ERROR (BIT1)
86 #define CFG_CONFIG_PACKET_ADDRESS_ERROR (BIT1)
87 #define CFG_CONFIG_PORT_TIMEOUT_ERROR (BIT2)
87 #define CFG_CONFIG_PORT_TIMEOUT_ERROR (BIT2)
88 #define CFG_CONFIG_CHECKSUM_ERROR (BIT3)
88 #define CFG_CONFIG_CHECKSUM_ERROR (BIT3)
89 #define CFG_CONFIG_TOO_SHORT_ERROR (BIT4)
89 #define CFG_CONFIG_TOO_SHORT_ERROR (BIT4)
90 #define CFG_CONFIG_TOO_LONG_ERROR (BIT5)
90 #define CFG_CONFIG_TOO_LONG_ERROR (BIT5)
91 #define CFG_CONFIG_PACKET_EEP_ERROR (BIT6)
91 #define CFG_CONFIG_PACKET_EEP_ERROR (BIT6)
92 #define CFG_CONFIG_PROTOCOL_BYTE_ERROR (BIT7)
92 #define CFG_CONFIG_PROTOCOL_BYTE_ERROR (BIT7)
93 #define CFG_CONFIG_INVALID_REGISTER_ERROR (BIT8)
93 #define CFG_CONFIG_INVALID_REGISTER_ERROR (BIT8)
94 #define CFG_CONFIG_ERROR_BITS (BIT0 | BIT1 | BIT2 | BIT3 | \
94 #define CFG_CONFIG_ERROR_BITS (BIT0 | BIT1 | BIT2 | BIT3 | \
95 BIT4 | BIT5 | BIT6 | BIT7 | \
95 BIT4 | BIT5 | BIT6 | BIT7 | \
96 BIT8)
96 BIT8)
97
97
98 /* Config Port errors (RMAP) */
98 /* Config Port errors (RMAP) */
99 #define CFG_CONFIG_RMAP_PORT_TIMEOUT_ERROR (BIT1)
99 #define CFG_CONFIG_RMAP_PORT_TIMEOUT_ERROR (BIT1)
100 #define CFG_CONFIG_RMAP_INVALID_HEADER_CRC (BIT2)
100 #define CFG_CONFIG_RMAP_INVALID_HEADER_CRC (BIT2)
101 #define CFG_CONFIG_RMAP_INVALID_DATA_CRC (BIT3)
101 #define CFG_CONFIG_RMAP_INVALID_DATA_CRC (BIT3)
102 #define CFG_CONFIG_RMAP_INVALID_DESTINATION_KEY (BIT4)
102 #define CFG_CONFIG_RMAP_INVALID_DESTINATION_KEY (BIT4)
103 #define CFG_CONFIG_RMAP_COMMAND_NOT_IMPLEMENTED (BIT5)
103 #define CFG_CONFIG_RMAP_COMMAND_NOT_IMPLEMENTED (BIT5)
104 #define CFG_CONFIG_RMAP_INVALID_DATA_LENGTH (BIT6)
104 #define CFG_CONFIG_RMAP_INVALID_DATA_LENGTH (BIT6)
105 #define CFG_CONFIG_RMAP_INVALID_RMW_DATA_LENGTH (BIT7)
105 #define CFG_CONFIG_RMAP_INVALID_RMW_DATA_LENGTH (BIT7)
106 #define CFG_CONFIG_RMAP_INVALID_DESTINATION_ADDRESS (BIT8)
106 #define CFG_CONFIG_RMAP_INVALID_DESTINATION_ADDRESS (BIT8)
107 #define CFG_CONFIG_RMAP_EARLY_EOP (BIT9)
107 #define CFG_CONFIG_RMAP_EARLY_EOP (BIT9)
108 #define CFG_CONFIG_RMAP_LATE_EOP (BIT10)
108 #define CFG_CONFIG_RMAP_LATE_EOP (BIT10)
109 #define CFG_CONFIG_RMAP_EARLY_EEP (BIT11)
109 #define CFG_CONFIG_RMAP_EARLY_EEP (BIT11)
110 #define CFG_CONFIG_RMAP_LATE_EEP (BIT12)
110 #define CFG_CONFIG_RMAP_LATE_EEP (BIT12)
111 #define CFG_CONFIG_RMAP_VERIFY_BUFFER_OVERRUN_ERROR (BIT13)
111 #define CFG_CONFIG_RMAP_VERIFY_BUFFER_OVERRUN_ERROR (BIT13)
112 #define CFG_CONFIG_RMAP_INVALID_REGISTER_ADDRESS (BIT14)
112 #define CFG_CONFIG_RMAP_INVALID_REGISTER_ADDRESS (BIT14)
113 #define CFG_CONFIG_RMAP_UNSUPPORTED_PROTOCOL_ERROR (BIT15)
113 #define CFG_CONFIG_RMAP_UNSUPPORTED_PROTOCOL_ERROR (BIT15)
114 #define CFG_CONFIG_RMAP_SOURCE_LOGICAL_ADDRESS_ERROR (BIT16)
114 #define CFG_CONFIG_RMAP_SOURCE_LOGICAL_ADDRESS_ERROR (BIT16)
115 #define CFG_CONFIG_RMAP_SOURCE_PATH_ADDRESS_ERROR (BIT17)
115 #define CFG_CONFIG_RMAP_SOURCE_PATH_ADDRESS_ERROR (BIT17)
116 #define CFG_CONFIG_RMAP_CARGO_TOO_LARGE (BIT18)
116 #define CFG_CONFIG_RMAP_CARGO_TOO_LARGE (BIT18)
117 #define CFG_CONFIG_RMAP_UNUSED_COMMAND_OR_PACKET_TYPE (BIT19)
117 #define CFG_CONFIG_RMAP_UNUSED_COMMAND_OR_PACKET_TYPE (BIT19)
118 #define CFG_CONFIG_RMAP_ERROR_BITS (BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | \
118 #define CFG_CONFIG_RMAP_ERROR_BITS (BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | \
119 BIT5 | BIT6 | BIT7 | BIT8 | BIT9 | \
119 BIT5 | BIT6 | BIT7 | BIT8 | BIT9 | \
120 BIT10 | BIT11 | BIT12 | BIT13 | \
120 BIT10 | BIT11 | BIT12 | BIT13 | \
121 BIT14 | BIT15 | BIT16 | BIT17 | \
121 BIT14 | BIT15 | BIT16 | BIT17 | \
122 BIT18 | BIT19)
122 BIT18 | BIT19)
123
123
124 /* External Port errors */
124 /* External Port errors */
125 #define CFG_EXTERNAL_NO_ERRORS (0)
125 #define CFG_EXTERNAL_NO_ERRORS (0)
126 #define CFG_EXTERNAL_ERROR_ACTIVE (BIT0)
126 #define CFG_EXTERNAL_ERROR_ACTIVE (BIT0)
127 #define CFG_EXTERNAL_PACKET_ADDRESS_ERROR (BIT1)
127 #define CFG_EXTERNAL_PACKET_ADDRESS_ERROR (BIT1)
128 #define CFG_EXTERNAL_PORT_TIMEOUT_ERROR (BIT2)
128 #define CFG_EXTERNAL_PORT_TIMEOUT_ERROR (BIT2)
129 #define CFG_EXTERNAL_INPUT_BUFFER_EMPTY_ERROR (BIT3)
129 #define CFG_EXTERNAL_INPUT_BUFFER_EMPTY_ERROR (BIT3)
130 #define CFG_EXTERNAL_INPUT_BUFFER_FULL_ERROR (BIT4)
130 #define CFG_EXTERNAL_INPUT_BUFFER_FULL_ERROR (BIT4)
131 #define CFG_EXTERNAL_OUTPUT_BUFFER_EMPTY_ERROR (BIT5)
131 #define CFG_EXTERNAL_OUTPUT_BUFFER_EMPTY_ERROR (BIT5)
132 #define CFG_EXTERNAL_OUTPUT_BUFFER_FULL_ERROR (BIT6)
132 #define CFG_EXTERNAL_OUTPUT_BUFFER_FULL_ERROR (BIT6)
133 #define CFG_EXTERNAL_ERROR_BITS (BIT0 | BIT1 | BIT2 | BIT3 | \
133 #define CFG_EXTERNAL_ERROR_BITS (BIT0 | BIT1 | BIT2 | BIT3 | \
134 BIT4 | BIT5 | BIT6)
134 BIT4 | BIT5 | BIT6)
135
135
136 /* SpaceWire Port interface state */
136 /* SpaceWire Port interface state */
137 #define CFG_SPACEWIRE_ERROR_RESET (0)
137 #define CFG_SPACEWIRE_ERROR_RESET (0)
138 #define CFG_SPACEWIRE_ERROR_WAIT (BIT0)
138 #define CFG_SPACEWIRE_ERROR_WAIT (BIT0)
139 #define CFG_SPACEWIRE_READY (BIT1)
139 #define CFG_SPACEWIRE_READY (BIT1)
140 #define CFG_SPACEWIRE_STARTED (BIT1 | BIT0)
140 #define CFG_SPACEWIRE_STARTED (BIT1 | BIT0)
141 #define CFG_SPACEWIRE_CONNECTING (BIT2)
141 #define CFG_SPACEWIRE_CONNECTING (BIT2)
142 #define CFG_SPACEWIRE_RUN (BIT2 | BIT0)
142 #define CFG_SPACEWIRE_RUN (BIT2 | BIT0)
143
143
144 /* Port type */
144 /* Port type */
145 #define CFG_CONFIGURATION_PORT (0)
145 #define CFG_CONFIGURATION_PORT (0)
146 #define CFG_SPACEWIRE_SERIAL_PORT (BIT0)
146 #define CFG_SPACEWIRE_SERIAL_PORT (BIT0)
147 #define CFG_SPACEWIRE_EXTERNAL_PORT (BIT1)
147 #define CFG_SPACEWIRE_EXTERNAL_PORT (BIT1)
148
148
149 /* SpaceWire Port control bits */
149 /* SpaceWire Port control bits */
150 #define CFG_SPACEWIRE_INTERFACE_STATE_START (8)
150 #define CFG_SPACEWIRE_INTERFACE_STATE_START (8)
151 #define CFG_SPACEWIRE_INTERFACE_STATE (BIT8 | BIT9 | BIT10)
151 #define CFG_SPACEWIRE_INTERFACE_STATE (BIT8 | BIT9 | BIT10)
152 #define CFG_SPACEWIRE_RUNNING (BIT11)
152 #define CFG_SPACEWIRE_RUNNING (BIT11)
153 #define CFG_SPACEWIRE_AUTOSTART (BIT12)
153 #define CFG_SPACEWIRE_AUTOSTART (BIT12)
154 #define CFG_SPACEWIRE_START (BIT13)
154 #define CFG_SPACEWIRE_START (BIT13)
155 #define CFG_SPACEWIRE_DISABLE (BIT14)
155 #define CFG_SPACEWIRE_DISABLE (BIT14)
156 #define CFG_SPACEWIRE_TRISTATE (BIT15)
156 #define CFG_SPACEWIRE_TRISTATE (BIT15)
157 #define CFG_SPACEWIRE_RATE (BIT16 | BIT17 | BIT18 | \
157 #define CFG_SPACEWIRE_RATE (BIT16 | BIT17 | BIT18 | \
158 BIT19 | BIT20 | BIT21 | BIT22)
158 BIT19 | BIT20 | BIT21 | BIT22)
159 #define CFG_SPACEWIRE_RATE_START (16)
159 #define CFG_SPACEWIRE_RATE_START (16)
160
160
161 /* Bits in the GAR Table */
161 /* Bits in the GAR Table */
162 #define CFG_GAR_OUTPUT_PORTS_START (1)
162 #define CFG_GAR_OUTPUT_PORTS_START (1)
163 #define CFG_GAR_OUTPUT_PORTS (BIT1 | BIT2 | BIT3 | BIT4 | BIT5 | \
163 #define CFG_GAR_OUTPUT_PORTS (BIT1 | BIT2 | BIT3 | BIT4 | BIT5 | \
164 BIT6 | BIT7 | BIT8 | BIT9 | BIT10 | BIT11 | BIT12 | BIT13 | BIT14 | \
164 BIT6 | BIT7 | BIT8 | BIT9 | BIT10 | BIT11 | BIT12 | BIT13 | BIT14 | \
165 BIT15 | BIT16 | BIT17 | BIT18 | BIT19 | BIT20 | BIT21 | BIT22 | \
165 BIT15 | BIT16 | BIT17 | BIT18 | BIT19 | BIT20 | BIT21 | BIT22 | \
166 BIT23 | BIT24 | BIT25 | BIT26 | BIT27 | BIT28)
166 BIT23 | BIT24 | BIT25 | BIT26 | BIT27 | BIT28)
167 #define CFG_GAR_DEL_HEAD (BIT29)
167 #define CFG_GAR_DEL_HEAD (BIT29)
168 #define CFG_GAR_PRIORITY (BIT30)
168 #define CFG_GAR_PRIORITY (BIT30)
169 #define CFG_GAR_INVALID_ADDR (BIT31)
169 #define CFG_GAR_INVALID_ADDR (BIT31)
170
170
171 /* Bits in the router control register */
171 /* Bits in the router control register */
172 #define CFG_RC_TIMEOUT_ENABLE_START (0)
172 #define CFG_RC_TIMEOUT_ENABLE_START (0)
173 #define CFG_RC_TIMEOUT_ENABLE (BIT0)
173 #define CFG_RC_TIMEOUT_ENABLE (BIT0)
174 #define CFG_RC_TIMEOUT_VALUE_START (1)
174 #define CFG_RC_TIMEOUT_VALUE_START (1)
175 #define CFG_RC_TIMEOUT_VALUE (BIT1 | BIT2 | BIT3)
175 #define CFG_RC_TIMEOUT_VALUE (BIT1 | BIT2 | BIT3)
176 #define CFG_RC_DISABLE_ON_SILENCE (BIT4)
176 #define CFG_RC_DISABLE_ON_SILENCE (BIT4)
177 #define CFG_RC_DISABLE_ON_SILENCE_START (4)
177 #define CFG_RC_DISABLE_ON_SILENCE_START (4)
178 #define CFG_RC_START_ON_REQUEST (BIT5)
178 #define CFG_RC_START_ON_REQUEST (BIT5)
179 #define CFG_RC_START_ON_REQUEST_START (5)
179 #define CFG_RC_START_ON_REQUEST_START (5)
180 #define CFG_RC_SELF_ADDRESSING (BIT6)
180 #define CFG_RC_SELF_ADDRESSING (BIT6)
181 #define CFG_RC_SELF_ADDRESSING_START (6)
181 #define CFG_RC_SELF_ADDRESSING_START (6)
182 #define CFG_RC_INTERFACE (BIT7)
182 #define CFG_RC_INTERFACE (BIT7)
183 #define CFG_RC_INTERFACE_START (7)
183 #define CFG_RC_INTERFACE_START (7)
184 #define CFG_RC_INTERFACE_IDENT (BIT8)
184 #define CFG_RC_INTERFACE_IDENT (BIT8)
185 #define CFG_RC_INTERFACE_IDENT_START (8)
185 #define CFG_RC_INTERFACE_IDENT_START (8)
186
186
187 /* The bits shared by all ports */
187 /* The bits shared by all ports */
188 #define CFG_PORT_CONNECTION (BIT24 | BIT25 | BIT26 | BIT27 | BIT28)
188 #define CFG_PORT_CONNECTION (BIT24 | BIT25 | BIT26 | BIT27 | BIT28)
189 #define CFG_PORT_CONNECTION_START (24)
189 #define CFG_PORT_CONNECTION_START (24)
190 #define CFG_PORT_TYPE (BIT29 | BIT30 | BIT31)
190 #define CFG_PORT_TYPE (BIT29 | BIT30 | BIT31)
191 #define CFG_PORT_TYPE_START (29)
191 #define CFG_PORT_TYPE_START (29)
192
192
193 /* Network discovery register values */
193 /* Network discovery register values */
194 #define CFG_NETD_TYPE (BIT0 | BIT1 | BIT2 | BIT3)
194 #define CFG_NETD_TYPE (BIT0 | BIT1 | BIT2 | BIT3)
195 #define CFG_NETD_TYPE_START (0)
195 #define CFG_NETD_TYPE_START (0)
196 #define CFG_NETD_RETURN_PORT (BIT4 | BIT5 | BIT6 | BIT7)
196 #define CFG_NETD_RETURN_PORT (BIT4 | BIT5 | BIT6 | BIT7)
197 #define CFG_NETD_RETURN_PORT_START (4)
197 #define CFG_NETD_RETURN_PORT_START (4)
198 #define CFG_NETD_RUNNING_PORTS (BIT8 | BIT9 | BIT10 | BIT11 | BIT12 | \
198 #define CFG_NETD_RUNNING_PORTS (BIT8 | BIT9 | BIT10 | BIT11 | BIT12 | \
199 BIT13 | BIT14 | BIT15 | BIT16 | BIT17 | BIT18 | BIT19 | BIT20 | \
199 BIT13 | BIT14 | BIT15 | BIT16 | BIT17 | BIT18 | BIT19 | BIT20 | \
200 BIT21 | BIT22 | BIT23 | BIT24 | BIT25 | BIT26 | BIT27 | BIT28 | \
200 BIT21 | BIT22 | BIT23 | BIT24 | BIT25 | BIT26 | BIT27 | BIT28 | \
201 BIT29 | BIT30 | BIT31)
201 BIT29 | BIT30 | BIT31)
202 #define CFG_NETD_RUNNING_PORTS_START (8)
202 #define CFG_NETD_RUNNING_PORTS_START (8)
203
203
204 /* Values in the ID register */
204 /* Values in the ID register */
205 #define CFG_ID_VERSION (BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | \
205 #define CFG_ID_VERSION (BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | \
206 BIT5 | BIT6 | BIT7)
206 BIT5 | BIT6 | BIT7)
207 #define CFG_ID_VERSION_START (0)
207 #define CFG_ID_VERSION_START (0)
208 #define CFG_ID_CHIP (BIT8 | BIT9 | BIT10 | BIT11 | BIT12 | \
208 #define CFG_ID_CHIP (BIT8 | BIT9 | BIT10 | BIT11 | BIT12 | \
209 BIT13 | BIT14 | BIT15)
209 BIT13 | BIT14 | BIT15)
210 #define CFG_ID_CHIP_START (8)
210 #define CFG_ID_CHIP_START (8)
211 #define CFG_ID_MANUFACTURER (BIT16 | BIT17 | BIT18 | BIT19 | \
211 #define CFG_ID_MANUFACTURER (BIT16 | BIT17 | BIT18 | BIT19 | \
212 BIT20 | BIT21 | BIT22 | BIT23)
212 BIT20 | BIT21 | BIT22 | BIT23)
213 #define CFG_ID_MANUFACTURER_START (16)
213 #define CFG_ID_MANUFACTURER_START (16)
214
214
215 /* Values in the Time-Code register */
215 /* Values in the Time-Code register */
216 #define CFG_TC_VALUE (BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | \
216 #define CFG_TC_VALUE (BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | \
217 BIT5)
217 BIT5)
218 #define CFG_TC_VALUE_START (0)
218 #define CFG_TC_VALUE_START (0)
219 #define CFG_TC_FLAGS (BIT6 | BIT7)
219 #define CFG_TC_FLAGS (BIT6 | BIT7)
220 #define CFG_TC_FLAGS_START (6)
220 #define CFG_TC_FLAGS_START (6)
221
221
222 /* Values for the Router Base Clock Select */
222 /* Values for the Router Base Clock Select */
223 #define CFG_RTR_CLK_100_MBITS (0)
223 #define CFG_RTR_CLK_100_MBITS (0)
224 #define CFG_RTR_CLK_200_MBITS (BIT0)
224 #define CFG_RTR_CLK_200_MBITS (BIT0)
225
225
226 /* Values for the Brick Base Clock */
226 /* Values for the Brick Base Clock */
227 #define CFG_BRK_CLK_100_MHZ (0)
227 #define CFG_BRK_CLK_100_MHZ (0)
228 #define CFG_BRK_CLK_120_MHZ (BIT0)
228 #define CFG_BRK_CLK_120_MHZ (BIT0)
229 #define CFG_BRK_CLK_140_MHZ (BIT1)
229 #define CFG_BRK_CLK_140_MHZ (BIT1)
230 #define CFG_BRK_CLK_160_MHZ (BIT0 | BIT1)
230 #define CFG_BRK_CLK_160_MHZ (BIT0 | BIT1)
231 #define CFG_BRK_CLK_180_MHZ (BIT2)
231 #define CFG_BRK_CLK_180_MHZ (BIT2)
232 #define CFG_BRK_CLK_200_MHZ (BIT2 | BIT0)
232 #define CFG_BRK_CLK_200_MHZ (BIT2 | BIT0)
233
233
234 /* Values for the Brick Base Divider */
234 /* Values for the Brick Base Divider */
235 #define CFG_BRK_DVDR_1 (0)
235 #define CFG_BRK_DVDR_1 (0)
236 #define CFG_BRK_DVDR_2 (BIT0)
236 #define CFG_BRK_DVDR_2 (BIT0)
237 #define CFG_BRK_DVDR_4 (BIT1)
237 #define CFG_BRK_DVDR_4 (BIT1)
238
238
239 typedef enum
239 typedef enum
240 {
240 {
241 TRANSFER_NOT_STARTED = 0,
241 TRANSFER_NOT_STARTED = 0,
242 TRANSFER_STARTED = 1,
242 TRANSFER_STARTED = 1,
243 TRANSFER_SUCCESS = 2,
243 TRANSFER_SUCCESS = 2,
244 TRANSFER_ERROR_DISCONNECT = 3,
244 TRANSFER_ERROR_DISCONNECT = 3,
245 TRANSFER_ERROR_PARITY = 4,
245 TRANSFER_ERROR_PARITY = 4,
246 TRANSFER_ERROR_UNKNOWN = 5,
246 TRANSFER_ERROR_UNKNOWN = 5,
247 TRANSFER_ERROR_TIMEOUT = 6,
247 TRANSFER_ERROR_TIMEOUT = 6,
248 TRANSFER_ERROR_LINK_NOT_STARTED = 7,
248 TRANSFER_ERROR_LINK_NOT_STARTED = 7,
249 TRANSFER_ERROR_USER_BUFFER_LOCK_FAILED = 8,
249 TRANSFER_ERROR_USER_BUFFER_LOCK_FAILED = 8,
250 TRANSFER_ERROR_LINK_ALREADY_IN_USE = 9,
250 TRANSFER_ERROR_LINK_ALREADY_IN_USE = 9,
251 TRANSFER_ERROR_RECEIVE_BUFFER_FULL = 0xa,
251 TRANSFER_ERROR_RECEIVE_BUFFER_FULL = 0xa,
252 TRANSFER_ERROR_OUT_OF_MEMORY = 0xb,
252 TRANSFER_ERROR_OUT_OF_MEMORY = 0xb,
253 TRANSFER_ERROR_NOT_FOUND = 0xc,
253 TRANSFER_ERROR_NOT_FOUND = 0xc,
254 TRANSFER_ERROR_USB_ERROR = 0xd,
254 TRANSFER_ERROR_USB_ERROR = 0xd,
255 TRANSFER_ERROR_NOT_REGISTERED_TO_RECEIVE = 0xe
255 TRANSFER_ERROR_NOT_REGISTERED_TO_RECEIVE = 0xe
256 } USB_SPACEWIRE_STATUS, *PUSB_SPACEWIRE_STATUS;
256 } USB_SPACEWIRE_STATUS, *PUSB_SPACEWIRE_STATUS;
257
257
258 #define SPACEWIRE_USB_EOP_CHAR ((U8)0x80)
258 #define SPACEWIRE_USB_EOP_CHAR ((U8)0x80)
259 #define SPACEWIRE_USB_EEP_CHAR ((U8)0x40)
259 #define SPACEWIRE_USB_EEP_CHAR ((U8)0x40)
260
260
261 typedef enum
261 typedef enum
262 {
262 {
263 SPACEWIRE_USB_NO_EOP = 0,
263 SPACEWIRE_USB_NO_EOP = 0,
264 SPACEWIRE_USB_EOP = SPACEWIRE_USB_EOP_CHAR,
264 SPACEWIRE_USB_EOP = SPACEWIRE_USB_EOP_CHAR,
265 SPACEWIRE_USB_EEP = SPACEWIRE_USB_EEP_CHAR
265 SPACEWIRE_USB_EEP = SPACEWIRE_USB_EEP_CHAR
266 } USB_SPACEWIRE_EOP_TYPE, *PUSB_SPACEWIRE_EOP_TYPE;
266 } USB_SPACEWIRE_EOP_TYPE, *PUSB_SPACEWIRE_EOP_TYPE;
267
267
268 typedef enum
268 typedef enum
269 {
269 {
270 SPACEWIRE_TRAFFIC_UNKNOWN = -1,
270 SPACEWIRE_TRAFFIC_UNKNOWN = -1,
271 SPACEWIRE_TRAFFIC_PACKET = 0,
271 SPACEWIRE_TRAFFIC_PACKET = 0,
272 SPACEWIRE_TRAFFIC_TIMECODE = 1,
272 SPACEWIRE_TRAFFIC_TIMECODE = 1,
273 SPACEWIRE_TRAFFIC_CONTROL = 2
273 SPACEWIRE_TRAFFIC_CONTROL = 2
274 } SPACEWIRE_TRAFFIC_TYPE, *PSPACEWIRE_TRAFFIC_TYPE;
274 } SPACEWIRE_TRAFFIC_TYPE, *PSPACEWIRE_TRAFFIC_TYPE;
275
275
276 typedef struct
276 typedef struct
277 {
277 {
278 unsigned long len;
278 unsigned long len;
279 USB_SPACEWIRE_EOP_TYPE eop;
279 USB_SPACEWIRE_EOP_TYPE eop;
280 SPACEWIRE_TRAFFIC_TYPE type;
280 SPACEWIRE_TRAFFIC_TYPE type;
281 } USB_SPACEWIRE_PACKET_PROPERTIES, *PUSB_SPACEWIRE_PACKET_PROPERTIES;
281 } USB_SPACEWIRE_PACKET_PROPERTIES, *PUSB_SPACEWIRE_PACKET_PROPERTIES;
282
282
283
283
284
284
285 typedef enum
285 typedef enum
286 {
286 {
287 CFG_TRANSFER_SUCCESS = 0x00,
287 CFG_TRANSFER_SUCCESS = 0x00,
288 CFG_TRANSMIT_PACKET_FAILURE = 0x01,
288 CFG_TRANSMIT_PACKET_FAILURE = 0x01,
289 CFG_REPLY_PACKET_FAILURE = 0x02,
289 CFG_REPLY_PACKET_FAILURE = 0x02,
290 CFG_REPLY_PACKET_TOO_BIG = 0x03,
290 CFG_REPLY_PACKET_TOO_BIG = 0x03,
291 CFG_REPLY_PACKET_TOO_SMALL = 0x04,
291 CFG_REPLY_PACKET_TOO_SMALL = 0x04,
292 CFG_REPLY_PACKET_NAK = 0x05,
292 CFG_REPLY_PACKET_NAK = 0x05,
293 CFG_REPLY_PACKET_CHECKSUM_ERROR = 0x06
293 CFG_REPLY_PACKET_CHECKSUM_ERROR = 0x06
294 } CFG_SPACEWIRE_STATUS;
294 } CFG_SPACEWIRE_STATUS;
295
295
296
296
297
297
298 char USBSpaceWire_Open(star_device_handle *phDevice, int nDeviceNum);
298 char USBSpaceWire_Open(star_device_handle *phDevice, int nDeviceNum);
299 void USBSpaceWire_Close(star_device_handle hDevice);
299 void USBSpaceWire_Close(star_device_handle hDevice);
300 U32 USBSpaceWire_ListDevices();
300 U32 USBSpaceWire_ListDevices();
301 char USBSpaceWire_GetSerialNumber(star_device_handle hDevice, U8 pSerialNumber[11]);
301 char USBSpaceWire_GetSerialNumber(star_device_handle hDevice, U8 pSerialNumber[11]);
302 void USBSpaceWire_EnableNetworkMode(star_device_handle hDevice, char enable);
302 void USBSpaceWire_EnableNetworkMode(star_device_handle hDevice, char enable);
303 char USBSpaceWire_RegisterReceiveOnAllPorts(star_device_handle hDevice);
303 char USBSpaceWire_RegisterReceiveOnAllPorts(star_device_handle hDevice);
304 char USBSpaceWire_UnregisterReceiveOnAllPorts(star_device_handle hDevice);
304 char USBSpaceWire_UnregisterReceiveOnAllPorts(star_device_handle hDevice);
305 char USBSpaceWire_ClearEndpoints(star_device_handle hDevice);
305 char USBSpaceWire_ClearEndpoints(star_device_handle hDevice);
306 void USBSpaceWire_SetTimeout(star_device_handle hDevice, double timeout);
306 void USBSpaceWire_SetTimeout(star_device_handle hDevice, double timeout);
307 char USBSpaceWire_TC_Reset(star_device_handle hDevice);
307 char USBSpaceWire_TC_Reset(star_device_handle hDevice);
308 char USBSpaceWire_TC_EnableExternalTimecodeSelection(star_device_handle hDevice,char enable);
308 char USBSpaceWire_TC_EnableExternalTimecodeSelection(star_device_handle hDevice,char enable);
309 U32 USBSpaceWire_TC_GetClockFrequency(star_device_handle hDevice);
309 U32 USBSpaceWire_TC_GetClockFrequency(star_device_handle hDevice);
310 char USBSpaceWire_TC_SetAutoTickInFrequency(star_device_handle hDevice, U32 frequency);
310 char USBSpaceWire_TC_SetAutoTickInFrequency(star_device_handle hDevice, U32 frequency);
311 char USBSpaceWire_TC_EnableAutoTickIn(star_device_handle hDevice, char enableAutoTickIns, char enableAllPorts);
311 char USBSpaceWire_TC_EnableAutoTickIn(star_device_handle hDevice, char enableAutoTickIns, char enableAllPorts);
312 char USBSpaceWire_TC_PerformTickIn(star_device_handle hDevice, U8 timein);
312 char USBSpaceWire_TC_PerformTickIn(star_device_handle hDevice, U8 timein);
313 U32 USBSpaceWire_GetDriverSendBufferSize(star_device_handle hDevice);
313 U32 USBSpaceWire_GetDriverSendBufferSize(star_device_handle hDevice);
314 U32 USBSpaceWire_GetDriverReadBufferSize(star_device_handle hDevice);
314 U32 USBSpaceWire_GetDriverReadBufferSize(star_device_handle hDevice);
315 char USBSpaceWire_IsReadThrottling(star_device_handle hDevice);
315 char USBSpaceWire_IsReadThrottling(star_device_handle hDevice);
316
316
317 char USBSpaceWire_WaitOnReadPacketAvailable(star_device_handle hDevice, double timeout);
317 char USBSpaceWire_WaitOnReadPacketAvailable(star_device_handle hDevice, double timeout);
318 USB_SPACEWIRE_STATUS USBSpaceWire_SendPacket(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, char bWait,USB_SPACEWIRE_ID *identifier);
318 USB_SPACEWIRE_STATUS USBSpaceWire_SendPacket(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, char bWait,USB_SPACEWIRE_ID *identifier);
319 char USBSpaceWire_FreeSend(star_device_handle hDevice, USB_SPACEWIRE_ID identifier);
319 char USBSpaceWire_FreeSend(star_device_handle hDevice, USB_SPACEWIRE_ID identifier);
320 USB_SPACEWIRE_STATUS USBSpaceWire_ReadPackets(star_device_handle hDevice, void *pBuffer, U32 nBufferSize,U32 nPacketNum, char bWait, PUSB_SPACEWIRE_PACKET_PROPERTIES properties,USB_SPACEWIRE_ID *identifier);
320 USB_SPACEWIRE_STATUS USBSpaceWire_ReadPackets(star_device_handle hDevice, void *pBuffer, U32 nBufferSize,U32 nPacketNum, char bWait, PUSB_SPACEWIRE_PACKET_PROPERTIES properties,USB_SPACEWIRE_ID *identifier);
321 char USBSpaceWire_FreeRead(star_device_handle hDevice, USB_SPACEWIRE_ID identifier);
321 char USBSpaceWire_FreeRead(star_device_handle hDevice, USB_SPACEWIRE_ID identifier);
322 SPACEWIRE_TRAFFIC_TYPE USBSpaceWire_GetReadTrafficType(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum);
322 SPACEWIRE_TRAFFIC_TYPE USBSpaceWire_GetReadTrafficType(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum);
323 USB_SPACEWIRE_EOP_TYPE USBSpaceWire_GetReadEOPStatus(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties,U32 nPacketNum);
323 USB_SPACEWIRE_EOP_TYPE USBSpaceWire_GetReadEOPStatus(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties,U32 nPacketNum);
324
324
325 void CFGSpaceWire_EnableRMAP(char useRMAP);
325 void CFGSpaceWire_EnableRMAP(char useRMAP);
326 void CFGSpaceWire_SetRMAPDestinationKey(U8 destinationKey);
326 void CFGSpaceWire_SetRMAPDestinationKey(U8 destinationKey);
327 void CFGSpaceWire_StackClear(void);
327 void CFGSpaceWire_StackClear(void);
328 void CFGSpaceWire_AddrStackPush(U8 dwAddress);
328 void CFGSpaceWire_AddrStackPush(U8 dwAddress);
329 void CFGSpaceWire_RetAddrStackPush(U8 dwAddress);
329 void CFGSpaceWire_RetAddrStackPush(U8 dwAddress);
330 int CFGSpaceWire_SetBrickBaseTransmitRate(star_device_handle hDevice, U32 dwBaseClk, U32 dwBaseDvdr, U32 dwEnableClk);
330 int CFGSpaceWire_SetBrickBaseTransmitRate(star_device_handle hDevice, U32 dwBaseClk, U32 dwBaseDvdr, U32 dwEnableClk);
331 int CFGSpaceWire_GetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 *dwStatusControl);
331 int CFGSpaceWire_GetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 *dwStatusControl);
332 void CFGSpaceWire_LSEnableAutoStart(U32 *dwStatusControl, char bEnabled);
332 void CFGSpaceWire_LSEnableAutoStart(U32 *dwStatusControl, char bEnabled);
333 void CFGSpaceWire_LSEnableStart(U32 *dwStatusControl, char bEnabled);
333 void CFGSpaceWire_LSEnableStart(U32 *dwStatusControl, char bEnabled);
334 void CFGSpaceWire_LSEnableDisabled(U32 *dwStatusControl, char bEnabled);
334 void CFGSpaceWire_LSEnableDisabled(U32 *dwStatusControl, char bEnabled);
335 void CFGSpaceWire_LSEnableTristate(U32 *dwStatusControl, char bEnabled);
335 void CFGSpaceWire_LSEnableTristate(U32 *dwStatusControl, char bEnabled);
336 void CFGSpaceWire_LSPortType(U32 dwStatusControl, U32 *dwPortType);
336 void CFGSpaceWire_LSPortType(U32 dwStatusControl, U32 *dwPortType);
337 void CFGSpaceWire_LSSetOperatingSpeed(U32 *dwStatusControl, U32 dwOperatingSpeed);
337 void CFGSpaceWire_LSSetOperatingSpeed(U32 *dwStatusControl, U32 dwOperatingSpeed);
338 void CFGSpaceWire_LSConfigErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus);
338 void CFGSpaceWire_LSConfigErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus);
339 void CFGSpaceWire_LSExternalErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus);
339 void CFGSpaceWire_LSExternalErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus);
340 void CFGSpaceWire_LSErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus);
340 void CFGSpaceWire_LSErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus);
341 void CFGSpaceWire_LSLinkState(U32 dwStatusControl, U32 *dwLinkStatus);
341 void CFGSpaceWire_LSLinkState(U32 dwStatusControl, U32 *dwLinkStatus);
342 void CFGSpaceWire_LSIsLinkRunning(U32 dwStatusControl, char *isLinkRunning);
342 void CFGSpaceWire_LSIsLinkRunning(U32 dwStatusControl, char *isLinkRunning);
343 void CFGSpaceWire_LSIsAutoStart(U32 dwStatusControl, char *isAutoStart);
343 void CFGSpaceWire_LSIsAutoStart(U32 dwStatusControl, char *isAutoStart);
344 void CFGSpaceWire_LSIsStart(U32 dwStatusControl, char *isStart);
344 void CFGSpaceWire_LSIsStart(U32 dwStatusControl, char *isStart);
345 void CFGSpaceWire_LSIsDisabled(U32 dwStatusControl, char *isDisabled);
345 void CFGSpaceWire_LSIsDisabled(U32 dwStatusControl, char *isDisabled);
346 void CFGSpaceWire_LSIsTristate(U32 dwStatusControl, char *isTristate);
346 void CFGSpaceWire_LSIsTristate(U32 dwStatusControl, char *isTristate);
347 void CFGSpaceWire_LSOperatingSpeed(U32 dwStatusControl, U32 *dwOperatingSpeed);
347 void CFGSpaceWire_LSOperatingSpeed(U32 dwStatusControl, U32 *dwOperatingSpeed);
348 void CFGSpaceWire_LSOutputPortConnection(U32 dwStatusControl, U32 *dwOutputPortConnection);
348 void CFGSpaceWire_LSOutputPortConnection(U32 dwStatusControl, U32 *dwOutputPortConnection);
349 int CFGSpaceWire_SetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 dwStatusControl);
349 int CFGSpaceWire_SetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 dwStatusControl);
350 int CFGSpaceWire_SetAsInterface(star_device_handle hDevice, char bEnabled, char bAddIdentifier);
350 int CFGSpaceWire_SetAsInterface(star_device_handle hDevice, char bEnabled, char bAddIdentifier);
351 int CFGSpaceWire_ClearRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress);
351 int CFGSpaceWire_ClearRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress);
352 void CFGSpaceWire_RTBuildRoutingTableEntry(U32 *dwRoutingTableEntry,U32 dwOutputPorts, char bDelHead, char bPriority);
352 void CFGSpaceWire_RTBuildRoutingTableEntry(U32 *dwRoutingTableEntry,U32 dwOutputPorts, char bDelHead, char bPriority);
353 int CFGSpaceWire_SetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 dwRoutingTableEntry);
353 int CFGSpaceWire_SetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 dwRoutingTableEntry);
354 int CFGSpaceWire_GetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 *dwRoutingTableEntry);
354 int CFGSpaceWire_GetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 *dwRoutingTableEntry);
355 void CFGSpaceWire_RTIsEnabled(U32 dwRoutingTableEntry, char *bEnabled);
355 void CFGSpaceWire_RTIsEnabled(U32 dwRoutingTableEntry, char *bEnabled);
356 void CFGSpaceWire_RTIsDelHead(U32 dwRoutingTableEntry, char *bDelHead);
356 void CFGSpaceWire_RTIsDelHead(U32 dwRoutingTableEntry, char *bDelHead);
357 void CFGSpaceWire_RTIsPriority(U32 dwRoutingTableEntry, char *bPriority);
357 void CFGSpaceWire_RTIsPriority(U32 dwRoutingTableEntry, char *bPriority);
358 void CFGSpaceWire_RTGetOutputPorts(U32 dwRoutingTableEntry, U32 *dwOutputPorts);
358 void CFGSpaceWire_RTGetOutputPorts(U32 dwRoutingTableEntry, U32 *dwOutputPorts);
359 int CFGSpaceWire_GetTickEnableStatus(star_device_handle hDevice, U32 *dwTickEnableStatus);
359 int CFGSpaceWire_GetTickEnableStatus(star_device_handle hDevice, U32 *dwTickEnableStatus);
360 int CFGSpaceWire_SetTickEnableStatus(star_device_handle hDevice, U32 dwTickEnableStatus);
360 int CFGSpaceWire_SetTickEnableStatus(star_device_handle hDevice, U32 dwTickEnableStatus);
361
361
362
362 typedef struct funcToresolve
363 {
364 void (** function)();
365 const char* symbolName;
366 }funcToresolve;
363
367
364
368
365 class FakeStarDundeeSpwUSB_Lib
369 class FakeStarDundeeSpwUSB_Lib
366 {
370 {
367 public:
371 public:
368 FakeStarDundeeSpwUSB_Lib();
372 FakeStarDundeeSpwUSB_Lib();
369 static void resolve();
373 static void resolve();
374 static bool fullresolved();
375 static const QList<funcToresolve>& status();
370 };
376 };
371
377
372 #endif // FAKESTARDUNDEESPWUSB_LIB_H
378 #endif // FAKESTARDUNDEESPWUSB_LIB_H
@@ -1,305 +1,339
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
2 <ui version="4.0">
3 <class>StarDundeeUI</class>
3 <class>StarDundeeUI</class>
4 <widget class="QWidget" name="StarDundeeUI">
4 <widget class="QWidget" name="StarDundeeUI">
5 <property name="geometry">
5 <property name="geometry">
6 <rect>
6 <rect>
7 <x>0</x>
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
9 <width>397</width>
9 <width>609</width>
10 <height>506</height>
10 <height>581</height>
11 </rect>
11 </rect>
12 </property>
12 </property>
13 <property name="windowTitle">
13 <property name="windowTitle">
14 <string>Form</string>
14 <string>Form</string>
15 </property>
15 </property>
16 <layout class="QFormLayout" name="formLayout">
16 <layout class="QFormLayout" name="formLayout">
17 <item row="0" column="0">
17 <item row="7" column="0">
18 <widget class="QLabel" name="selectBrickLbl">
18 <widget class="QLabel" name="selectBrickLbl">
19 <property name="text">
19 <property name="text">
20 <string>Select Brick</string>
20 <string>Select Brick</string>
21 </property>
21 </property>
22 </widget>
22 </widget>
23 </item>
23 </item>
24 <item row="0" column="1">
24 <item row="7" column="1">
25 <widget class="QComboBox" name="selectBrickCmbx">
25 <widget class="QComboBox" name="selectBrickCmbx">
26 <property name="toolTip">
26 <property name="toolTip">
27 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the brick you want to use.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
27 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the brick you want to use.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
28 </property>
28 </property>
29 <property name="whatsThis">
29 <property name="whatsThis">
30 <string/>
30 <string/>
31 </property>
31 </property>
32 <item>
32 <item>
33 <property name="text">
33 <property name="text">
34 <string>None</string>
34 <string>None</string>
35 </property>
35 </property>
36 </item>
36 </item>
37 </widget>
37 </widget>
38 </item>
38 </item>
39 <item row="1" column="0">
39 <item row="8" column="0">
40 <widget class="QLabel" name="selectLinkLbl">
40 <widget class="QLabel" name="selectLinkLbl">
41 <property name="text">
41 <property name="text">
42 <string>Select link number</string>
42 <string>Select link number</string>
43 </property>
43 </property>
44 </widget>
44 </widget>
45 </item>
45 </item>
46 <item row="1" column="1">
46 <item row="8" column="1">
47 <widget class="QComboBox" name="selectLinkCmbx">
47 <widget class="QComboBox" name="selectLinkCmbx">
48 <property name="toolTip">
48 <property name="toolTip">
49 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the link number you want to use.&lt;/p&gt;&lt;p&gt;The link number correspond to the numbers on the brick:&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/imgs/stardundee.tif&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
49 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the link number you want to use.&lt;/p&gt;&lt;p&gt;The link number correspond to the numbers on the brick:&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/imgs/stardundee.tif&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
50 </property>
50 </property>
51 <item>
51 <item>
52 <property name="text">
52 <property name="text">
53 <string>1</string>
53 <string>1</string>
54 </property>
54 </property>
55 </item>
55 </item>
56 <item>
56 <item>
57 <property name="text">
57 <property name="text">
58 <string>2</string>
58 <string>2</string>
59 </property>
59 </property>
60 </item>
60 </item>
61 </widget>
61 </widget>
62 </item>
62 </item>
63 <item row="2" column="0">
63 <item row="9" column="0">
64 <widget class="QLabel" name="selectLinkSpeedLbl">
64 <widget class="QLabel" name="selectLinkSpeedLbl">
65 <property name="text">
65 <property name="text">
66 <string>Link Speed</string>
66 <string>Link Speed</string>
67 </property>
67 </property>
68 </widget>
68 </widget>
69 </item>
69 </item>
70 <item row="2" column="1">
70 <item row="9" column="1">
71 <widget class="QComboBox" name="setLinkSpeedCmbx">
71 <widget class="QComboBox" name="setLinkSpeedCmbx">
72 <property name="toolTip">
72 <property name="toolTip">
73 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the Space Wire link speed you want to use.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
73 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the Space Wire link speed you want to use.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
74 </property>
74 </property>
75 <item>
75 <item>
76 <property name="text">
76 <property name="text">
77 <string>10MHz</string>
77 <string>10MHz</string>
78 </property>
78 </property>
79 </item>
79 </item>
80 </widget>
80 </widget>
81 </item>
81 </item>
82 <item row="3" column="0">
82 <item row="10" column="0">
83 <widget class="QLabel" name="setDestKeyLbl">
83 <widget class="QLabel" name="setDestKeyLbl">
84 <property name="text">
84 <property name="text">
85 <string>Source address</string>
85 <string>Source address</string>
86 </property>
86 </property>
87 </widget>
87 </widget>
88 </item>
88 </item>
89 <item row="3" column="1">
89 <item row="10" column="1">
90 <widget class="QLineEdit" name="sourceAddressLineEdit">
90 <widget class="QLineEdit" name="sourceAddressLineEdit">
91 <property name="toolTip">
91 <property name="toolTip">
92 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the Space Wire Brick destination Key, the default value is 32 (0x20).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
92 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the Space Wire Brick destination Key, the default value is 32 (0x20).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
93 </property>
93 </property>
94 <property name="inputMask">
94 <property name="inputMask">
95 <string comment="ddD"/>
95 <string comment="ddD"/>
96 </property>
96 </property>
97 <property name="text">
97 <property name="text">
98 <string>32</string>
98 <string>32</string>
99 </property>
99 </property>
100 <property name="maxLength">
100 <property name="maxLength">
101 <number>3</number>
101 <number>3</number>
102 </property>
102 </property>
103 </widget>
103 </widget>
104 </item>
104 </item>
105 <item row="4" column="0">
105 <item row="11" column="0">
106 <widget class="QLabel" name="RMAPaddressLbl">
106 <widget class="QLabel" name="RMAPaddressLbl">
107 <property name="text">
107 <property name="text">
108 <string>Destination address</string>
108 <string>Destination address</string>
109 </property>
109 </property>
110 </widget>
110 </widget>
111 </item>
111 </item>
112 <item row="4" column="1">
112 <item row="11" column="1">
113 <widget class="QLineEdit" name="destinationAddressLineEdit">
113 <widget class="QLineEdit" name="destinationAddressLineEdit">
114 <property name="toolTip">
114 <property name="toolTip">
115 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the RMAP target address, this address will be used as destination address for all the RMAP transfers.&lt;/p&gt;&lt;p&gt;This is you SOC spw address.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
115 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the RMAP target address, this address will be used as destination address for all the RMAP transfers.&lt;/p&gt;&lt;p&gt;This is you SOC spw address.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
116 </property>
116 </property>
117 <property name="inputMask">
117 <property name="inputMask">
118 <string comment="ddD"/>
118 <string comment="ddD"/>
119 </property>
119 </property>
120 <property name="text">
120 <property name="text">
121 <string>254</string>
121 <string>254</string>
122 </property>
122 </property>
123 <property name="maxLength">
123 <property name="maxLength">
124 <number>3</number>
124 <number>3</number>
125 </property>
125 </property>
126 </widget>
126 </widget>
127 </item>
127 </item>
128 <item row="5" column="0">
128 <item row="12" column="0">
129 <widget class="QLabel" name="RMAPKeyLbl">
129 <widget class="QLabel" name="RMAPKeyLbl">
130 <property name="text">
130 <property name="text">
131 <string>Destination key</string>
131 <string>Destination key</string>
132 </property>
132 </property>
133 </widget>
133 </widget>
134 </item>
134 </item>
135 <item row="5" column="1">
135 <item row="12" column="1">
136 <widget class="QLineEdit" name="destinationKeyLineEdit">
136 <widget class="QLineEdit" name="destinationKeyLineEdit">
137 <property name="toolTip">
137 <property name="toolTip">
138 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the RMAP target key, this key will be used for all the RMAP transfers.&lt;/p&gt;&lt;p&gt;This is you SOC spw key.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
138 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the RMAP target key, this key will be used for all the RMAP transfers.&lt;/p&gt;&lt;p&gt;This is you SOC spw key.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
139 </property>
139 </property>
140 <property name="inputMask">
140 <property name="inputMask">
141 <string comment="ddD"/>
141 <string comment="ddD"/>
142 </property>
142 </property>
143 <property name="text">
143 <property name="text">
144 <string comment="ddD">2</string>
144 <string comment="ddD">2</string>
145 </property>
145 </property>
146 <property name="maxLength">
146 <property name="maxLength">
147 <number>3</number>
147 <number>3</number>
148 </property>
148 </property>
149 </widget>
149 </widget>
150 </item>
150 </item>
151 <item row="6" column="1">
151 <item row="13" column="1">
152 <widget class="QLineEdit" name="RMAPTimeoutLineEdit">
152 <widget class="QLineEdit" name="RMAPTimeoutLineEdit">
153 <property name="toolTip">
153 <property name="toolTip">
154 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the RMAP timeout, when waiting for a RMAP answer the driver will give up after this time if it doesn't get any answer.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
154 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the RMAP timeout, when waiting for a RMAP answer the driver will give up after this time if it doesn't get any answer.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
155 </property>
155 </property>
156 <property name="inputMethodHints">
156 <property name="inputMethodHints">
157 <set>Qt::ImhDigitsOnly</set>
157 <set>Qt::ImhDigitsOnly</set>
158 </property>
158 </property>
159 <property name="inputMask">
159 <property name="inputMask">
160 <string comment="DDdd;"/>
160 <string comment="DDdd;"/>
161 </property>
161 </property>
162 <property name="text">
162 <property name="text">
163 <string>500</string>
163 <string>500</string>
164 </property>
164 </property>
165 <property name="maxLength">
165 <property name="maxLength">
166 <number>5</number>
166 <number>5</number>
167 </property>
167 </property>
168 </widget>
168 </widget>
169 </item>
169 </item>
170 <item row="6" column="0">
170 <item row="13" column="0">
171 <widget class="QLabel" name="RMAPTimeoutLbl">
171 <widget class="QLabel" name="RMAPTimeoutLbl">
172 <property name="text">
172 <property name="text">
173 <string>RMAP timeout(ms)</string>
173 <string>RMAP timeout(ms)</string>
174 </property>
174 </property>
175 </widget>
175 </widget>
176 </item>
176 </item>
177 <item row="10" column="1">
177 <item row="17" column="1">
178 <widget class="QPushButton" name="connectQpb">
178 <widget class="QPushButton" name="connectQpb">
179 <property name="text">
179 <property name="text">
180 <string>Connect</string>
180 <string>Connect</string>
181 </property>
181 </property>
182 </widget>
182 </widget>
183 </item>
183 </item>
184 <item row="8" column="1">
184 <item row="15" column="1">
185 <widget class="QRadioButton" name="setInterfaceModeQrb">
185 <widget class="QRadioButton" name="setInterfaceModeQrb">
186 <property name="text">
186 <property name="text">
187 <string>interface mode</string>
187 <string>i&amp;nterface mode</string>
188 </property>
188 </property>
189 <property name="checked">
189 <property name="checked">
190 <bool>true</bool>
190 <bool>true</bool>
191 </property>
191 </property>
192 </widget>
192 </widget>
193 </item>
193 </item>
194 <item row="9" column="1">
194 <item row="16" column="1">
195 <widget class="QRadioButton" name="setRouterModeQrb">
195 <widget class="QRadioButton" name="setRouterModeQrb">
196 <property name="text">
196 <property name="text">
197 <string>router mode</string>
197 <string>router &amp;mode</string>
198 </property>
198 </property>
199 </widget>
199 </widget>
200 </item>
200 </item>
201 <item row="11" column="0" colspan="2">
201 <item row="18" column="0" colspan="2">
202 <layout class="QGridLayout" name="gridLayout">
202 <layout class="QGridLayout" name="gridLayout">
203 <item row="1" column="0">
203 <item row="1" column="0">
204 <widget class="QLabel" name="label_4">
204 <widget class="QLabel" name="label_4">
205 <property name="text">
205 <property name="text">
206 <string>Packets</string>
206 <string>Packets</string>
207 </property>
207 </property>
208 </widget>
208 </widget>
209 </item>
209 </item>
210 <item row="1" column="1">
210 <item row="1" column="1">
211 <widget class="QLabel" name="starDundeeReceivedPackets">
211 <widget class="QLabel" name="starDundeeReceivedPackets">
212 <property name="text">
212 <property name="text">
213 <string>-</string>
213 <string>-</string>
214 </property>
214 </property>
215 </widget>
215 </widget>
216 </item>
216 </item>
217 <item row="0" column="1">
217 <item row="0" column="1">
218 <widget class="QLabel" name="label_3">
218 <widget class="QLabel" name="label_3">
219 <property name="font">
219 <property name="font">
220 <font>
220 <font>
221 <weight>75</weight>
221 <weight>75</weight>
222 <bold>true</bold>
222 <bold>true</bold>
223 </font>
223 </font>
224 </property>
224 </property>
225 <property name="text">
225 <property name="text">
226 <string>Received</string>
226 <string>Received</string>
227 </property>
227 </property>
228 </widget>
228 </widget>
229 </item>
229 </item>
230 <item row="2" column="1">
230 <item row="2" column="1">
231 <widget class="QLabel" name="starDundeeReceivedBytes">
231 <widget class="QLabel" name="starDundeeReceivedBytes">
232 <property name="text">
232 <property name="text">
233 <string>-</string>
233 <string>-</string>
234 </property>
234 </property>
235 </widget>
235 </widget>
236 </item>
236 </item>
237 <item row="2" column="0">
237 <item row="2" column="0">
238 <widget class="QLabel" name="label_5">
238 <widget class="QLabel" name="label_5">
239 <property name="text">
239 <property name="text">
240 <string>Bytes</string>
240 <string>Bytes</string>
241 </property>
241 </property>
242 </widget>
242 </widget>
243 </item>
243 </item>
244 <item row="0" column="2">
244 <item row="0" column="2">
245 <widget class="QLabel" name="label_7">
245 <widget class="QLabel" name="label_7">
246 <property name="font">
246 <property name="font">
247 <font>
247 <font>
248 <weight>75</weight>
248 <weight>75</weight>
249 <bold>true</bold>
249 <bold>true</bold>
250 </font>
250 </font>
251 </property>
251 </property>
252 <property name="text">
252 <property name="text">
253 <string>Transmitted</string>
253 <string>Transmitted</string>
254 </property>
254 </property>
255 </widget>
255 </widget>
256 </item>
256 </item>
257 <item row="1" column="2">
257 <item row="1" column="2">
258 <widget class="QLabel" name="starDundeeTransmittedPackets">
258 <widget class="QLabel" name="starDundeeTransmittedPackets">
259 <property name="text">
259 <property name="text">
260 <string>-</string>
260 <string>-</string>
261 </property>
261 </property>
262 </widget>
262 </widget>
263 </item>
263 </item>
264 <item row="2" column="2">
264 <item row="2" column="2">
265 <widget class="QLabel" name="starDundeeTransmittedBytes">
265 <widget class="QLabel" name="starDundeeTransmittedBytes">
266 <property name="text">
266 <property name="text">
267 <string>-</string>
267 <string>-</string>
268 </property>
268 </property>
269 </widget>
269 </widget>
270 </item>
270 </item>
271 <item row="0" column="0">
271 <item row="0" column="0">
272 <widget class="QPushButton" name="resetStatsQpb">
272 <widget class="QPushButton" name="resetStatsQpb">
273 <property name="text">
273 <property name="text">
274 <string>Reset stats</string>
274 <string>Reset stats</string>
275 </property>
275 </property>
276 </widget>
276 </widget>
277 </item>
277 </item>
278 </layout>
278 </layout>
279 </item>
279 </item>
280 <item row="8" column="0">
280 <item row="15" column="0">
281 <widget class="QCheckBox" name="spwTimecodes">
281 <widget class="QCheckBox" name="spwTimecodes">
282 <property name="text">
282 <property name="text">
283 <string>timecode</string>
283 <string>timecode</string>
284 </property>
284 </property>
285 </widget>
285 </widget>
286 </item>
286 </item>
287 <item row="7" column="0">
287 <item row="14" column="0">
288 <widget class="QLabel" name="label">
288 <widget class="QLabel" name="label">
289 <property name="text">
289 <property name="text">
290 <string>Timecode f (Hz)</string>
290 <string>Timecode f (Hz)</string>
291 </property>
291 </property>
292 </widget>
292 </widget>
293 </item>
293 </item>
294 <item row="7" column="1">
294 <item row="14" column="1">
295 <widget class="QLineEdit" name="timecodeFrequencyLineEdit">
295 <widget class="QLineEdit" name="timecodeFrequencyLineEdit">
296 <property name="text">
296 <property name="text">
297 <string>1</string>
297 <string>1</string>
298 </property>
298 </property>
299 </widget>
299 </widget>
300 </item>
300 </item>
301 <item row="5" column="0">
302 <widget class="QLabel" name="label_2">
303 <property name="text">
304 <string>Driver Status</string>
305 </property>
306 </widget>
307 </item>
308 <item row="5" column="1">
309 <layout class="QHBoxLayout" name="horizontalLayout">
310 <property name="leftMargin">
311 <number>0</number>
312 </property>
313 <property name="topMargin">
314 <number>0</number>
315 </property>
316 <item>
317 <widget class="QLabel" name="driverstatuslbl">
318 <property name="text">
319 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;NotLoaded&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
320 </property>
321 <property name="alignment">
322 <set>Qt::AlignCenter</set>
323 </property>
324 </widget>
325 </item>
326 <item>
327 <widget class="QPushButton" name="driverStatusQpb">
328 <property name="text">
329 <string>Details</string>
330 </property>
331 </widget>
332 </item>
333 </layout>
334 </item>
301 </layout>
335 </layout>
302 </widget>
336 </widget>
303 <resources/>
337 <resources/>
304 <connections/>
338 <connections/>
305 </ui>
339 </ui>
@@ -1,301 +1,310
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "stardundeegui.h"
22 #include "stardundeegui.h"
23
23
24 #include "ui_stardundeeGUI.h"
24 #include "ui_stardundeeGUI.h"
25 #include "fakestardundeespwusb_lib.h"
25 #include "fakestardundeespwusb_lib.h"
26 //#include <spw_usb_api.h>
27 //#include <spw_config_library.h>
28
26
29 StarDundeeGUI::StarDundeeGUI(QWidget *parent) :
27 StarDundeeGUI::StarDundeeGUI(QWidget *parent) :
30 QWidget(parent),ui(new Ui::StarDundeeUI)
28 QWidget(parent),ui(new Ui::StarDundeeUI)
31 {
29 {
32 resetBytesPacketsStatistics();
30 resetBytesPacketsStatistics();
33
31
34 this->ui->setupUi(this);
32 this->ui->setupUi(this);
35 connect(this->ui->selectBrickCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(brickSelectionChanged(int)));
33 connect(this->ui->selectBrickCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(brickSelectionChanged(int)));
36 connect(this->ui->selectLinkCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(linkNumberSelectionChanged(int)));
34 connect(this->ui->selectLinkCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(linkNumberSelectionChanged(int)));
37 connect(this->ui->setLinkSpeedCmbx,SIGNAL(currentIndexChanged(QString)),this,SIGNAL(linkSpeedSelectionChanged(QString)));
35 connect(this->ui->setLinkSpeedCmbx,SIGNAL(currentIndexChanged(QString)),this,SIGNAL(linkSpeedSelectionChanged(QString)));
38 // connect(this->ui->sourceAddressLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(destinationKeyChanged(QString)));
36 // connect(this->ui->sourceAddressLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(destinationKeyChanged(QString)));
39 connect(this->ui->sourceAddressLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(sourceLogicalAddressChanged(QString)));
37 connect(this->ui->sourceAddressLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(sourceLogicalAddressChanged(QString)));
40 connect(this->ui->destinationAddressLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapAddressChanged(QString)));
38 connect(this->ui->destinationAddressLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapAddressChanged(QString)));
41 connect(this->ui->destinationKeyLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapKeyChanged(QString)));
39 connect(this->ui->destinationKeyLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapKeyChanged(QString)));
42 connect(this->ui->RMAPTimeoutLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapTimeoutChanged(QString)));
40 connect(this->ui->RMAPTimeoutLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapTimeoutChanged(QString)));
43 connect(this->ui->timecodeFrequencyLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(timecodeFrequencyChange(QString)));
41 connect(this->ui->timecodeFrequencyLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(timecodeFrequencyChange(QString)));
44 connect(this->ui->connectQpb,SIGNAL(clicked()),this,SIGNAL(connectClicked()));
42 connect(this->ui->connectQpb,SIGNAL(clicked()),this,SIGNAL(connectClicked()));
45 connect(this->ui->setInterfaceModeQrb, SIGNAL(toggled(bool)), this, SIGNAL(brickModeChanged(bool)));
43 connect(this->ui->setInterfaceModeQrb, SIGNAL(toggled(bool)), this, SIGNAL(brickModeChanged(bool)));
46 connect(this->ui->resetStatsQpb, SIGNAL(clicked()), this, SLOT(resetStatistics()));
44 connect(this->ui->resetStatsQpb, SIGNAL(clicked()), this, SLOT(resetStatistics()));
47 connect(this->ui->spwTimecodes, SIGNAL(toggled(bool)), this, SIGNAL(startSendingTimecode(bool)));
45 connect(this->ui->spwTimecodes, SIGNAL(toggled(bool)), this, SIGNAL(startSendingTimecode(bool)));
46 connect(this->ui->driverStatusQpb,SIGNAL(clicked(bool)),this,SLOT(showDriverStatus()));
47 if(FakeStarDundeeSpwUSB_Lib::fullresolved())
48 this->ui->driverstatuslbl->setText("<html><head/><body><p><span style=\" color:#00ff00;\">Driver loaded</span></p></body></html>");
49 else
50 this->ui->driverstatuslbl->setText("<html><head/><body><p><span style=\" color:#ff0000;\">Driver not loaded(error!)</span></p></body></html>");
48 }
51 }
49
52
50 int StarDundeeGUI::getBrickSelection()
53 int StarDundeeGUI::getBrickSelection()
51 {
54 {
52 return ui->selectBrickCmbx->currentIndex();
55 return ui->selectBrickCmbx->currentIndex();
53 }
56 }
54
57
55 int StarDundeeGUI::getLinkNumberSelection()
58 int StarDundeeGUI::getLinkNumberSelection()
56 {
59 {
57 return ui->selectLinkCmbx->currentIndex();
60 return ui->selectLinkCmbx->currentIndex();
58 }
61 }
59
62
60 QString StarDundeeGUI::getLinkSpeedSelection()
63 QString StarDundeeGUI::getLinkSpeedSelection()
61 {
64 {
62 return ui->setLinkSpeedCmbx->currentText();
65 return ui->setLinkSpeedCmbx->currentText();
63 }
66 }
64
67
65 QString StarDundeeGUI::getSourceAddress()
68 QString StarDundeeGUI::getSourceAddress()
66 {
69 {
67 return ui->sourceAddressLineEdit->text();
70 return ui->sourceAddressLineEdit->text();
68 }
71 }
69
72
70 QString StarDundeeGUI::getDestinationAddress()
73 QString StarDundeeGUI::getDestinationAddress()
71 {
74 {
72 return ui->destinationAddressLineEdit->text();
75 return ui->destinationAddressLineEdit->text();
73 }
76 }
74
77
75 QString StarDundeeGUI::getDestinationKey()
78 QString StarDundeeGUI::getDestinationKey()
76 {
79 {
77 return ui->destinationKeyLineEdit->text();
80 return ui->destinationKeyLineEdit->text();
78 }
81 }
79
82
80 QString StarDundeeGUI::getRmapTimeout()
83 QString StarDundeeGUI::getRmapTimeout()
81 {
84 {
82 return ui->RMAPTimeoutLineEdit->text();
85 return ui->RMAPTimeoutLineEdit->text();
83 }
86 }
84
87
85 QString StarDundeeGUI::getTimecodeFrequency()
88 QString StarDundeeGUI::getTimecodeFrequency()
86 {
89 {
87 return ui->timecodeFrequencyLineEdit->text();
90 return ui->timecodeFrequencyLineEdit->text();
88 }
91 }
89
92
90 bool StarDundeeGUI::getStartSendingTimecodes()
93 bool StarDundeeGUI::getStartSendingTimecodes()
91 {
94 {
92 return ui->spwTimecodes->isChecked();
95 return ui->spwTimecodes->isChecked();
93 }
96 }
94
97
95 bool StarDundeeGUI::isBrickSetAsAnInterface()
98 bool StarDundeeGUI::isBrickSetAsAnInterface()
96 {
99 {
97 return ui->setInterfaceModeQrb->isChecked();
100 return ui->setInterfaceModeQrb->isChecked();
98 }
101 }
99
102
103 void StarDundeeGUI::showDriverStatus()
104 {
105 this->driverStatus.update();
106 this->driverStatus.show();
107 }
108
100 void StarDundeeGUI::setBrickAsAnInterface( bool interfaceMode )
109 void StarDundeeGUI::setBrickAsAnInterface( bool interfaceMode )
101 {
110 {
102 if (interfaceMode == true)
111 if (interfaceMode == true)
103 {
112 {
104 this->ui->setInterfaceModeQrb->setChecked( true );
113 this->ui->setInterfaceModeQrb->setChecked( true );
105 }
114 }
106 else
115 else
107 {
116 {
108 this->ui->setRouterModeQrb->setChecked( true );
117 this->ui->setRouterModeQrb->setChecked( true );
109 }
118 }
110 }
119 }
111
120
112 void StarDundeeGUI::setBrickAsARouter( bool interfaceMode )
121 void StarDundeeGUI::setBrickAsARouter( bool interfaceMode )
113 {
122 {
114 if (interfaceMode==true)
123 if (interfaceMode==true)
115 {
124 {
116 this->ui->setRouterModeQrb->setChecked( true );
125 this->ui->setRouterModeQrb->setChecked( true );
117 }
126 }
118 else
127 else
119 {
128 {
120 this->ui->setInterfaceModeQrb->setChecked( true );
129 this->ui->setInterfaceModeQrb->setChecked( true );
121 }
130 }
122
131
123 }
132 }
124
133
125 void StarDundeeGUI::lock(bool lock)
134 void StarDundeeGUI::lock(bool lock)
126 {
135 {
127 this->ui->selectBrickCmbx->setDisabled(lock);
136 this->ui->selectBrickCmbx->setDisabled(lock);
128 this->ui->selectLinkCmbx->setDisabled(lock);
137 this->ui->selectLinkCmbx->setDisabled(lock);
129 this->ui->setLinkSpeedCmbx->setDisabled(lock);
138 this->ui->setLinkSpeedCmbx->setDisabled(lock);
130 this->ui->sourceAddressLineEdit->setDisabled(lock);
139 this->ui->sourceAddressLineEdit->setDisabled(lock);
131 this->ui->destinationAddressLineEdit->setDisabled(lock);
140 this->ui->destinationAddressLineEdit->setDisabled(lock);
132 this->ui->destinationKeyLineEdit->setDisabled(lock);
141 this->ui->destinationKeyLineEdit->setDisabled(lock);
133 this->ui->RMAPTimeoutLineEdit->setDisabled(lock);
142 this->ui->RMAPTimeoutLineEdit->setDisabled(lock);
134 this->ui->setInterfaceModeQrb->setDisabled(lock);
143 this->ui->setInterfaceModeQrb->setDisabled(lock);
135 this->ui->setRouterModeQrb->setDisabled(lock);
144 this->ui->setRouterModeQrb->setDisabled(lock);
136 if(lock)
145 if(lock)
137 this->ui->connectQpb->setText("Disconnect");
146 this->ui->connectQpb->setText("Disconnect");
138 else
147 else
139 this->ui->connectQpb->setText("Connect");
148 this->ui->connectQpb->setText("Connect");
140 }
149 }
141
150
142 void StarDundeeGUI::updateAvailableBrickCount(int count)
151 void StarDundeeGUI::updateAvailableBrickCount(int count)
143 {
152 {
144 this->ui->selectBrickCmbx->clear();
153 this->ui->selectBrickCmbx->clear();
145 this->ui->selectBrickCmbx->addItem("none");
154 this->ui->selectBrickCmbx->addItem("none");
146 for(int i =0;i<32;i++)
155 for(int i =0;i<32;i++)
147 {
156 {
148 if((count&1)==1)
157 if((count&1)==1)
149 {
158 {
150 star_device_handle hDevice;
159 star_device_handle hDevice;
151 char serial[11]="";
160 char serial[11]="";
152 if (USBSpaceWire_Open(&hDevice, 0))
161 if (USBSpaceWire_Open(&hDevice, 0))
153 {
162 {
154 USBSpaceWire_GetSerialNumber(hDevice,(U8*) serial);
163 USBSpaceWire_GetSerialNumber(hDevice,(U8*) serial);
155 USBSpaceWire_Close(hDevice);
164 USBSpaceWire_Close(hDevice);
156 }
165 }
157 this->ui->selectBrickCmbx->addItem("STAR-Dundee USB brick "+QString::number(i)+" sn:" + serial);
166 this->ui->selectBrickCmbx->addItem("STAR-Dundee USB brick "+QString::number(i)+" sn:" + serial);
158 }
167 }
159 count>>=1;
168 count>>=1;
160 }
169 }
161 }
170 }
162
171
163 void StarDundeeGUI::setRmapTimeout(const QString &timeout)
172 void StarDundeeGUI::setRmapTimeout(const QString &timeout)
164 {
173 {
165 this->ui->RMAPTimeoutLineEdit->setText(timeout);
174 this->ui->RMAPTimeoutLineEdit->setText(timeout);
166 }
175 }
167
176
168 void StarDundeeGUI::selectBrick(int brickIndex)
177 void StarDundeeGUI::selectBrick(int brickIndex)
169 {
178 {
170 if(brickIndex>=0&& brickIndex<this->ui->selectBrickCmbx->count())
179 if(brickIndex>=0&& brickIndex<this->ui->selectBrickCmbx->count())
171 {
180 {
172 this->ui->selectBrickCmbx->setCurrentIndex(brickIndex);
181 this->ui->selectBrickCmbx->setCurrentIndex(brickIndex);
173 }
182 }
174 }
183 }
175
184
176 void StarDundeeGUI::selectLinkNumber(int linkNumber)
185 void StarDundeeGUI::selectLinkNumber(int linkNumber)
177 {
186 {
178 if(linkNumber==1 || linkNumber==2)
187 if(linkNumber==1 || linkNumber==2)
179 {
188 {
180 this->ui->selectLinkCmbx->setCurrentIndex(linkNumber-1);
189 this->ui->selectLinkCmbx->setCurrentIndex(linkNumber-1);
181 }
190 }
182 }
191 }
183
192
184 void StarDundeeGUI::selectLinkSpeed(int linkSpeed)
193 void StarDundeeGUI::selectLinkSpeed(int linkSpeed)
185 {
194 {
186 #define MHz *(1000*1000)
195 #define MHz *(1000*1000)
187 if(linkSpeed==10 MHz)
196 if(linkSpeed==10 MHz)
188 {
197 {
189 this->ui->selectLinkCmbx->setCurrentIndex(0);
198 this->ui->selectLinkCmbx->setCurrentIndex(0);
190 }
199 }
191 }
200 }
192
201
193 void StarDundeeGUI::setSourceAddress(const QString &address)
202 void StarDundeeGUI::setSourceAddress(const QString &address)
194 {
203 {
195 bool ok;
204 bool ok;
196 address.toInt(&ok,10);
205 address.toInt(&ok,10);
197 if(ok)
206 if(ok)
198 {
207 {
199 this->ui->sourceAddressLineEdit->setText(address);
208 this->ui->sourceAddressLineEdit->setText(address);
200 }
209 }
201 }
210 }
202
211
203 void StarDundeeGUI::setDestinationAddress(const QString &address)
212 void StarDundeeGUI::setDestinationAddress(const QString &address)
204 {
213 {
205 bool ok;
214 bool ok;
206 address.toInt(&ok,10);
215 address.toInt(&ok,10);
207 if(ok)
216 if(ok)
208 {
217 {
209 this->ui->destinationAddressLineEdit->setText(address);
218 this->ui->destinationAddressLineEdit->setText(address);
210 }
219 }
211 }
220 }
212
221
213 void StarDundeeGUI::setDestinationKey(const QString &key)
222 void StarDundeeGUI::setDestinationKey(const QString &key)
214 {
223 {
215 bool ok;
224 bool ok;
216 key.toInt(&ok,10);
225 key.toInt(&ok,10);
217 if(ok)
226 if(ok)
218 {
227 {
219 this->ui->destinationKeyLineEdit->setText(key);
228 this->ui->destinationKeyLineEdit->setText(key);
220 }
229 }
221 }
230 }
222
231
223 void StarDundeeGUI::setTimecodeFrequency( double frequency )
232 void StarDundeeGUI::setTimecodeFrequency( double frequency )
224 {
233 {
225 this->ui->timecodeFrequencyLineEdit->setText( QString::number( frequency, 'g', 3 ) );
234 this->ui->timecodeFrequencyLineEdit->setText( QString::number( frequency, 'g', 3 ) );
226 }
235 }
227
236
228 void StarDundeeGUI::setStartSendingTimecodes( bool onOff )
237 void StarDundeeGUI::setStartSendingTimecodes( bool onOff )
229 {
238 {
230 if (this->ui->spwTimecodes->isChecked())
239 if (this->ui->spwTimecodes->isChecked())
231 {
240 {
232 if (onOff==false) this->ui->spwTimecodes->setChecked(false);
241 if (onOff==false) this->ui->spwTimecodes->setChecked(false);
233 }
242 }
234 else
243 else
235 {
244 {
236 if (onOff==true) this->ui->spwTimecodes->setChecked(true);
245 if (onOff==true) this->ui->spwTimecodes->setChecked(true);
237 }
246 }
238 }
247 }
239
248
240 int StarDundeeGUI::getAvailableBrickCount( void )
249 int StarDundeeGUI::getAvailableBrickCount( void )
241 {
250 {
242 int list = USBSpaceWire_ListDevices();
251 int list = USBSpaceWire_ListDevices();
243 emit updateAvailableBrickCount(list);
252 emit updateAvailableBrickCount(list);
244 QCoreApplication::processEvents();
253 QCoreApplication::processEvents();
245 return list;
254 return list;
246 }
255 }
247
256
248 void StarDundeeGUI::resetBytesPacketsStatistics( void )
257 void StarDundeeGUI::resetBytesPacketsStatistics( void )
249 {
258 {
250 nbBytesReceivedFromSpw = 0;
259 nbBytesReceivedFromSpw = 0;
251 nbBytesTransmittedToSpw = 0;
260 nbBytesTransmittedToSpw = 0;
252 nbPacketsReceivedFromSpw = 0;
261 nbPacketsReceivedFromSpw = 0;
253 nbPacketsTransmittedToSpw = 0;
262 nbPacketsTransmittedToSpw = 0;
254 nbCCSDSPacketsTransmittedToSpw = 0;
263 nbCCSDSPacketsTransmittedToSpw = 0;
255 }
264 }
256
265
257 void StarDundeeGUI::resetStatistics( void )
266 void StarDundeeGUI::resetStatistics( void )
258 {
267 {
259 nbBytesReceivedFromSpw = 0;
268 nbBytesReceivedFromSpw = 0;
260 nbBytesTransmittedToSpw = 0;
269 nbBytesTransmittedToSpw = 0;
261 nbPacketsReceivedFromSpw = 0;
270 nbPacketsReceivedFromSpw = 0;
262 nbPacketsTransmittedToSpw = 0;
271 nbPacketsTransmittedToSpw = 0;
263
272
264 this->ui->starDundeeReceivedBytes->setText( QString::number(nbBytesReceivedFromSpw) );
273 this->ui->starDundeeReceivedBytes->setText( QString::number(nbBytesReceivedFromSpw) );
265 this->ui->starDundeeReceivedPackets->setText( QString::number(nbPacketsReceivedFromSpw) );
274 this->ui->starDundeeReceivedPackets->setText( QString::number(nbPacketsReceivedFromSpw) );
266 this->ui->starDundeeTransmittedBytes->setText( QString::number(nbBytesTransmittedToSpw) );
275 this->ui->starDundeeTransmittedBytes->setText( QString::number(nbBytesTransmittedToSpw) );
267 this->ui->starDundeeTransmittedPackets->setText( QString::number(nbPacketsTransmittedToSpw) );
276 this->ui->starDundeeTransmittedPackets->setText( QString::number(nbPacketsTransmittedToSpw) );
268 }
277 }
269
278
270 void StarDundeeGUI::updateNbReceivedBytesFromSpw( unsigned int nbBytes)
279 void StarDundeeGUI::updateNbReceivedBytesFromSpw( unsigned int nbBytes)
271 {
280 {
272 nbBytesReceivedFromSpw = nbBytesReceivedFromSpw + nbBytes;
281 nbBytesReceivedFromSpw = nbBytesReceivedFromSpw + nbBytes;
273 nbPacketsReceivedFromSpw = nbPacketsReceivedFromSpw + 1;
282 nbPacketsReceivedFromSpw = nbPacketsReceivedFromSpw + 1;
274
283
275 this->ui->starDundeeReceivedBytes->setText( QString::number(nbBytesReceivedFromSpw) );
284 this->ui->starDundeeReceivedBytes->setText( QString::number(nbBytesReceivedFromSpw) );
276 this->ui->starDundeeReceivedPackets->setText( QString::number(nbPacketsReceivedFromSpw) );
285 this->ui->starDundeeReceivedPackets->setText( QString::number(nbPacketsReceivedFromSpw) );
277 }
286 }
278
287
279 void StarDundeeGUI::updateNbTransmittedBytesToSpw( unsigned int nbBytes)
288 void StarDundeeGUI::updateNbTransmittedBytesToSpw( unsigned int nbBytes)
280 {
289 {
281 nbBytesTransmittedToSpw = nbBytesTransmittedToSpw + nbBytes;
290 nbBytesTransmittedToSpw = nbBytesTransmittedToSpw + nbBytes;
282 nbPacketsTransmittedToSpw = nbPacketsTransmittedToSpw + 1;
291 nbPacketsTransmittedToSpw = nbPacketsTransmittedToSpw + 1;
283
292
284 this->ui->starDundeeTransmittedBytes->setText( QString::number(nbBytesTransmittedToSpw) );
293 this->ui->starDundeeTransmittedBytes->setText( QString::number(nbBytesTransmittedToSpw) );
285 this->ui->starDundeeTransmittedPackets->setText( QString::number(nbPacketsTransmittedToSpw) );
294 this->ui->starDundeeTransmittedPackets->setText( QString::number(nbPacketsTransmittedToSpw) );
286 }
295 }
287
296
288 void StarDundeeGUI::updateCCSDSPacketTransmittedToSpw( void )
297 void StarDundeeGUI::updateCCSDSPacketTransmittedToSpw( void )
289 {
298 {
290 nbCCSDSPacketsTransmittedToSpw = nbCCSDSPacketsTransmittedToSpw + 1;
299 nbCCSDSPacketsTransmittedToSpw = nbCCSDSPacketsTransmittedToSpw + 1;
291 }
300 }
292
301
293 unsigned int StarDundeeGUI::getNbCCSDSPacketsTransmittedToSpw(void)
302 unsigned int StarDundeeGUI::getNbCCSDSPacketsTransmittedToSpw(void)
294 {
303 {
295 return this->nbCCSDSPacketsTransmittedToSpw;
304 return this->nbCCSDSPacketsTransmittedToSpw;
296 }
305 }
297
306
298 unsigned int StarDundeeGUI::getNbPacketsTransmittedToSpw()
307 unsigned int StarDundeeGUI::getNbPacketsTransmittedToSpw()
299 {
308 {
300 return this->nbPacketsTransmittedToSpw;
309 return this->nbPacketsTransmittedToSpw;
301 }
310 }
@@ -1,90 +1,94
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #ifndef STARDUNDEEGUI_H
22 #ifndef STARDUNDEEGUI_H
23 #define STARDUNDEEGUI_H
23 #define STARDUNDEEGUI_H
24
24
25 #include <QWidget>
25 #include <QWidget>
26
26
27 #include "fakestardundeespwusbgui.h"
28
27 namespace Ui {
29 namespace Ui {
28 class StarDundeeUI;
30 class StarDundeeUI;
29 }
31 }
30
32
31 class StarDundeeGUI : public QWidget
33 class StarDundeeGUI : public QWidget
32 {
34 {
33 Q_OBJECT
35 Q_OBJECT
34 public:
36 public:
35 explicit StarDundeeGUI(QWidget *parent = 0);
37 explicit StarDundeeGUI(QWidget *parent = 0);
36 int getBrickSelection();
38 int getBrickSelection();
37 int getLinkNumberSelection();
39 int getLinkNumberSelection();
38 QString getLinkSpeedSelection();
40 QString getLinkSpeedSelection();
39 QString getSourceAddress();
41 QString getSourceAddress();
40 QString getDestinationAddress();
42 QString getDestinationAddress();
41 QString getDestinationKey();
43 QString getDestinationKey();
42 QString getRmapTimeout();
44 QString getRmapTimeout();
43 QString getTimecodeFrequency();
45 QString getTimecodeFrequency();
44 bool getStartSendingTimecodes();
46 bool getStartSendingTimecodes();
45 bool isBrickSetAsAnInterface();
47 bool isBrickSetAsAnInterface();
46 signals:
48 signals:
47 void brickSelectionChanged(int brickIndex);
49 void brickSelectionChanged(int brickIndex);
48 void linkNumberSelectionChanged(int linkIndex);
50 void linkNumberSelectionChanged(int linkIndex);
49 void linkSpeedSelectionChanged(const QString & linkSpeed);
51 void linkSpeedSelectionChanged(const QString & linkSpeed);
50 void destinationKeyChanged(const QString & destKey);
52 void destinationKeyChanged(const QString & destKey);
51 void sourceLogicalAddressChanged( QString );
53 void sourceLogicalAddressChanged( QString );
52 void rmapAddressChanged(const QString & address);
54 void rmapAddressChanged(const QString & address);
53 void rmapKeyChanged(const QString & key);
55 void rmapKeyChanged(const QString & key);
54 void rmapTimeoutChanged(const QString & timeout);
56 void rmapTimeoutChanged(const QString & timeout);
55 void timecodeFrequencyChange(const QString & timeout);
57 void timecodeFrequencyChange(const QString & timeout);
56 void connectClicked();
58 void connectClicked();
57 void brickModeChanged(bool);
59 void brickModeChanged(bool);
58 void startSendingTimecode(bool);
60 void startSendingTimecode(bool);
59 public slots:
61 public slots:
62 void showDriverStatus();
60 void lock(bool lock);
63 void lock(bool lock);
61 void updateAvailableBrickCount(int count);
64 void updateAvailableBrickCount(int count);
62 void selectBrick(int brickIndex);
65 void selectBrick(int brickIndex);
63 void selectLinkNumber(int linkIndex);
66 void selectLinkNumber(int linkIndex);
64 void selectLinkSpeed(int linkSpeed);
67 void selectLinkSpeed(int linkSpeed);
65 void setDestinationKey(const QString & destKey);
68 void setDestinationKey(const QString & destKey);
66 void setSourceAddress(const QString & address);
69 void setSourceAddress(const QString & address);
67 void setDestinationAddress(const QString & address);
70 void setDestinationAddress(const QString & address);
68 void setTimecodeFrequency(double frequency);
71 void setTimecodeFrequency(double frequency);
69 void setStartSendingTimecodes( bool onOff );
72 void setStartSendingTimecodes( bool onOff );
70 void setRmapTimeout(const QString & timeout);
73 void setRmapTimeout(const QString & timeout);
71 int getAvailableBrickCount( void );
74 int getAvailableBrickCount( void );
72 void setBrickAsAnInterface(bool interfaceMode);
75 void setBrickAsAnInterface(bool interfaceMode);
73 void setBrickAsARouter( bool interfaceMode );
76 void setBrickAsARouter( bool interfaceMode );
74 void resetBytesPacketsStatistics( void );
77 void resetBytesPacketsStatistics( void );
75 void resetStatistics( void );
78 void resetStatistics( void );
76 void updateNbReceivedBytesFromSpw( unsigned int nbBytes);
79 void updateNbReceivedBytesFromSpw( unsigned int nbBytes);
77 void updateNbTransmittedBytesToSpw( unsigned int nbBytes);
80 void updateNbTransmittedBytesToSpw( unsigned int nbBytes);
78 void updateCCSDSPacketTransmittedToSpw( void );
81 void updateCCSDSPacketTransmittedToSpw( void );
79 unsigned int getNbPacketsTransmittedToSpw( void );
82 unsigned int getNbPacketsTransmittedToSpw( void );
80 unsigned int getNbCCSDSPacketsTransmittedToSpw( void );
83 unsigned int getNbCCSDSPacketsTransmittedToSpw( void );
81 private:
84 private:
82 Ui::StarDundeeUI *ui;
85 Ui::StarDundeeUI *ui;
83 unsigned int nbBytesReceivedFromSpw;
86 unsigned int nbBytesReceivedFromSpw;
84 unsigned int nbBytesTransmittedToSpw;
87 unsigned int nbBytesTransmittedToSpw;
85 unsigned int nbPacketsReceivedFromSpw;
88 unsigned int nbPacketsReceivedFromSpw;
86 unsigned int nbPacketsTransmittedToSpw;
89 unsigned int nbPacketsTransmittedToSpw;
87 unsigned int nbCCSDSPacketsTransmittedToSpw;
90 unsigned int nbCCSDSPacketsTransmittedToSpw;
91 FakeStardundeeSpwUsbGui driverStatus;
88 };
92 };
89
93
90 #endif // STARDUNDEEGUI_H
94 #endif // STARDUNDEEGUI_H
@@ -1,5 +1,5
1 <RCC>
1 <RCC>
2 <qresource prefix="/imgs">
2 <qresource prefix="/imgs">
3 <file>StarDundee/stardundee.tif</file>
3 <file alias="stardundee.tif">StarDundee/stardundee.tif</file>
4 </qresource>
4 </qresource>
5 </RCC>
5 </RCC>
@@ -1,183 +1,186
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22
22
23 #include "spwplugin.h"
23 #include "spwplugin.h"
24 #include "stardundeespw_usb.h"
24 #include "stardundeespw_usb.h"
25 #include "gr_esb_bridge.h"
25 #include "gr_esb_bridge.h"
26 #include <socexplorerproxy.h>
26 #include <socexplorerproxy.h>
27 #include "fakestardundeespwusb_lib.h"
27 #include "fakestardundeespwusb_lib.h"
28
28
29
29
30 spwplugin::spwplugin(QWidget *parent):socexplorerplugin(parent,false)
30 spwplugin::spwplugin(QWidget *parent):socexplorerplugin(parent,false)
31 {
31 {
32 Q_UNUSED(parent)
32 Q_UNUSED(parent)
33 FakeStarDundeeSpwUSB_Lib::resolve();
33 FakeStarDundeeSpwUSB_Lib::resolve();
34 this->bridge = NULL;
34 this->bridge = NULL;
35 this->scanDone = false;
35 this->scanDone = false;
36 // this->pyObject = new spwPyWrapper(this);
36 // this->pyObject = new spwPyWrapper(this);
37 this->tcpServer = new SpwTcpPacketServer(this);
37 this->tcpServer = new SpwTcpPacketServer(this);
38 this->mainGroupBox = new QGroupBox("SpaceWire Plugin Configuration",this);
38 this->mainGroupBox = new QGroupBox("SpaceWire Plugin Configuration",this);
39 this->bridgeSelector = new QComboBox(this);
39 this->bridgeSelector = new QComboBox(this);
40 this->mainTabWidgt = new QTabWidget(this);
40 this->mainTabWidgt = new QTabWidget(this);
41 this->mainTabWidgt->addTab(this->mainGroupBox,"Bridge Configuration");
41 this->mainTabWidgt->addTab(this->mainGroupBox,"Bridge Configuration");
42 this->mainTabWidgt->addTab(this->tcpServer,"TCP Server");
42 this->mainTabWidgt->addTab(this->tcpServer,"TCP Server");
43 this->mainLayout = new QGridLayout(this->mainGroupBox);
43 this->mainLayout = new QGridLayout(this->mainGroupBox);
44 this->mainLayout->addWidget(new QLabel("Select SpaceWire bridge",this),0,0,1,1,Qt::AlignCenter);
44 this->mainLayout->addWidget(new QLabel("Select SpaceWire bridge",this),0,0,1,1,Qt::AlignCenter);
45 this->mainLayout->addWidget(this->bridgeSelector,0,1,1,1);
45 this->mainLayout->addWidget(this->bridgeSelector,0,1,1,1);
46 this->setWidget(this->mainTabWidgt);
46 this->setWidget(this->mainTabWidgt);
47 this->bridgeSelector->addItem("none");
47 this->bridgeSelector->addItem("none");
48 this->bridgeSelector->addItem("STAR-Dundee Spw USB Brick");
48 this->bridgeSelector->addItem("STAR-Dundee Spw USB Brick");
49 this->bridgeSelector->addItem("GR-ESB");
49 this->bridgeSelector->addItem("GR-ESB");
50 connect(this->bridgeSelector,SIGNAL(currentIndexChanged(QString)),this,SLOT(bridgeSelectionChanged(QString)));
50 connect(this->bridgeSelector,SIGNAL(currentIndexChanged(QString)),this,SLOT(bridgeSelectionChanged(QString)));
51 connect(this,SIGNAL(selectBridge(QString)),this,SLOT(selectBridge(QString)));
51 connect(this,SIGNAL(selectBridge(QString)),this,SLOT(selectBridge(QString)));
52 connect(this,SIGNAL(TCPServerConnect()),this->tcpServer,SLOT(connectServer()));
52 connect(this,SIGNAL(TCPServerConnect()),this->tcpServer,SLOT(connectServer()));
53 connect(this,SIGNAL(TCPServerDisconnect()),this->tcpServer,SLOT(disconnectServer()));
53 connect(this,SIGNAL(TCPServerDisconnect()),this->tcpServer,SLOT(disconnectServer()));
54 connect(this,SIGNAL(TCPServerSetPort(qint32)),this->tcpServer,SLOT(setServerPort(qint32)));
54 connect(this,SIGNAL(TCPServerSetPort(qint32)),this->tcpServer,SLOT(setServerPort(qint32)));
55 connect(this,SIGNAL(TCPServerSetIP(QString)),this->tcpServer,SLOT(setServerSetIP(QString)));
55 connect(this,SIGNAL(TCPServerSetIP(QString)),this->tcpServer,SLOT(setServerSetIP(QString)));
56 }
56 }
57
57
58
58
59 spwplugin::~spwplugin()
59 spwplugin::~spwplugin()
60 {
60 {
61
61
62 }
62 }
63
63
64
64
65
65
66 unsigned int spwplugin::Read(unsigned int *Value,unsigned int count,unsigned int address)
66 unsigned int spwplugin::Read(unsigned int *Value,unsigned int count,unsigned int address)
67 {
67 {
68 if(Connected)
68 if(Connected)
69 {
69 {
70 return bridge->Read(Value,count,address);
70 return bridge->Read(Value,count,address);
71 }
71 }
72 return 0;
72 return 0;
73 }
73 }
74
74
75 void spwplugin::bridgeSelectionChanged(const QString &text)
75 void spwplugin::bridgeSelectionChanged(const QString &text)
76 {
76 {
77 printf("test");
77 printf("test");
78 if(text=="none")
78 if(text=="none")
79 {
79 {
80 if(this->bridge!=NULL)
80 if(this->bridge!=NULL)
81 {
81 {
82 this->mainLayout->removeWidget(this->bridge->getGUI());
82 this->mainLayout->removeWidget(this->bridge->getGUI());
83 this->bridge->getGUI()->hide();
83 this->disconnect(this,SLOT(setConnected(bool)));
84 this->disconnect(this,SLOT(setConnected(bool)));
84 delete this->bridge;
85 delete this->bridge;
85 this->bridge= NULL;
86 this->bridge= NULL;
86 }
87 }
87 }
88 }
88 if(text=="STAR-Dundee Spw USB Brick")
89 if(text=="STAR-Dundee Spw USB Brick")
89 {
90 {
90 if(this->bridge!=NULL)
91 if(this->bridge!=NULL)
91 {
92 {
92 this->mainLayout->removeWidget(this->bridge->getGUI());
93 this->mainLayout->removeWidget(this->bridge->getGUI());
94 this->bridge->getGUI()->hide();
93 this->disconnect(this,SLOT(setConnected(bool)));
95 this->disconnect(this,SLOT(setConnected(bool)));
94 delete this->bridge;
96 delete this->bridge;
95 }
97 }
96 this->bridge = new stardundeeSPW_USB(this);
98 this->bridge = new stardundeeSPW_USB(this);
97 this->mainLayout->addWidget(this->bridge->getGUI(),1,0,1,2);
99 this->mainLayout->addWidget(this->bridge->getGUI(),1,0,1,2);
98 connect(this->bridge,SIGNAL(setConnected(bool)),this,SLOT(setConnected(bool)));
100 connect(this->bridge,SIGNAL(setConnected(bool)),this,SLOT(setConnected(bool)));
99 connect(this,SIGNAL(StarDundeeSelectBrick(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectBrick(int)));
101 connect(this,SIGNAL(StarDundeeSelectBrick(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectBrick(int)));
100 connect(this,SIGNAL(StarDundeeSelectLinkNumber(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkNumber(int)));
102 connect(this,SIGNAL(StarDundeeSelectLinkNumber(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkNumber(int)));
101 connect(this,SIGNAL(StarDundeeSelectLinkSpeed(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkSpeed(int)));
103 connect(this,SIGNAL(StarDundeeSelectLinkSpeed(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkSpeed(int)));
102 connect(this,SIGNAL(StarDundeeSetSourceAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetSourceAddress(QString)));
104 connect(this,SIGNAL(StarDundeeSetSourceAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetSourceAddress(QString)));
103 connect(this,SIGNAL(StarDundeeSetDestinationAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationAddress(QString)));
105 connect(this,SIGNAL(StarDundeeSetDestinationAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationAddress(QString)));
104 connect(this,SIGNAL(StarDundeeSetDestinationKey(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationKey(QString)));
106 connect(this,SIGNAL(StarDundeeSetDestinationKey(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationKey(QString)));
105 connect(this,SIGNAL(StarDundeeSetRmapTimeout(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapTimeout(QString)));
107 connect(this,SIGNAL(StarDundeeSetRmapTimeout(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapTimeout(QString)));
106 connect(this,SIGNAL(connectBridge()),((stardundeeSPW_USB*)bridge),SLOT(connectBridge()));
108 connect(this,SIGNAL(connectBridge()),((stardundeeSPW_USB*)bridge),SLOT(connectBridge()));
107 connect(this,SIGNAL(disconnectBridge()),((stardundeeSPW_USB*)bridge),SLOT(disconnectBridge()));
109 connect(this,SIGNAL(disconnectBridge()),((stardundeeSPW_USB*)bridge),SLOT(disconnectBridge()));
108 connect(this,SIGNAL(StarDundeeGetAvailableBrickCount()),
110 connect(this,SIGNAL(StarDundeeGetAvailableBrickCount()),
109 ((stardundeeSPW_USB*)bridge),SIGNAL(GetAvailableBrickCount()));
111 ((stardundeeSPW_USB*)bridge),SIGNAL(GetAvailableBrickCount()));
110 connect(this,SIGNAL(StarDundeeGetNbPacketsTransmittedToSpw()),
112 connect(this,SIGNAL(StarDundeeGetNbPacketsTransmittedToSpw()),
111 ((stardundeeSPW_USB*)bridge),SIGNAL(GetNbPacketsTransmittedToSpw()));
113 ((stardundeeSPW_USB*)bridge),SIGNAL(GetNbPacketsTransmittedToSpw()));
112 connect(this,SIGNAL(StarDundeeGetNbCCSDSPacketsTransmittedToSpw()),
114 connect(this,SIGNAL(StarDundeeGetNbCCSDSPacketsTransmittedToSpw()),
113 ((stardundeeSPW_USB*)bridge),SIGNAL(GetNbCCSDSPacketsTransmittedToSpw()));
115 ((stardundeeSPW_USB*)bridge),SIGNAL(GetNbCCSDSPacketsTransmittedToSpw()));
114 connect(this,SIGNAL(StarDundeeGetLinkNumber()),((stardundeeSPW_USB*)bridge),SIGNAL(GetLinkNumber()));
116 connect(this,SIGNAL(StarDundeeGetLinkNumber()),((stardundeeSPW_USB*)bridge),SIGNAL(GetLinkNumber()));
115 connect(this,SIGNAL(StarDundeeSetBrickAsAninterface(bool)),
117 connect(this,SIGNAL(StarDundeeSetBrickAsAninterface(bool)),
116 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsAnInterface(bool)));
118 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsAnInterface(bool)));
117 connect(this,SIGNAL(StarDundeeSetBrickAsARouter(bool)),
119 connect(this,SIGNAL(StarDundeeSetBrickAsARouter(bool)),
118 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsARouter(bool)));
120 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsARouter(bool)));
119 connect(this,SIGNAL(StarDundeeStartTimecodes(bool)),
121 connect(this,SIGNAL(StarDundeeStartTimecodes(bool)),
120 ((stardundeeSPW_USB*)bridge),SIGNAL(StartSendingTimecodes(bool)));
122 ((stardundeeSPW_USB*)bridge),SIGNAL(StartSendingTimecodes(bool)));
121 connect(this,SIGNAL(StarDundeeSetTimecodeFrequency(double)),
123 connect(this,SIGNAL(StarDundeeSetTimecodeFrequency(double)),
122 ((stardundeeSPW_USB*)bridge),SIGNAL(SetTimecodeFrequency(double)));
124 ((stardundeeSPW_USB*)bridge),SIGNAL(SetTimecodeFrequency(double)));
123 connect(this,SIGNAL(StarDundeeSendOneTimecode(unsigned char)),
125 connect(this,SIGNAL(StarDundeeSendOneTimecode(unsigned char)),
124 ((stardundeeSPW_USB*)bridge),SIGNAL(SendOneTimecode(unsigned char)));
126 ((stardundeeSPW_USB*)bridge),SIGNAL(SendOneTimecode(unsigned char)));
125 connect(this->bridge,SIGNAL(pushPacketOverTCP(char*,int)),this->tcpServer,SLOT(pushPacket(char*,int)));
127 connect(this->bridge,SIGNAL(pushPacketOverTCP(char*,int)),this->tcpServer,SLOT(pushPacket(char*,int)));
126 connect(this->tcpServer, SIGNAL(sendSPWPacket(char*,int)), ((stardundeeSPW_USB*)bridge), SLOT(sendPacketComingFromTCPServer(char*,int)));
128 connect(this->tcpServer, SIGNAL(sendSPWPacket(char*,int)), ((stardundeeSPW_USB*)bridge), SLOT(sendPacketComingFromTCPServer(char*,int)));
127 }
129 }
128 if(text=="GR-ESB")
130 if(text=="GR-ESB")
129 {
131 {
130 if(this->bridge!=NULL)
132 if(this->bridge!=NULL)
131 {
133 {
132 this->mainLayout->removeWidget(this->bridge->getGUI());
134 this->mainLayout->removeWidget(this->bridge->getGUI());
135 this->bridge->getGUI()->hide();
133 this->disconnect(this,SLOT(setConnected(bool)));
136 this->disconnect(this,SLOT(setConnected(bool)));
134 delete this->bridge;
137 delete this->bridge;
135 }
138 }
136 this->bridge = new GR_ESB_bridge(this);
139 this->bridge = new GR_ESB_bridge(this);
137 this->mainLayout->addWidget(this->bridge->getGUI(),1,0,1,2);
140 this->mainLayout->addWidget(this->bridge->getGUI(),1,0,1,2);
138 connect(this->bridge,SIGNAL(setConnected(bool)),this,SLOT(setConnected(bool)));
141 connect(this->bridge,SIGNAL(setConnected(bool)),this,SLOT(setConnected(bool)));
139 }
142 }
140 }
143 }
141
144
142
145
143 void spwplugin::selectBridge(const QString &text)
146 void spwplugin::selectBridge(const QString &text)
144 {
147 {
145
148
146 if(text=="none")
149 if(text=="none")
147 {
150 {
148 this->bridgeSelector->setCurrentIndex(0);
151 this->bridgeSelector->setCurrentIndex(0);
149 }
152 }
150 if(text=="STAR-Dundee Spw USB Brick")
153 if(text=="STAR-Dundee Spw USB Brick")
151 {
154 {
152 this->bridgeSelector->setCurrentIndex(1);
155 this->bridgeSelector->setCurrentIndex(1);
153 }
156 }
154 }
157 }
155
158
156 void spwplugin::setConnected(bool connected)
159 void spwplugin::setConnected(bool connected)
157 {
160 {
158 this->bridgeSelector->setDisabled(connected);
161 this->bridgeSelector->setDisabled(connected);
159 this->Connected = connected;
162 this->Connected = connected;
160 emit activateSig(connected);
163 emit activateSig(connected);
161 if(!this->scanDone)
164 if(!this->scanDone)
162 {
165 {
163 socexplorerproxy::loadChildSysDriver(this,"AMBA_PLUGIN");
166 socexplorerproxy::loadChildSysDriver(this,"AMBA_PLUGIN");
164 this->scanDone=true;
167 this->scanDone=true;
165 }
168 }
166 }
169 }
167
170
168 unsigned int spwplugin::Write(unsigned int *Value,unsigned int count, unsigned int address)
171 unsigned int spwplugin::Write(unsigned int *Value,unsigned int count, unsigned int address)
169 {
172 {
170 if(Connected)
173 if(Connected)
171 {
174 {
172 return bridge->Write(Value,count,address);
175 return bridge->Write(Value,count,address);
173 }
176 }
174 return 0;
177 return 0;
175 }
178 }
176
179
177
180
178
181
179
182
180
183
181
184
182
185
183
186
@@ -1,93 +1,96
1 #
1 #
2 # Project created by QtCreator 2011-09-20T08:15:30
2 # Project created by QtCreator 2011-09-20T08:15:30
3 #
3 #
4 #-------------------------------------------------
4 #-------------------------------------------------
5
5
6 CONFIG += socexplorerplugin
6 CONFIG += socexplorerplugin
7 QT += network webkit
7 QT += network webkit
8 greaterThan(QT_MAJOR_VERSION, 4): QT += webkitwidgets
8 greaterThan(QT_MAJOR_VERSION, 4): QT += webkitwidgets
9
9
10 QMAKE_CXXFLAGS += -std=c++11
10 QMAKE_CXXFLAGS += -std=c++11
11 QMAKE_CFLAGS += -std=c++11
11 QMAKE_CFLAGS += -std=c++11
12
12
13 win32:CONFIG += dll
13 win32:CONFIG += dll
14 win32:CONFIG -= static
14 win32:CONFIG -= static
15 VERSION=0.6.0
15 VERSION=0.6.1
16 TARGET = spwplugin
16 TARGET = spwplugin
17 DEFINES += PLUGIN=spwplugin
17 DEFINES += PLUGIN=spwplugin
18 DEFINES += PLUGINHEADER="\"\\\"spwplugin.h"\\\"\"
18 DEFINES += PLUGINHEADER="\"\\\"spwplugin.h"\\\"\"
19 DEFINES += driver_Name="\"\\\"SpwPlugin"\\\"\"
19 DEFINES += driver_Name="\"\\\"SpwPlugin"\\\"\"
20 DEFINES += driver_Author="\"\\\"Alexis Jeandet alexis.jeandet@member.fsf.org; Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\"
20 DEFINES += driver_Author="\"\\\"Alexis Jeandet alexis.jeandet@member.fsf.org; Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\"
21 DEFINES += driver_Description="\"\\\"This plugin allows you to use spacewire's RMAP protocol with Stardundee USB brick v1"\\\"\"
21 DEFINES += driver_Description="\"\\\"This plugin allows you to use spacewire's RMAP protocol with Stardundee USB brick v1"\\\"\"
22 DEFINES += driver_can_be_root=1
22 DEFINES += driver_can_be_root=1
23 DEFINES += driver_can_be_child=0
23 DEFINES += driver_can_be_child=0
24 DEFINES += driver_VID=0
24 DEFINES += driver_VID=0
25 DEFINES += driver_PID=0
25 DEFINES += driver_PID=0
26
26
27 STARTDUNDEEPATH=/home/spacewire/usb/spw_usb_driver_v2.68/
27 STARTDUNDEEPATH=/home/spacewire/usb/spw_usb_driver_v2.68/
28
28
29 LIBS += $$STARTDUNDEEPATH/lib/x86_64/libSpaceWireUSBAPI.so \
29 LIBS += $$STARTDUNDEEPATH/lib/x86_64/libSpaceWireUSBAPI.so \
30 $$STARTDUNDEEPATH/lib/x86_64/libConfigLibraryUSB.so
30 $$STARTDUNDEEPATH/lib/x86_64/libConfigLibraryUSB.so
31
31
32 INCLUDEPATH += \
32 INCLUDEPATH += \
33 $${PWD} \
33 $${PWD} \
34 $$STARTDUNDEEPATH/inc \
34 $$STARTDUNDEEPATH/inc \
35 StarDundee \
35 StarDundee \
36 SpwTcpPacketServer \
36 SpwTcpPacketServer \
37 GR-ESB
37 GR-ESB
38
38
39 HEADERS += \
39 HEADERS += \
40 spwplugin.h \
40 spwplugin.h \
41 StarDundee/stardundeespw_usb.h \
41 StarDundee/stardundeespw_usb.h \
42 abstractspwbridge.h \
42 abstractspwbridge.h \
43 spw.h \
43 spw.h \
44 StarDundee/stardundeegui.h \
44 StarDundee/stardundeegui.h \
45 SpwTcpPacketServer/spwtcppacketserver.h \
45 SpwTcpPacketServer/spwtcppacketserver.h \
46 GR-ESB/gr_esb_bridge.h \
46 GR-ESB/gr_esb_bridge.h \
47 GR-ESB/gr_esb_ui.h \
47 GR-ESB/gr_esb_ui.h \
48 SpwTcpPacketServer/incomingpacketparser.h \
48 SpwTcpPacketServer/incomingpacketparser.h \
49 StarDundee/fakestardundeespwusb_lib.h
49 StarDundee/fakestardundeespwusb_lib.h \
50 StarDundee/fakestardundeespwusbgui.h
50
51
51
52
52 SOURCES += \
53 SOURCES += \
53 spwplugin.cpp \
54 spwplugin.cpp \
54 StarDundee/stardundeespw_usb.cpp \
55 StarDundee/stardundeespw_usb.cpp \
55 abstractspwbridge.cpp \
56 abstractspwbridge.cpp \
56 StarDundee/stardundeegui.cpp \
57 StarDundee/stardundeegui.cpp \
57 SpwTcpPacketServer/spwtcppacketserver.cpp \
58 SpwTcpPacketServer/spwtcppacketserver.cpp \
58 GR-ESB/gr_esb_bridge.cpp \
59 GR-ESB/gr_esb_bridge.cpp \
59 GR-ESB/gr_esb_ui.cpp \
60 GR-ESB/gr_esb_ui.cpp \
60 SpwTcpPacketServer/incomingpacketparser.cpp \
61 SpwTcpPacketServer/incomingpacketparser.cpp \
61 StarDundee/fakestardundeespwusb_lib.cpp
62 StarDundee/fakestardundeespwusb_lib.cpp \
63 StarDundee/fakestardundeespwusbgui.cpp
62
64
63 FORMS += \
65 FORMS += \
64 StarDundee/stardundeeGUI.ui \
66 StarDundee/stardundeeGUI.ui \
65 SpwTcpPacketServer/spwtcppacketserver.ui \
67 SpwTcpPacketServer/spwtcppacketserver.ui \
66 GR-ESB/gr_esb_ui.ui
68 GR-ESB/gr_esb_ui.ui \
69 StarDundee/fakestardundeespwusbgui.ui
67
70
68 RESOURCES += \
71 RESOURCES += \
69 spwRessources.qrc
72 spwRessources.qrc
70
73
71
74
72
75
73
76
74
77
75
78
76
79
77
80
78
81
79
82
80
83
81
84
82
85
83
86
84
87
85
88
86
89
87
90
88
91
89
92
90
93
91
94
92
95
93
96
General Comments 0
You need to be logged in to leave comments. Login now