Bonjour,

Je voudrais mettre le caractère x2 après le résultat de la chaine reçu qui est ici ps ou pu8String.
Après de multiples tentatives, je demande votre aide.
Je vous remercie d'avance.

O.B

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
/****************************************************************************
 *
 * NAME: vSerial_Init
 *
 * DESCRIPTION:
 *
 * PARAMETERS:      Name            RW  Usage
 * None.
 *
 * RETURNS:
 * None.
 *
 * NOTES:
 * None.
 ****************************************************************************/
PUBLIC void vSerialRxString(uint8 *ps)
{
    uint8 *pu8String;
    int16 i16Chr;
    int16 X;
    int16 str;
 
    /* Copy the received string from the receive queue */
    /*str = (char)ps; */
    /*strcat (str,"x2") ;*/
   /* ps = (uint8)str;*/
    for(pu8String = ps; ((i16Chr = i16Serial_RxChar()) != (int16)RX_STRING_END_CHAR); pu8String++)
    {
         /* X = strcat ((uint8)i16Chr,"x2") ; */
 
        *pu8String = (uint8)i16Chr;
       /*   X =strcat (*pu8String,"x2") ; */
 
    }
 
/* *pu8String = (uint8)'x'; /* Append x2 character to the end of the string */
   /* *pu8String = (uint8)'2'; /* Append x2 character to the end of the string */
   /* *pu8String = (uint8)'x2'; */ /* Append x2 character to the end of the string */
    *pu8String = (uint8)'\0'; /* Append NULL character to the end of the string */
}