Ejemplo n.º 1
0
        internal int PushFile(string Destination)
        {
            if (Globals.IsOppClientInitialized)
            {
                _PushRespondedCallback = (int result, string address, IntPtr userData) =>
                {
                    PushResponded?.Invoke(this, new PushRespondedEventArgs(result, address));
                };

                _PushProgressCallback = (string file, long size, int percent, IntPtr userData) =>
                {
                    PushProgress?.Invoke(this, new PushProgressEventArgs(file, size, percent));
                };

                _PushFinishedCallback = (int result, string address, IntPtr userData) =>
                {
                    PushFinished?.Invoke(this, new PushFinishedEventArgs(result, address));
                };

                int ret = Interop.Bluetooth.OppClientPushFile(Destination, _PushRespondedCallback, _PushProgressCallback, _PushFinishedCallback, IntPtr.Zero);
                if (ret != (int)BluetoothError.None)
                {
                    Log.Error(Globals.LogTag, "Failed to push File, Error - " + (BluetoothError)ret);
                }
                return(ret);
            }
            return((int)BluetoothError.NotInitialized);
        }
Ejemplo n.º 2
0
 internal BluetoothOppClient()
 {
     BluetoothOppClientImpl.Instance.PushResponded += (s, e) => PushResponded?.Invoke(this, e);
     BluetoothOppClientImpl.Instance.PushProgress  += (s, e) => PushProgress?.Invoke(this, e);
     BluetoothOppClientImpl.Instance.PushFinished  += (s, e) => PushFinished?.Invoke(this, e);
 }