From 0571b4c6288be5dc02cbdf6ef4e8707396f95a51 Mon Sep 17 00:00:00 2001 From: Gowtham Anandha Babu Date: Thu, 9 Feb 2017 12:03:36 +0530 Subject: [PATCH] [C# Bluetooth]: Change socket SendData() API to align with CAPI Modify SendData() API to return no of bytes written. Change-Id: Ic1e5518165ffb731f7f8b9b374afdb227d415734 Signed-off-by: Gowtham Anandha Babu --- Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs b/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs index c24b0d4..a44fd31 100755 --- a/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs +++ b/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs @@ -27,7 +27,7 @@ namespace Tizen.Network.Bluetooth { event EventHandler DataReceived; event EventHandler ConnectionStateChanged; - void SendData(string data); + int SendData(string data); } /// @@ -203,14 +203,15 @@ namespace Tizen.Network.Bluetooth /// /// The file descriptor of connected socket. /// The data to be sent. - public void SendData(string data) + public int SendData(string data) { int ret = Interop.Bluetooth.SendData(connectedSocket, data, data.Length); - if (ret != (int)BluetoothError.None) + if (ret < 0) { Log.Error(Globals.LogTag, "Failed to send data, Error - " + (BluetoothError)ret); BluetoothErrorFactory.ThrowBluetoothException(ret); } + return ret; } ~BluetoothSocket() -- 2.7.4