예제 #1
0
 /// <summary>
 /// The constructor
 /// </summary>
 /// <since_tizen> 4 </since_tizen>
 public BluetoothOppServer()
 {
     _impl = BluetoothOppServerImpl.Instance;
     _impl.ConnectionRequested += (s, e) => ConnectionRequested?.Invoke(this, e);
     _impl.TransferProgress    += (s, e) => TransferProgress?.Invoke(this, e);
     _impl.TransferFinished    += (s, e) => TransferFinished?.Invoke(this, e);
 }
예제 #2
0
        internal int AcceptPush(string name, out int _transferId)
        {
            _transferId = -1;
            if (Globals.IsOppServerInitialized)
            {
                _TransferProgressCallback = (string file, long size, int percent, IntPtr userData) =>
                {
                    TransferProgress?.Invoke(this, new TransferProgressEventArgs(file, size, percent));
                };

                _TransferFinishedCallback = (int result, string file, long size, IntPtr userData) =>
                {
                    TransferFinished?.Invoke(this, new TransferFinishedEventArgs(result, file, size));
                };

                int ret = Interop.Bluetooth.OppServerAcceptPush(_TransferProgressCallback, _TransferFinishedCallback, name, IntPtr.Zero, out _transferId);
                if (ret != (int)BluetoothError.None)
                {
                    Log.Error(Globals.LogTag, "Failed to accept the push request, Error - " + (BluetoothError)ret);
                }
                return(ret);
            }
            return((int)BluetoothError.NotInitialized);
        }
예제 #3
0
 protected void OnTransferProgress(DocumentTransferEventArgs e)
 {
     TransferProgress?.Invoke(this, e);
 }