Bonjour, j'aimerais vous faire part d'un petit projet sur lequel je suis maintenant et j'aimerais savoir es ce que c'est correcte ou non
Voici un bout de mon code qui sert a lire depuis la carte :


je mets que l'essentiel j'ai pas mis mon GUI et la classe MAIN

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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
 
 public void connect() throws PortInUseException
    {
        String selectedPort = (String)window.cboxPorts.getSelectedItem();
        String selectedbaud = (String)window.bauds.getSelectedItem();  // SELECTION le FLUX 
 
        jcombox = selectedbaud.toString(); // STOCK DANS UNE VARIABLE
        flux = Integer.parseInt(jcombox);
        selectedPortIdentifier = (CommPortIdentifier)portMap.get(selectedPort);
 
        CommPort commPort = null;
 
        try
        {
            //the method below returns an object of type CommPort
            commPort = selectedPortIdentifier.open("TigerControlPanel", TIMEOUT);
            //the CommPort object can be casted to a SerialPort object
            serialPort = (SerialPort)commPort;
 
            //for controlling GUI elements
            setConnected(true);
 
            //logging
            logText = selectedPort + " opened successfully.\nBauds Selected : "+flux ;
            window.txtLog.setForeground(Color.black);
            window.txtLog.append(logText + "\n");
                  try {
                        serialPort.setSerialPortParams(flux,
                                SerialPort.DATABITS_8,
                                SerialPort.STOPBITS_1,
                                SerialPort.PARITY_NONE);
                    } catch (UnsupportedCommOperationException e) {
                        System.out.println(e);
                    }
 
            //enables the controls on the GUI if a successful connection is made
            window.keybindingController.toggleControls();
 
 
        }           
        catch (PortInUseException e)
        {
            logText = selectedPort + " is in use. (" + e.toString() + ")";
 
            window.txtLog.setForeground(Color.RED);
            window.txtLog.append(logText + "\n");
        }
        catch (Exception e)
        {
            logText = "Failed to open " + selectedPort + "(" + e.toString() + ")";
            window.txtLog.append(logText + "\n");
            window.txtLog.setForeground(Color.RED);
        }
    }
 
 
 
  public void serialEvent(SerialPortEvent evt) {
        if (evt.getEventType() == SerialPortEvent.DATA_AVAILABLE)
        {
            try
            {
                byte singleData = (byte)input.read();
                  System.out.println("Reçu! "+singleData+"\n");  
                if (singleData != NEW_LINE_ASCII)
                {
                    logText = new String(new byte[] {singleData});
                    window.txtLog.append(logText);
                }
                else
                {
                    window.txtLog.append("\n");
                }
            }
            catch (Exception e)
            {
                logText = "Failed to read data. (" + e.toString() + ")";
                window.txtLog.setForeground(Color.red);
                window.txtLog.append(logText + "\n");
            }
        }
    }

ofait quand je mets mon Fil TX avec mon RX tout ce que j'envoie je le reçois en retour ! mais dés que je branche les fils sur la cartes dés que j'envoie ( en Héxa d'aprés le manuel d'utilisation ) je reçois rien dutout.
ma question es ce que mon code est faux ? ou bien c'est ma trame qui est fausse ?