Bonjour

Je test XAMARIN et dois récupérer des données transmis par USB lorsque je suis sur la version UWP

La solution étant composée 4 Projets

Projet P
Projet P.ANDROID
Projet P.IOS
Projet P.UWP

Mon code pour le serial fonction dans un projet c# forms classic
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
        static bool _continue;
        static SerialPort _serialPort;
        private delegate void SetTextDeleg(string text);
 
    _serialPort = new SerialPort();
            _serialPort.PortName = "COM6";
            _serialPort.BaudRate = 115200);
            _serialPort.Parity = Parity.None;
            _serialPort.DataBits = 8;
            _serialPort.StopBits = StopBits.One;
            _serialPort.Handshake = Handshake.None;
            // Set the read/write timeouts
            _serialPort.ReadTimeout = 500;
            _serialPort.WriteTimeout = 500;
            _serialPort.DataReceived += new SerialDataReceivedEventHandler(sp_DataReceived);
            _serialPort.Open();
            info.Text = "toto";
 
 
 
 
        }
 
        void sp_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            Thread.Sleep(500);
            string data = _serialPort.ReadLine();
            // Invokes the delegate on the UI thread, and sends the data that was received to the invoked method.  
            // ---- The "si_DataReceived" method will be executed on the UI thread which allows populating of the textbox.  
            Console.WriteLine(data.Trim);
 
 
        }
 
 
        private void si_DataReceived(string data) {info.Text = data.Trim(); }

ce code dans le projet P ne marche par Serial n'est pas reconnu

quand je le met dans P.UWP , je m'en sors presque ==> message d 'erreur
System.IO.IOException : 'Un sémaphore a subi trop d’inscriptions
Et même si le port voulais bien s'ouvrir , je ne sais pas atteindre une variable ou un élément graphique projet Principale P

J'espère avoir été assez clair

sinon Pour Résumer comment faire de serial Port avec la version Windows UWP

MErci de votre aide