Skip to content

Commit 302c5c6

Browse files
authored
Merge pull request ros-industrial-attic#169 from LazyEngineerToBe/kinetic-devel
Translated French comments to English
2 parents 55a0f5f + 3581673 commit 302c5c6

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

robotiq_ft_sensor/src/rq_sensor_com.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ INT_8 rq_sensor_com()
195195
if (!GetCommState(hSerial, &dcb)){
196196
CloseHandle(hSerial);
197197
hSerial = INVALID_HANDLE_VALUE;
198-
continue;//Permet de recommencer la boucle
198+
continue;//Allows to start the loop again
199199
}
200200
dcb.BaudRate = CBR_19200;
201201
dcb.ByteSize = 8;
@@ -218,7 +218,7 @@ INT_8 rq_sensor_com()
218218
/* Setup port */
219219
if(!SetCommState(hSerial, &dcb)){
220220
CloseHandle(hSerial);
221-
continue;//Permet de recommencer la boucle
221+
continue;//Allows to start the loop again
222222
}
223223
COMMTIMEOUTS timeouts={0};
224224
timeouts.ReadIntervalTimeout=0;
@@ -229,7 +229,7 @@ INT_8 rq_sensor_com()
229229
if(!SetCommTimeouts(hSerial, &timeouts)){
230230
CloseHandle(hSerial);
231231
hSerial = INVALID_HANDLE_VALUE;
232-
continue;//Permet de recommencer la boucle
232+
continue;//Allows to start the loop again
233233
}
234234
if (rq_com_tentative_connexion() == 1){
235235
return 0;
@@ -378,7 +378,7 @@ void rq_com_listen_stream(void)
378378
rq_com_timer_for_stream_detection = 0;
379379
}
380380

381-
//Copie les données au bout du buffer 2
381+
//Copying the data at the end of buffer 2
382382
for(i = 0; i < rq_com_rcv_len; i++)
383383
{
384384
//If the buffer overflows, set the index to the beginning
@@ -450,7 +450,7 @@ void rq_com_listen_stream(void)
450450

451451
if(last_byte > 0)
452452
{
453-
//On shift le buffer 2 afin de ne garder que ce qui dépasse le dernier caractère du dernier message complet
453+
//Shifts the buffer 2 to keep only what's after the last caracter of the last complete message.
454454
for(i = 0; i < (rq_com_rcv_len2 - last_byte - 1); i++)
455455
{
456456
rq_com_rcv_buff2[i] = rq_com_rcv_buff2[last_byte + 1 + i];
@@ -643,7 +643,7 @@ static INT_8 rq_com_send_fc_16(INT_32 base, INT_32 n, UINT_16 const * const data
643643
*/
644644
void rq_sensor_com_read_info_high_lvl(void)
645645
{
646-
UINT_16 registers[4] = {0};//table de registre
646+
UINT_16 registers[4] = {0};//register table
647647
UINT_64 serial_number = 0;
648648
INT_32 result = 0;
649649

@@ -742,39 +742,39 @@ static UINT_16 rq_com_compute_crc(UINT_8 const * adr, INT_32 length )
742742
return 0;
743743
}
744744

745-
//Tant qu'il reste des bytes dans le message
745+
//While there are bytes left in the message
746746
while (j < length)
747747
{
748-
//Si c'est le premier byte
748+
//If it's the first byte
749749
if (j==0)
750750
{
751751
CRC_calc ^= *adr & 0xFF;
752752
}
753-
//Sinon on utilisera un XOR sur le word
753+
//Else we'll use an XOR on the word
754754
else
755755
{
756756
CRC_calc ^= *adr;
757757
}
758758

759759
k=0;
760760

761-
//Tant que le byte n'est pas complété
761+
//While the byte is not completed
762762
while (k < 8)
763763
{
764-
//Si le dernier bit est un 1
764+
//If the last bit is a 1
765765
if (CRC_calc & 0x0001)
766766
{
767-
CRC_calc = (CRC_calc >> 1)^ 0xA001; //Shift de 1 bit vers la droite et XOR avec le facteur polynomial
767+
CRC_calc = (CRC_calc >> 1)^ 0xA001; //Shifts 1 bit to the right and XOR with the polynomial factor
768768
}
769769
else
770770
{
771-
CRC_calc >>= 1; //Shift de 1 bit vers la droite
771+
CRC_calc >>= 1; //Shifts 1 bit to the right
772772
}
773773

774774
k++;
775775
}
776776

777-
//Incrémente l'adresse et le compteur d'adresse
777+
//Increments address and address counter
778778
adr++;
779779
j++;
780780
}
@@ -796,13 +796,13 @@ static void rq_com_send_fc_03_request(UINT_16 base, UINT_16 n)
796796
UINT_8 words[2];
797797
UINT_16 CRC;
798798

799-
//Si le nombre de registre est impair
799+
//Manage if the number of bytes to write is odd or even
800800
if(n % 2 != 0)
801801
{
802802
n += 1;
803803
}
804804

805-
//Scinder en LSB et MSB
805+
//Split the address and the number of bytes between MSB ans LSB
806806
reg[0] = (UINT_8)(base >> 8); //MSB to the left
807807
reg[1] = (UINT_8)(base & 0x00FF); //LSB to the right
808808
words[0] = (UINT_8)((n/2) >> 8); //MSB to the left
@@ -896,7 +896,7 @@ static INT_32 rq_com_wait_for_fc_03_echo(UINT_8 * const data)
896896
//Verifies the crc and the slave ID
897897
if(CRC != (UINT_16)((buf[length - 1] * 256) + (buf[length - 2])))
898898
{
899-
//On clear le buffer
899+
//Clears the buffer
900900
buf[0] = 0;
901901
length = 0;
902902
return 0;

0 commit comments

Comments
 (0)