mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
Removeudpcache (#65)
* WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * solved eiger 1-10g issue * some fixes for remove udp cache to work * bug fix virtual * removed special handling of rx_udpip
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
extern udpStruct udpDetails;
|
||||
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
@ -35,6 +36,7 @@ int32_t clkPhase[NUM_CLOCKS] = {0, 0, 0};
|
||||
uint32_t clkDivider[NUM_CLOCKS] = {125, 20, 80};
|
||||
|
||||
int highvoltage = 0;
|
||||
int detPos[2] = {0, 0};
|
||||
|
||||
int isFirmwareCheckDone() {
|
||||
return firmware_check_done;
|
||||
@ -400,17 +402,19 @@ int setHighVoltage(int val){
|
||||
}
|
||||
|
||||
|
||||
int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t sourceip, uint32_t udpport) {
|
||||
int configureMAC() {
|
||||
#ifdef VIRTUAL
|
||||
uint32_t dstip = udpDetails.dstip;
|
||||
int dstport = udpDetails.dstport;
|
||||
|
||||
char cDestIp[MAX_STR_LENGTH];
|
||||
memset(cDestIp, 0, MAX_STR_LENGTH);
|
||||
sprintf(cDestIp, "%d.%d.%d.%d", (destip>>24)&0xff,(destip>>16)&0xff,(destip>>8)&0xff,(destip)&0xff);
|
||||
FILE_LOG(logINFO, ("1G UDP: Destination (IP: %s, port:%d)\n", cDestIp, udpport));
|
||||
if (setUDPDestinationDetails(0, cDestIp, udpport) == FAIL) {
|
||||
sprintf(cDestIp, "%d.%d.%d.%d", (dstip>>24)&0xff,(dstip>>16)&0xff,(dstip>>8)&0xff,(dstip)&0xff);
|
||||
FILE_LOG(logINFO, ("1G UDP: Destination (IP: %s, port:%d)\n", cDestIp, dstport));
|
||||
if (setUDPDestinationDetails(0, cDestIp, dstport) == FAIL) {
|
||||
FILE_LOG(logERROR, ("could not set udp destination IP and port\n"));
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
#endif
|
||||
return OK;
|
||||
}
|
||||
@ -636,6 +640,15 @@ void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop) {
|
||||
|
||||
/* aquisition */
|
||||
|
||||
int setDetectorPosition(int pos[]) {
|
||||
memcpy(detPos, pos, sizeof(detPos));
|
||||
return OK;
|
||||
}
|
||||
|
||||
int* getDetectorPosition() {
|
||||
return detPos;
|
||||
}
|
||||
|
||||
int startStateMachine(){
|
||||
#ifdef VIRTUAL
|
||||
// create udp socket
|
||||
@ -658,6 +671,8 @@ int startStateMachine(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef VIRTUAL
|
||||
void* start_timer(void* arg) {
|
||||
int64_t periodns = setTimer(FRAME_PERIOD, -1);
|
||||
|
Reference in New Issue
Block a user