|
|
/*------------------------------------------------------------------------------
|
|
|
-- This file is a part of the SocExplorer Software
|
|
|
-- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
|
|
|
--
|
|
|
-- This program is free software; you can redistribute it and/or modify
|
|
|
-- it under the terms of the GNU General Public License as published by
|
|
|
-- the Free Software Foundation; either version 3 of the License, or
|
|
|
-- (at your option) any later version.
|
|
|
--
|
|
|
-- This program is distributed in the hope that it will be useful,
|
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
-- GNU General Public License for more details.
|
|
|
--
|
|
|
-- You should have received a copy of the GNU General Public License
|
|
|
-- along with this program; if not, write to the Free Software
|
|
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
-------------------------------------------------------------------------------*/
|
|
|
/*-- Author : Alexis Jeandet
|
|
|
-- Mail : alexis.jeandet@member.fsf.org
|
|
|
----------------------------------------------------------------------------*/
|
|
|
#include "fakestardundeespwusb_lib.h"
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
|
char (*resolved_USBSpaceWire_Open)(star_device_handle *phDevice, int nDeviceNum)=NULL;
|
|
|
void (*resolved_USBSpaceWire_Close)(star_device_handle hDevice)=NULL;
|
|
|
U32 (*resolved_USBSpaceWire_ListDevices)()=NULL;
|
|
|
char (*resolved_USBSpaceWire_GetSerialNumber)(star_device_handle hDevice, U8 pSerialNumber[11])=NULL;
|
|
|
void (*resolved_USBSpaceWire_EnableNetworkMode)(star_device_handle hDevice, char enable)=NULL;
|
|
|
char (*resolved_USBSpaceWire_RegisterReceiveOnAllPorts)(star_device_handle hDevice)=NULL;
|
|
|
char (*resolved_USBSpaceWire_UnregisterReceiveOnAllPorts)(star_device_handle hDevice)=NULL;
|
|
|
char (*resolved_USBSpaceWire_ClearEndpoints)(star_device_handle hDevice)=NULL;
|
|
|
void (*resolved_USBSpaceWire_SetTimeout)(star_device_handle hDevice, double timeout)=NULL;
|
|
|
char (*resolved_USBSpaceWire_TC_Reset)(star_device_handle hDevice)=NULL;
|
|
|
char (*resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection)(star_device_handle hDevice,char enable)=NULL;
|
|
|
U32 (*resolved_USBSpaceWire_TC_GetClockFrequency)(star_device_handle hDevice)=NULL;
|
|
|
char (*resolved_USBSpaceWire_TC_SetAutoTickInFrequency)(star_device_handle hDevice, U32 frequency)=NULL;
|
|
|
char (*resolved_USBSpaceWire_TC_EnableAutoTickIn)(star_device_handle hDevice, char enableAutoTickIns, char enableAllPorts)=NULL;
|
|
|
char (*resolved_USBSpaceWire_TC_PerformTickIn)(star_device_handle hDevice, U8 timein)=NULL;
|
|
|
U32 (*resolved_USBSpaceWire_GetDriverSendBufferSize)(star_device_handle hDevice)=NULL;
|
|
|
U32 (*resolved_USBSpaceWire_GetDriverReadBufferSize)(star_device_handle hDevice)=NULL;
|
|
|
char (*resolved_USBSpaceWire_IsReadThrottling)(star_device_handle hDevice)=NULL;
|
|
|
|
|
|
char (*resolved_USBSpaceWire_WaitOnReadPacketAvailable)(star_device_handle hDevice, double timeout)=NULL;
|
|
|
USB_SPACEWIRE_STATUS (*resolved_USBSpaceWire_SendPacket)(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, char bWait,USB_SPACEWIRE_ID *identifier)=NULL;
|
|
|
char (*resolved_USBSpaceWire_FreeSend)(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)=NULL;
|
|
|
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;
|
|
|
char (*resolved_USBSpaceWire_FreeRead)(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)=NULL;
|
|
|
SPACEWIRE_TRAFFIC_TYPE (*resolved_USBSpaceWire_GetReadTrafficType)(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)=NULL;
|
|
|
USB_SPACEWIRE_EOP_TYPE (*resolved_USBSpaceWire_GetReadEOPStatus)(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties,U32 nPacketNum)=NULL;
|
|
|
|
|
|
void (*resolved_CFGSpaceWire_EnableRMAP)(char useRMAP)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_SetRMAPDestinationKey)(U8 destinationKey)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_StackClear)(void)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_AddrStackPush)(U8 dwAddress)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_RetAddrStackPush)(U8 dwAddress)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_SetBrickBaseTransmitRate)(star_device_handle hDevice, U32 dwBaseClk, U32 dwBaseDvdr, U32 dwEnableClk)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_GetLinkStatusControl)(star_device_handle hDevice, U32 dwLinkNum, U32 *dwStatusControl)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSEnableAutoStart)(U32 *dwStatusControl, char bEnabled)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSEnableStart)(U32 *dwStatusControl, char bEnabled)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSEnableDisabled)(U32 *dwStatusControl, char bEnabled)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSEnableTristate)(U32 *dwStatusControl, char bEnabled)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSPortType)(U32 dwStatusControl, U32 *dwPortType)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSSetOperatingSpeed)(U32 *dwStatusControl, U32 dwOperatingSpeed)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSConfigErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSExternalErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSErrorStatus)(U32 dwStatusControl, U32 *dwErrorStatus)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSLinkState)(U32 dwStatusControl, U32 *dwLinkStatus)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSIsLinkRunning)(U32 dwStatusControl, char *isLinkRunning)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSIsAutoStart)(U32 dwStatusControl, char *isAutoStart)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSIsStart)(U32 dwStatusControl, char *isStart)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSIsDisabled)(U32 dwStatusControl, char *isDisabled)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSIsTristate)(U32 dwStatusControl, char *isTristate)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSOperatingSpeed)(U32 dwStatusControl, U32 *dwOperatingSpeed)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_LSOutputPortConnection)(U32 dwStatusControl, U32 *dwOutputPortConnection)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_SetLinkStatusControl)(star_device_handle hDevice, U32 dwLinkNum, U32 dwStatusControl)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_SetAsInterface)(star_device_handle hDevice, char bEnabled, char bAddIdentifier)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_ClearRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_RTBuildRoutingTableEntry)(U32 *dwRoutingTableEntry,U32 dwOutputPorts, char bDelHead, char bPriority)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_SetRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress, U32 dwRoutingTableEntry)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_GetRoutingTableEntry)(star_device_handle hDevice, U32 nLogicalAddress, U32 *dwRoutingTableEntry)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_RTIsEnabled)(U32 dwRoutingTableEntry, char *bEnabled)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_RTIsDelHead)(U32 dwRoutingTableEntry, char *bDelHead)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_RTIsPriority)(U32 dwRoutingTableEntry, char *bPriority)=NULL;
|
|
|
void (*resolved_CFGSpaceWire_RTGetOutputPorts)(U32 dwRoutingTableEntry, U32 *dwOutputPorts)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_GetTickEnableStatus)(star_device_handle hDevice, U32 *dwTickEnableStatus)=NULL;
|
|
|
int (*resolved_CFGSpaceWire_SetTickEnableStatus)(star_device_handle hDevice, U32 dwTickEnableStatus)=NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QList<funcToresolve> funcTable=QList<funcToresolve>()
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_Open,"USBSpaceWire_Open"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_Close,"USBSpaceWire_Close"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_ListDevices,"USBSpaceWire_ListDevices"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetSerialNumber,"USBSpaceWire_GetSerialNumber"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_EnableNetworkMode,"USBSpaceWire_EnableNetworkMode"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_RegisterReceiveOnAllPorts,"USBSpaceWire_RegisterReceiveOnAllPorts"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_UnregisterReceiveOnAllPorts,"USBSpaceWire_UnregisterReceiveOnAllPorts"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_ClearEndpoints,"USBSpaceWire_ClearEndpoints"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_SetTimeout,"USBSpaceWire_SetTimeout"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_Reset,"USBSpaceWire_TC_Reset"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection,"USBSpaceWire_TC_EnableExternalTimecodeSelection"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_GetClockFrequency,"USBSpaceWire_TC_GetClockFrequency"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_SetAutoTickInFrequency,"USBSpaceWire_TC_SetAutoTickInFrequency"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_EnableAutoTickIn,"USBSpaceWire_TC_EnableAutoTickIn"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_TC_PerformTickIn,"USBSpaceWire_TC_PerformTickIn"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetDriverSendBufferSize,"USBSpaceWire_GetDriverSendBufferSize"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetDriverReadBufferSize,"USBSpaceWire_GetDriverReadBufferSize"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_IsReadThrottling,"USBSpaceWire_IsReadThrottling"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_WaitOnReadPacketAvailable,"USBSpaceWire_WaitOnReadPacketAvailable"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_SendPacket,"USBSpaceWire_SendPacket"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_FreeSend,"USBSpaceWire_FreeSend"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_ReadPackets,"USBSpaceWire_ReadPackets"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_FreeRead,"USBSpaceWire_FreeRead"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetReadTrafficType,"USBSpaceWire_GetReadTrafficType"}
|
|
|
<<funcToresolve{(void (**)())&resolved_USBSpaceWire_GetReadEOPStatus,"USBSpaceWire_GetReadEOPStatus"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_EnableRMAP,"CFGSpaceWire_EnableRMAP"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetRMAPDestinationKey,"CFGSpaceWire_SetRMAPDestinationKey"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_StackClear,"CFGSpaceWire_StackClear"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_AddrStackPush,"CFGSpaceWire_AddrStackPush"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RetAddrStackPush,"CFGSpaceWire_RetAddrStackPush"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetBrickBaseTransmitRate,"CFGSpaceWire_SetBrickBaseTransmitRate"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetLinkStatusControl,"CFGSpaceWire_GetLinkStatusControl"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableAutoStart,"CFGSpaceWire_LSEnableAutoStart"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableStart,"CFGSpaceWire_LSEnableStart"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableDisabled,"CFGSpaceWire_LSEnableDisabled"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSEnableTristate,"CFGSpaceWire_LSEnableTristate"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSPortType,"CFGSpaceWire_LSPortType"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSSetOperatingSpeed,"CFGSpaceWire_LSSetOperatingSpeed"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSConfigErrorStatus,"CFGSpaceWire_LSConfigErrorStatus"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSExternalErrorStatus,"CFGSpaceWire_LSExternalErrorStatus"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSErrorStatus,"CFGSpaceWire_LSErrorStatus"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSLinkState,"CFGSpaceWire_LSLinkState"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsLinkRunning,"CFGSpaceWire_LSIsLinkRunning"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsAutoStart,"CFGSpaceWire_LSIsAutoStart"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsStart,"CFGSpaceWire_LSIsStart"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsDisabled,"CFGSpaceWire_LSIsDisabled"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSIsTristate,"CFGSpaceWire_LSIsTristate"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSOperatingSpeed,"CFGSpaceWire_LSOperatingSpeed"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_LSOutputPortConnection,"CFGSpaceWire_LSOutputPortConnection"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetLinkStatusControl,"CFGSpaceWire_SetLinkStatusControl"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetAsInterface,"CFGSpaceWire_SetAsInterface"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_ClearRoutingTableEntry,"CFGSpaceWire_ClearRoutingTableEntry"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTBuildRoutingTableEntry,"CFGSpaceWire_RTBuildRoutingTableEntry"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetRoutingTableEntry,"CFGSpaceWire_SetRoutingTableEntry"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetRoutingTableEntry,"CFGSpaceWire_GetRoutingTableEntry"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsEnabled,"CFGSpaceWire_RTIsEnabled"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsDelHead,"CFGSpaceWire_RTIsDelHead"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTIsPriority,"CFGSpaceWire_RTIsPriority"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_RTGetOutputPorts,"CFGSpaceWire_RTGetOutputPorts"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_GetTickEnableStatus,"CFGSpaceWire_GetTickEnableStatus"}
|
|
|
<<funcToresolve{(void (**)())&resolved_CFGSpaceWire_SetTickEnableStatus,"CFGSpaceWire_SetTickEnableStatus"};
|
|
|
|
|
|
|
|
|
|
|
|
FakeStarDundeeSpwUSB_Lib::FakeStarDundeeSpwUSB_Lib()
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
void FakeStarDundeeSpwUSB_Lib::resolve()
|
|
|
{
|
|
|
QLibrary cfgLib;
|
|
|
QLibrary usbLib;
|
|
|
usbLib.setFileName("/home/spacewire/usb/spw_usb_driver_v2.68/lib/x86_64/libSpaceWireUSBAPI.so");
|
|
|
cfgLib.setFileName("/home/spacewire/usb/spw_usb_driver_v2.68/lib/x86_64/libConfigLibraryUSB.so");
|
|
|
usbLib.load();
|
|
|
cfgLib.load();
|
|
|
if(usbLib.isLoaded()&&cfgLib.isLoaded())
|
|
|
{
|
|
|
for(int i=0;i<funcTable.count();i++)
|
|
|
{
|
|
|
QString symbolName = funcTable[i].symbolName;
|
|
|
if(!symbolName.contains("USBSpaceWire_"))
|
|
|
{
|
|
|
*(funcTable[i].function) = usbLib.resolve(funcTable[i].symbolName);
|
|
|
if(*(funcTable[i].function)==NULL)
|
|
|
*(funcTable[i].function) = cfgLib.resolve(funcTable[i].symbolName);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
*(funcTable[i].function) = cfgLib.resolve(funcTable[i].symbolName);
|
|
|
if(*(funcTable[i].function)==NULL)
|
|
|
*(funcTable[i].function) = usbLib.resolve(funcTable[i].symbolName);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
bool FakeStarDundeeSpwUSB_Lib::fullresolved()
|
|
|
{
|
|
|
bool success=true;
|
|
|
for(int i=0;i<funcTable.count();i++)
|
|
|
{
|
|
|
if(*(funcTable[i].function)==NULL)
|
|
|
success=false;
|
|
|
}
|
|
|
return success;
|
|
|
}
|
|
|
|
|
|
const QList<funcToresolve> &FakeStarDundeeSpwUSB_Lib::status()
|
|
|
{
|
|
|
return funcTable;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char USBSpaceWire_Open(star_device_handle *phDevice, int nDeviceNum)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_Open!=NULL)
|
|
|
return resolved_USBSpaceWire_Open(phDevice, nDeviceNum);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
void USBSpaceWire_Close(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_Close!=NULL)
|
|
|
resolved_USBSpaceWire_Close(hDevice);
|
|
|
}
|
|
|
|
|
|
|
|
|
U32 USBSpaceWire_ListDevices()
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_ListDevices!=NULL)
|
|
|
return resolved_USBSpaceWire_ListDevices();
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_GetSerialNumber(star_device_handle hDevice, U8 pSerialNumber[])
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_GetSerialNumber!=NULL)
|
|
|
return resolved_USBSpaceWire_GetSerialNumber(hDevice,pSerialNumber);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
void USBSpaceWire_EnableNetworkMode(star_device_handle hDevice, char enable)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_EnableNetworkMode!=NULL)
|
|
|
resolved_USBSpaceWire_EnableNetworkMode(hDevice,enable);
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_RegisterReceiveOnAllPorts(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_RegisterReceiveOnAllPorts!=NULL)
|
|
|
return resolved_USBSpaceWire_RegisterReceiveOnAllPorts(hDevice);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_UnregisterReceiveOnAllPorts(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_UnregisterReceiveOnAllPorts!=NULL)
|
|
|
return resolved_USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_ClearEndpoints(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_ClearEndpoints!=NULL)
|
|
|
return resolved_USBSpaceWire_ClearEndpoints(hDevice);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
void USBSpaceWire_SetTimeout(star_device_handle hDevice, double timeout)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_SetTimeout!=NULL)
|
|
|
resolved_USBSpaceWire_SetTimeout(hDevice,timeout);
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_TC_Reset(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_TC_Reset!=NULL)
|
|
|
return resolved_USBSpaceWire_TC_Reset(hDevice);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_TC_EnableExternalTimecodeSelection(star_device_handle hDevice, char enable)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection!=NULL)
|
|
|
return resolved_USBSpaceWire_TC_EnableExternalTimecodeSelection(hDevice,enable);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
U32 USBSpaceWire_TC_GetClockFrequency(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_TC_GetClockFrequency!=NULL)
|
|
|
return resolved_USBSpaceWire_TC_GetClockFrequency(hDevice);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_TC_SetAutoTickInFrequency(star_device_handle hDevice, U32 frequency)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_TC_SetAutoTickInFrequency!=NULL)
|
|
|
return resolved_USBSpaceWire_TC_SetAutoTickInFrequency(hDevice,frequency);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_TC_EnableAutoTickIn(star_device_handle hDevice, char enableAutoTickIns, char enableAllPorts)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_TC_EnableAutoTickIn!=NULL)
|
|
|
return resolved_USBSpaceWire_TC_EnableAutoTickIn(hDevice,enableAutoTickIns,enableAllPorts);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_TC_PerformTickIn(star_device_handle hDevice, U8 timein)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_TC_PerformTickIn!=NULL)
|
|
|
return resolved_USBSpaceWire_TC_PerformTickIn(hDevice,timein);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
U32 USBSpaceWire_GetDriverSendBufferSize(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_GetDriverSendBufferSize!=NULL)
|
|
|
return resolved_USBSpaceWire_GetDriverSendBufferSize(hDevice);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
U32 USBSpaceWire_GetDriverReadBufferSize(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_GetDriverReadBufferSize!=NULL)
|
|
|
return resolved_USBSpaceWire_GetDriverReadBufferSize(hDevice);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_IsReadThrottling(star_device_handle hDevice)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_IsReadThrottling!=NULL)
|
|
|
return resolved_USBSpaceWire_IsReadThrottling(hDevice);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_WaitOnReadPacketAvailable(star_device_handle hDevice, double timeout)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_WaitOnReadPacketAvailable!=NULL)
|
|
|
return resolved_USBSpaceWire_WaitOnReadPacketAvailable(hDevice,timeout);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
USB_SPACEWIRE_STATUS USBSpaceWire_SendPacket(star_device_handle hDevice, void *pBuffer, U32 nBufferSize, char bWait, USB_SPACEWIRE_ID *identifier)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_SendPacket!=NULL)
|
|
|
return resolved_USBSpaceWire_SendPacket(hDevice,pBuffer,nBufferSize,bWait,identifier);
|
|
|
return TRANSFER_ERROR_USB_ERROR;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_FreeSend(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_FreeSend!=NULL)
|
|
|
return resolved_USBSpaceWire_FreeSend(hDevice,identifier);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
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)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_ReadPackets!=NULL)
|
|
|
return resolved_USBSpaceWire_ReadPackets(hDevice,pBuffer,nBufferSize, nPacketNum,bWait, properties,identifier);
|
|
|
return TRANSFER_ERROR_USB_ERROR;
|
|
|
}
|
|
|
|
|
|
|
|
|
char USBSpaceWire_FreeRead(star_device_handle hDevice, USB_SPACEWIRE_ID identifier)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_FreeRead!=NULL)
|
|
|
return resolved_USBSpaceWire_FreeRead(hDevice,identifier);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
SPACEWIRE_TRAFFIC_TYPE USBSpaceWire_GetReadTrafficType(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_GetReadTrafficType!=NULL)
|
|
|
return resolved_USBSpaceWire_GetReadTrafficType(pProperties,nPacketNum);
|
|
|
return SPACEWIRE_TRAFFIC_UNKNOWN;
|
|
|
}
|
|
|
|
|
|
|
|
|
USB_SPACEWIRE_EOP_TYPE USBSpaceWire_GetReadEOPStatus(PUSB_SPACEWIRE_PACKET_PROPERTIES pProperties, U32 nPacketNum)
|
|
|
{
|
|
|
if(resolved_USBSpaceWire_GetReadEOPStatus!=NULL)
|
|
|
return resolved_USBSpaceWire_GetReadEOPStatus(pProperties,nPacketNum);
|
|
|
return SPACEWIRE_USB_NO_EOP;
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_EnableRMAP(char useRMAP)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_EnableRMAP!=NULL)
|
|
|
resolved_CFGSpaceWire_EnableRMAP(useRMAP);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_SetRMAPDestinationKey(U8 destinationKey)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_SetRMAPDestinationKey!=NULL)
|
|
|
resolved_CFGSpaceWire_SetRMAPDestinationKey(destinationKey);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_StackClear()
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_StackClear!=NULL)
|
|
|
resolved_CFGSpaceWire_StackClear();
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_AddrStackPush(U8 dwAddress)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_AddrStackPush!=NULL)
|
|
|
resolved_CFGSpaceWire_AddrStackPush(dwAddress);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_RetAddrStackPush(U8 dwAddress)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_RetAddrStackPush!=NULL)
|
|
|
resolved_CFGSpaceWire_RetAddrStackPush(dwAddress);
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_SetBrickBaseTransmitRate(star_device_handle hDevice, U32 dwBaseClk, U32 dwBaseDvdr, U32 dwEnableClk)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_SetBrickBaseTransmitRate!=NULL)
|
|
|
return resolved_CFGSpaceWire_SetBrickBaseTransmitRate(hDevice, dwBaseClk, dwBaseDvdr, dwEnableClk);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_GetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 *dwStatusControl)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_GetLinkStatusControl!=NULL)
|
|
|
return resolved_CFGSpaceWire_GetLinkStatusControl(hDevice, dwLinkNum, dwStatusControl);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSEnableAutoStart(U32 *dwStatusControl, char bEnabled)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSEnableAutoStart!=NULL)
|
|
|
resolved_CFGSpaceWire_LSEnableAutoStart(dwStatusControl, bEnabled);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSEnableStart(U32 *dwStatusControl, char bEnabled)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSEnableStart!=NULL)
|
|
|
resolved_CFGSpaceWire_LSEnableStart(dwStatusControl, bEnabled);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSEnableDisabled(U32 *dwStatusControl, char bEnabled)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSEnableDisabled!=NULL)
|
|
|
resolved_CFGSpaceWire_LSEnableDisabled(dwStatusControl, bEnabled);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSEnableTristate(U32 *dwStatusControl, char bEnabled)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSEnableTristate!=NULL)
|
|
|
resolved_CFGSpaceWire_LSEnableTristate(dwStatusControl, bEnabled);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSPortType(U32 dwStatusControl, U32 *dwPortType)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSPortType!=NULL)
|
|
|
resolved_CFGSpaceWire_LSPortType(dwStatusControl, dwPortType);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSSetOperatingSpeed(U32 *dwStatusControl, U32 dwOperatingSpeed)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSSetOperatingSpeed!=NULL)
|
|
|
resolved_CFGSpaceWire_LSSetOperatingSpeed(dwStatusControl, dwOperatingSpeed);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSConfigErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSConfigErrorStatus!=NULL)
|
|
|
resolved_CFGSpaceWire_LSConfigErrorStatus(dwStatusControl, dwErrorStatus);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSExternalErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSExternalErrorStatus!=NULL)
|
|
|
resolved_CFGSpaceWire_LSExternalErrorStatus(dwStatusControl, dwErrorStatus);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSErrorStatus(U32 dwStatusControl, U32 *dwErrorStatus)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSErrorStatus!=NULL)
|
|
|
resolved_CFGSpaceWire_LSErrorStatus(dwStatusControl, dwErrorStatus);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSLinkState(U32 dwStatusControl, U32 *dwLinkStatus)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSLinkState!=NULL)
|
|
|
resolved_CFGSpaceWire_LSLinkState(dwStatusControl, dwLinkStatus);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSIsLinkRunning(U32 dwStatusControl, char *isLinkRunning)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSIsLinkRunning!=NULL)
|
|
|
resolved_CFGSpaceWire_LSIsLinkRunning(dwStatusControl, isLinkRunning);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSIsAutoStart(U32 dwStatusControl, char *isAutoStart)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSIsAutoStart!=NULL)
|
|
|
resolved_CFGSpaceWire_LSIsAutoStart(dwStatusControl, isAutoStart);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSIsStart(U32 dwStatusControl, char *isStart)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSIsStart!=NULL)
|
|
|
resolved_CFGSpaceWire_LSIsStart(dwStatusControl, isStart);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSIsDisabled(U32 dwStatusControl, char *isDisabled)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSIsDisabled!=NULL)
|
|
|
resolved_CFGSpaceWire_LSIsDisabled(dwStatusControl, isDisabled);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSIsTristate(U32 dwStatusControl, char *isTristate)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSIsTristate!=NULL)
|
|
|
resolved_CFGSpaceWire_LSIsTristate(dwStatusControl, isTristate);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSOperatingSpeed(U32 dwStatusControl, U32 *dwOperatingSpeed)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSOperatingSpeed!=NULL)
|
|
|
resolved_CFGSpaceWire_LSOperatingSpeed(dwStatusControl, dwOperatingSpeed);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_LSOutputPortConnection(U32 dwStatusControl, U32 *dwOutputPortConnection)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_LSOutputPortConnection!=NULL)
|
|
|
resolved_CFGSpaceWire_LSOutputPortConnection(dwStatusControl, dwOutputPortConnection);
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_SetLinkStatusControl(star_device_handle hDevice, U32 dwLinkNum, U32 dwStatusControl)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_SetLinkStatusControl!=NULL)
|
|
|
return resolved_CFGSpaceWire_SetLinkStatusControl(hDevice, dwLinkNum, dwStatusControl);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_SetAsInterface(star_device_handle hDevice, char bEnabled, char bAddIdentifier)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_SetAsInterface!=NULL)
|
|
|
return resolved_CFGSpaceWire_SetAsInterface(hDevice, bEnabled, bAddIdentifier);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_ClearRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_ClearRoutingTableEntry!=NULL)
|
|
|
return resolved_CFGSpaceWire_ClearRoutingTableEntry(hDevice,nLogicalAddress);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_RTBuildRoutingTableEntry(U32 *dwRoutingTableEntry, U32 dwOutputPorts, char bDelHead, char bPriority)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_RTBuildRoutingTableEntry!=NULL)
|
|
|
resolved_CFGSpaceWire_RTBuildRoutingTableEntry(dwRoutingTableEntry, dwOutputPorts, bDelHead, bPriority);
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_SetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 dwRoutingTableEntry)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_SetRoutingTableEntry!=NULL)
|
|
|
return resolved_CFGSpaceWire_SetRoutingTableEntry(hDevice,nLogicalAddress, dwRoutingTableEntry);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_GetRoutingTableEntry(star_device_handle hDevice, U32 nLogicalAddress, U32 *dwRoutingTableEntry)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_GetRoutingTableEntry!=NULL)
|
|
|
return resolved_CFGSpaceWire_GetRoutingTableEntry(hDevice,nLogicalAddress, dwRoutingTableEntry);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_RTIsEnabled(U32 dwRoutingTableEntry, char *bEnabled)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_RTIsEnabled!=NULL)
|
|
|
resolved_CFGSpaceWire_RTIsEnabled( dwRoutingTableEntry, bEnabled);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_RTIsDelHead(U32 dwRoutingTableEntry, char *bDelHead)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_RTIsDelHead!=NULL)
|
|
|
resolved_CFGSpaceWire_RTIsDelHead( dwRoutingTableEntry, bDelHead);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_RTIsPriority(U32 dwRoutingTableEntry, char *bPriority)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_RTIsPriority!=NULL)
|
|
|
resolved_CFGSpaceWire_RTIsPriority( dwRoutingTableEntry, bPriority);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CFGSpaceWire_RTGetOutputPorts(U32 dwRoutingTableEntry, U32 *dwOutputPorts)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_RTGetOutputPorts!=NULL)
|
|
|
resolved_CFGSpaceWire_RTGetOutputPorts( dwRoutingTableEntry, dwOutputPorts);
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_GetTickEnableStatus(star_device_handle hDevice, U32 *dwTickEnableStatus)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_GetTickEnableStatus!=NULL)
|
|
|
return resolved_CFGSpaceWire_GetTickEnableStatus( hDevice, dwTickEnableStatus);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
int CFGSpaceWire_SetTickEnableStatus(star_device_handle hDevice, U32 dwTickEnableStatus)
|
|
|
{
|
|
|
if(resolved_CFGSpaceWire_SetTickEnableStatus!=NULL)
|
|
|
return resolved_CFGSpaceWire_SetTickEnableStatus( hDevice, dwTickEnableStatus);
|
|
|
return 0;
|
|
|
}
|
|
|
|