Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
8bac282a
Commit
8bac282a
authored
16 years ago
by
John Romein
Browse files
Options
Downloads
Patches
Plain Diff
bug 225:
RSP format defined.
parent
0b082b81
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Appl/CEP/CS1/CS1_IONProc/src/InputThread.cc
+7
-7
7 additions, 7 deletions
Appl/CEP/CS1/CS1_IONProc/src/InputThread.cc
Appl/CEP/CS1/CS1_IONProc/src/RSP.h
+52
-0
52 additions, 0 deletions
Appl/CEP/CS1/CS1_IONProc/src/RSP.h
with
59 additions
and
7 deletions
Appl/CEP/CS1/CS1_IONProc/src/InputThread.cc
+
7
−
7
View file @
8bac282a
...
...
@@ -33,6 +33,7 @@
#include
<Stream/SystemCallException.h>
#include
<BeamletBuffer.h>
#include
<InputThread.h>
#include
<RSP.h>
#include
<errno.h>
#include
<signal.h>
...
...
@@ -135,12 +136,12 @@ void InputThread::mainLoop()
setAffinity
();
TimeStamp
actualstamp
=
itsArgs
.
startTime
-
itsArgs
.
nrTimesPerPacket
;
unsigned
packetSize
=
16
+
itsArgs
.
nrSubbandsPerPacket
*
itsArgs
.
nrTimesPerPacket
*
sizeof
(
Beamlet
);
unsigned
packetSize
=
sizeof
(
struct
RSP
::
header
)
+
itsArgs
.
nrSubbandsPerPacket
*
itsArgs
.
nrTimesPerPacket
*
sizeof
(
Beamlet
);
unsigned
previousSeqid
=
0
;
bool
previousSeqidIsAccepted
=
false
;
char
packet
[
8192
]
__attribute__
((
aligned
(
16
)));
// Max RSP packet size
RSP
packet
__attribute__
((
aligned
(
16
)));
// Max RSP packet size
bool
dataShouldContainValidStamp
=
dynamic_cast
<
NullStream
*>
(
itsArgs
.
stream
)
==
0
;
...
...
@@ -153,7 +154,7 @@ void InputThread::mainLoop()
// interruptible read, to allow stopping this thread even if the station
// does not send data
itsArgs
.
stream
->
read
(
packet
,
packetSize
);
itsArgs
.
stream
->
read
(
&
packet
,
packetSize
);
}
catch
(
SystemCallException
&
ex
)
{
if
(
ex
.
error
==
EINTR
)
break
;
...
...
@@ -163,10 +164,9 @@ void InputThread::mainLoop()
++
itsArgs
.
packetCounters
->
nrPacketsReceived
;
// get the actual timestamp of first EPApacket in frame
if
(
dataShouldContainValidStamp
)
{
unsigned
seqid
=
*
reinterpret_cast
<
unsigned
*>
(
packet
+
8
)
;
unsigned
blockid
=
*
reinterpret_cast
<
unsigned
*>
(
packet
+
12
)
;
unsigned
seqid
=
packet
.
header
.
timestamp
;
unsigned
blockid
=
packet
.
header
.
blockSequenceNumber
;
#if defined WORDS_BIGENDIAN
seqid
=
byteSwap
(
seqid
);
...
...
@@ -203,7 +203,7 @@ void InputThread::mainLoop()
}
// expected packet received so write data into corresponding buffer
itsArgs
.
BBuffer
->
writePacketData
(
reinterpret_cast
<
Beamlet
*>
(
packet
+
16
),
actualstamp
);
itsArgs
.
BBuffer
->
writePacketData
(
reinterpret_cast
<
Beamlet
*>
(
&
packet
.
data
),
actualstamp
);
}
std
::
clog
<<
"InputThread::mainLoop() exiting loop"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
Appl/CEP/CS1/CS1_IONProc/src/RSP.h
0 → 100644
+
52
−
0
View file @
8bac282a
//# RSP: RSP data format
//#
//# Copyright (C) 2008
//# ASTRON (Netherlands Foundation for Research in Astronomy)
//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
//#
//# 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 2 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
//#
//# $Id$
#ifndef LOFAR_CS1_ION_PROC_RSP_H
#define LOFAR_CS1_ION_PROC_RSP_H
namespace
LOFAR
{
namespace
CS1
{
#include
<cstddef>
// All data is in Little Endian format!
struct
RSP
{
struct
header
{
uint16_t
version
;
uint16_t
configuration
;
uint16_t
station
;
uint8_t
nrBeamlets
;
uint8_t
nrBlocks
;
uint32_t
timestamp
;
uint32_t
blockSequenceNumber
;
}
header
;
char
data
[
8130
];
};
}
// namespace CS1
}
// namespace LOFAR
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment