commit 06a15704e12491f29eacc3a0552688fca25e5644
Author: Martin Toutant <martin.toutant@inrae.fr>
Date:   Fri Aug 26 15:50:43 2022 +0200

    switch to generic sendcommand for all services

diff --git a/TestXamConnections/TestXamConnections.Android/Connection/BluetoothConnectionService.cs b/TestXamConnections/TestXamConnections.Android/Connection/BluetoothConnectionService.cs
index 1dc91bf..8fbb3b1 100644
--- a/TestXamConnections/TestXamConnections.Android/Connection/BluetoothConnectionService.cs
+++ b/TestXamConnections/TestXamConnections.Android/Connection/BluetoothConnectionService.cs
@@ -126,8 +126,10 @@ namespace TestXamConnections.Droid.Connection
             return Task.FromResult(true);
         }
 
-        public Task<bool> SendCommand(byte[] hexValues)
+        public Task<bool> SendCommand(IConvertible command)
         {
+            byte[] hexValues = Encoding.ASCII.GetBytes(command.ToString());
+
             if (socket.IsConnected == false)
             {
                 return Task.FromResult(false);
diff --git a/TestXamConnections/TestXamConnections.Android/Connection/InternConnectionService.cs b/TestXamConnections/TestXamConnections.Android/Connection/InternConnectionService.cs
index 619da39..1c1d0a4 100644
--- a/TestXamConnections/TestXamConnections.Android/Connection/InternConnectionService.cs
+++ b/TestXamConnections/TestXamConnections.Android/Connection/InternConnectionService.cs
@@ -50,9 +50,9 @@ namespace TestXamConnections.Droid.Connection
             return Task.FromResult(true);
         }
 
-        public Task<bool> SendCommand(string command)
+        public Task<bool> SendCommand(IConvertible command)
         {
-            Intent launchIntent = appContext.PackageManager.GetLaunchIntentForPackage(command);
+            Intent launchIntent = appContext.PackageManager.GetLaunchIntentForPackage(command.ToString());
             if (launchIntent != null)
             {
                 appContext.StartActivity(launchIntent);
diff --git a/TestXamConnections/TestXamConnections.Android/Connection/WifiConnectionService.cs b/TestXamConnections/TestXamConnections.Android/Connection/WifiConnectionService.cs
index 2296ffb..dde61a4 100644
--- a/TestXamConnections/TestXamConnections.Android/Connection/WifiConnectionService.cs
+++ b/TestXamConnections/TestXamConnections.Android/Connection/WifiConnectionService.cs
@@ -26,12 +26,7 @@ namespace TestXamConnections.Droid.Connection
             throw new NotImplementedException();
         }
 
-        public Task<bool> SendCommand(byte[] hexValues)
-        {
-            throw new NotImplementedException();
-        }
-
-        public Task<bool> SendCommand(string command)
+        public Task<bool> SendCommand(IConvertible hexValues)
         {
             throw new NotImplementedException();
         }
diff --git a/TestXamConnections/TestXamConnections/Connection/IConnectionService.cs b/TestXamConnections/TestXamConnections/Connection/IConnectionService.cs
index 4134387..9fd1383 100644
--- a/TestXamConnections/TestXamConnections/Connection/IConnectionService.cs
+++ b/TestXamConnections/TestXamConnections/Connection/IConnectionService.cs
@@ -20,16 +20,9 @@ namespace TestXamConnections.Connection
         /// <summary>
         /// Fonction d'envoi de commande pour le bluetooth
         /// </summary>
-        /// <param name="hexValues">Données à envoyer sous forme de tableau d'octets</param>
+        /// <param name="hexValues">Données à envoyer sous forme de tableau d'octets ou d'une chaine de caractère</param>
         /// <returns>true si la commande s'est bien envoyée, false sinon.</returns>
-        Task<bool> SendCommand(byte[] hexValues);
-
-        /// <summary>
-        /// Fonction d'envoi de commande pour service interne
-        /// </summary>
-        /// <param name="hexValues">Intent à envoyer</param>
-        /// <returns>true si la commande s'est bien envoyée, false sinon.</returns>
-        Task<bool> SendCommand(string command);
+        Task<bool> SendCommand(IConvertible hexValues);
 
         /// <summary>
         /// Événement déclenché à la réception de données. Présente les donénes sous forme d’un tableau d’octets.
diff --git a/TestXamConnections/TestXamConnections/ViewModels/InternServiceViewModel.cs b/TestXamConnections/TestXamConnections/ViewModels/InternServiceViewModel.cs
index 14e86f7..d590ca0 100644
--- a/TestXamConnections/TestXamConnections/ViewModels/InternServiceViewModel.cs
+++ b/TestXamConnections/TestXamConnections/ViewModels/InternServiceViewModel.cs
@@ -86,6 +86,7 @@ namespace TestXamConnections.ViewModels
         private void OnNoRFIDReceived(object sender, EventArgs e)
         {
             ShowError = true;
+            ShowRFID = false;
             ErrorMessage = "Pas de TAG RFID detecté";
             IsScanning = false;
         }
@@ -93,6 +94,7 @@ namespace TestXamConnections.ViewModels
         private void OnRFIDResultReceived(object sender, string e)
         {
             ShowRFID = true;
+            ShowError = false;
             RFIDResult = e;
             IsScanning = false;
         }
