Skip to content
Snippets Groups Projects
Commit 3a793d6b authored by smartinezs's avatar smartinezs
Browse files

adding condition to read messages bigger than 0

parent c0970c03
No related branches found
No related tags found
1 merge request!2Used the specific new data event for the rx can ID.
...@@ -207,7 +207,7 @@ unsigned char CDynamixelCAN::receive_status_packet_v2(unsigned char **data,unsig ...@@ -207,7 +207,7 @@ unsigned char CDynamixelCAN::receive_status_packet_v2(unsigned char **data,unsig
do{ do{
if((num=((CCAN *)this->comm_dev)->get_num_data(this->rx_frame_id))==0) if((num=((CCAN *)this->comm_dev)->get_num_data(this->rx_frame_id))==0)
{ {
this->event_server->wait_all(events,100); this->event_server->wait_all(events,300);
num=((CCAN *)this->comm_dev)->get_num_data(this->rx_frame_id); num=((CCAN *)this->comm_dev)->get_num_data(this->rx_frame_id);
} }
if((read+num)>1024) if((read+num)>1024)
...@@ -217,7 +217,9 @@ unsigned char CDynamixelCAN::receive_status_packet_v2(unsigned char **data,unsig ...@@ -217,7 +217,9 @@ unsigned char CDynamixelCAN::receive_status_packet_v2(unsigned char **data,unsig
} }
else else
{ {
((CCAN *)this->comm_dev)->read(this->rx_frame_id,&data_int[read],num);
if(num!=0)
((CCAN *)this->comm_dev)->read(this->rx_frame_id,&data_int[read],num);
read+=num; read+=num;
} }
this->sync_packet_v2(data_int,read,&start); this->sync_packet_v2(data_int,read,&start);
......
...@@ -253,7 +253,8 @@ unsigned char CDynamixelServerCAN::receive_status_packet_v2(unsigned char **data ...@@ -253,7 +253,8 @@ unsigned char CDynamixelServerCAN::receive_status_packet_v2(unsigned char **data
} }
else else
{ {
((CCAN *)this->comm_dev)->read(this->bus_info.rx_frame_id,&data_int[read],num); if(num != 0)
((CCAN *)this->comm_dev)->read(this->bus_info.rx_frame_id,&data_int[read],num);
read+=num; read+=num;
} }
this->sync_packet_v2(data_int,read,&start); this->sync_packet_v2(data_int,read,&start);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment