X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.Network.Bluetooth%2FInterop%2FInterop.Bluetooth.cs;h=faf204012433525c1f9954e4c148252271267030;hb=455353721d197e7f94ce1d9e2c547f160c12a2e9;hp=86ac67e8d0022bf613423a4ac61ecd1b0e2ffc1d;hpb=4aff8c662dca62825b196d3417a0c5859c8a6369;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs index 86ac67e..faf2040 100755 --- a/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs +++ b/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs @@ -65,6 +65,23 @@ internal static partial class Interop internal delegate void HidConnectionStateChangedCallback(int result, bool connected, string deviceAddress, IntPtr userData); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ConnectionRequestedCallback(string deviceAddress, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PushRequestedCallback(string file, long size, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void TransferProgressCallback(string file, long size, int percent, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void TransferFinishedCallback(int result, string file, long size, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PushRespondedCallback(int result, string deviceAddress, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PushProgressCallback(string file, long size, int percent, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PushFinishedCallback(int result, string deviceAddress, IntPtr userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void TargetConnectionStateChangedCallback(bool connected, string deviceAddress, IntPtr userData); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void EqualizerStateChangedCallback(int equalizer, IntPtr userData); @@ -247,7 +264,7 @@ internal static partial class Interop [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_free_service_data_list")] public static extern int FreeServiceDataList(IntPtr serviceData, int count); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_appearance")] + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_appearance")] public static extern int GetScanResultAppearance(ref BluetoothLeScanDataStruct scanData, BluetoothLePacketType packetType, out int appearance); @@ -370,6 +387,48 @@ internal static partial class Interop [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_disconnect")] internal static extern int Disconnect(string deviceAddress); + // Bluetooth OPP + // Opp Server + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_initialize")] + internal static extern int InitializeOppServer(string deviceAddress, PushRequestedCallback pushRequestedCb, IntPtr userData); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_deinitialize")] + internal static extern int DinitializeOppServer(); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_initialize_by_connection_request")] + internal static extern int InitializeOppServerCustom(string deviceAddress, ConnectionRequestedCallback connectionRequestedCb, IntPtr userData); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_accept")] + internal static extern int OppServerAcceptPush(TransferProgressCallback transferProgressCb, TransferFinishedCallback transferFinishedCb, string name, IntPtr userData, out int transferId); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_reject")] + internal static extern int OppServerRejectPush(); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_cancel_transfer")] + internal static extern int OppServerCancelTransfer(int transferId); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_set_destination")] + internal static extern int OppServerSetDestinationPath(string path); + + // Opp Client + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_initialize")] + internal static extern int InitializeOppClient(); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_dinitialize")] + internal static extern int DeinitializeOppClient(); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_add_file")] + internal static extern int OppClientAddFile(string filePath); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_clear_files")] + internal static extern int OppClientClearFiles(); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_cancel_push")] + internal static extern int OppClientCancelPush(); + + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_push_files")] + internal static extern int OppClientPushFile(string filePath, PushRespondedCallback pushRespondedCb, PushProgressCallback pushProgressCb, PushFinishedCallback pushFinishedCb, IntPtr userData); + //Bluetooth Avrcp [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_initialize")] internal static extern int InitializeAvrcp(TargetConnectionStateChangedCallback targetStateChangedCb, IntPtr userData);