Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Robotlab
firefly
Commits
439c0067
Commit
439c0067
authored
Apr 03, 2014
by
Tommy Olofsson
Browse files
Handshake seems to work now.
parent
39a4940b
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/protocol/firefly_protocol.c
View file @
439c0067
...
...
@@ -204,14 +204,14 @@ void protocol_data_received(struct firefly_connection *conn,
unsigned
char
*
data
,
size_t
size
)
{
if
(
conn
->
open
==
FIREFLY_CONNECTION_OPEN
)
{
printf
(
"Setting dec buf
\n
"
);
/*
printf("Setting dec buf\n");
*/
labcomm_decoder_ioctl
(
conn
->
transport_decoder
,
FIREFLY_LABCOMM_IOCTL_READER_SET_BUFFER
,
data
,
size
);
int
res
=
0
;
while
(
res
>=
0
)
{
printf
(
"decoding one
\n
"
);
res
=
labcomm_decoder_decode_one
(
conn
->
transport_decoder
);
printf
(
"do(): %d
\n
"
,
res
);
}
}
else
printf
(
"FAIL IN %s
\n
"
,
__func__
);
...
...
src/protocol/firefly_protocol_labcomm.c
View file @
439c0067
...
...
@@ -63,7 +63,12 @@ static int proto_reader_fill(struct labcomm_reader *r,
UNUSED_VAR
(
context
);
result
=
r
->
count
-
r
->
pos
;
r
->
error
=
(
result
<=
0
||
r
->
data
==
NULL
)
?
-
1
:
0
;
#if 1
if
(
result
<=
0
)
printf
(
"cnt:%d pos:%d
\n
"
,
r
->
count
,
r
->
pos
);
if
(
!
r
->
data
)
printf
(
"no data
\n
"
);
#endif
return
result
;
}
...
...
src/transport/firefly_transport_udp_posix.c
View file @
439c0067
...
...
@@ -396,7 +396,7 @@ static int firefly_transport_udp_posix_read_event(void *event_arg)
struct
transport_llp_udp_posix
*
llp_udp
;
struct
firefly_connection
*
conn
;
printf
(
"%s
\n
"
,
__func__
);
/*
printf("%s\n", __func__);
*/
ev_arg
=
event_arg
;
llp_udp
=
ev_arg
->
llp
->
llp_platspec
;
...
...
@@ -462,6 +462,8 @@ void firefly_transport_udp_posix_read(struct firefly_transport_llp *llp)
if
(
res
==
-
1
)
{
FFL
(
FIREFLY_ERROR_SOCKET
);
pkg_len
=
0
;
}
else
{
pkg_len
-=
16
;
/* vx bugtest */
}
ev_arg
=
malloc
(
sizeof
(
*
ev_arg
));
if
(
!
ev_arg
)
{
...
...
@@ -476,12 +478,10 @@ void firefly_transport_udp_posix_read(struct firefly_transport_llp *llp)
return
;
}
len
=
sizeof
(
remote_addr
);
/* printf("recv %d byte\n", pkg_len); */
printf
(
"receiving
\n
"
);
/* printf("receiving %d. ", pkg_len); */
res
=
recvfrom
(
llp_udp
->
local_udp_socket
,
(
void
*
)
ev_arg
->
data
,
pkg_len
,
0
,
(
struct
sockaddr
*
)
&
remote_addr
,
(
void
*
)
&
len
);
printf
(
"received
\n
"
);
/* printf("recv'd %d byte\n", res); */
/* printf("received %d\n", res); */
if
(
res
==
-
1
)
{
char
err_buf
[
ERROR_STR_MAX_LEN
];
#ifdef LABCOMM_COMPAT
...
...
src/utils/firefly_event_queue_vx.c
View file @
439c0067
...
...
@@ -135,9 +135,9 @@ void *firefly_event_vx_thread_main(void *args)
/* TODO: Retval can indicate badly contructed event, or
* failed execution. Should this be handled?
*/
printf
(
"exec ev: %p
\n
"
,
ev
->
execute
);
/*
printf("exec ev: %p\n", ev->execute);
*/
firefly_event_execute
(
ev
);
printf
(
"done exec ev
\n
"
);
/*
printf("done exec ev\n");
*/
semTake
(
ctx
->
lock
,
WAIT_FOREVER
);
firefly_event_return
(
eq
,
&
ev
);
semGive
(
ctx
->
lock
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment