Diagnostic SpaceWire Interface
EtherSpaceLink family User Manual
E
xa
mple
Usi
n
g
t
h
e
s
a
me bu
ff
e
r
f
o
r
no
r
m
a
l
a
n
d s
p
e
c
i
a
l
d
a
t
a
EtherSpaceLink DSI_unit;
char buffer[1024];
int n;
int EOP;
DSI_unit = EtherSpaceLink_open ( "192.168.3.40" );
EtherSpaceLink_set_mode ( DSI_unit, EtherSpaceLink_LINK_mode_normal );
n = EtherSpaceLink_read_packet_full ( DSI_unit, buffer, sizeof(buffer), &EOP,
EtherSpaceLink_RETURN_SPECIAL_DATA
);
// the terminator value in ‘EOP’ tells us what sort of data we have
E
xa
mple
Se
pa
r
a
t
i
n
g
no
r
m
a
l
a
n
d s
p
e
c
i
a
l
d
a
t
a
:
EtherSpaceLink DSI_unit;
char buffer[1024];
char special[1024];
int n;
int EOP;
DSI_unit = EtherSpaceLink_open ( "192.168.3.40" );
EtherSpaceLink_set_mode ( DSI_unit, EtherSpaceLink_LINK_mode_normal );
n = EtherSpaceLink_read_packet_full ( DSI_unit, buffer, 1024, &EOP,
EtherSpaceLink_REPORT_SPECIAL_DATA
);
if ( n < 0 )
{ // -1 if an error, or else ...
s=EtherSpaceLink_read_packet_full ( DSI_unit, special, 1024, &EOP,
EtherSpaceLink_RETURN_SPECIAL_DATA
);
// now we have the actual data in ‘special’
}
else
{
// it was normal data, in ‘buffer’
}
4Links Limited
www.4Links.co.uk
[email protected]
page 91 of 130
T +44 1908 642001; F +44 1908 363463
Milton Keynes MK3 6EB, UK
Suite EU2, Bletchley Park