Diagnostic SpaceWire Interface
EtherSpaceLink family User Manual
E
xa
mple
A
n
a
s
y
n
ch
r
onou
s
pack
et
r
e
a
d
EtherSpaceLink_read_packet_full_nowait ( DSI_unit,
buffer,
buffer_length,
&terminator,
0
);
// This will return immediately, even if the transfer has to wait
// for the system or SpaceWire link.
// Processing can take place here at the same time as the packet
// is being received.
// The status of the transfer can be tested, for example with:
while ( ( read_length = EtherSpaceLink_read_packet_status(DSI_unit) ) < 0 )
{
// A negative value from read_packet_status indicates that
// the transfer is not yet complete.
printf( "... waiting\n" );
usleep( 500000 );
}
// A read length >= 0 from read_packet_status
// indicates that the transfer has completed.
4Links Limited
www.4Links.co.uk
[email protected]
page 94 of 130
T +44 1908 642001; F +44 1908 363463
Milton Keynes MK3 6EB, UK
Suite EU2, Bletchley Park