Esempio n. 1
0
            public ConnectThread(BluetoothDevice device, BluetoothChatService service, bool secure)
            {
                this.device  = device;
                this.service = service;
                BluetoothSocket tmp = null;

                socketType = secure ? "Secure" : "Insecure";

                try
                {
                    if (secure)
                    {
                        tmp = device.CreateRfcommSocketToServiceRecord(MY_UUID_SECURE);
                    }
                    else
                    {
                        tmp = device.CreateInsecureRfcommSocketToServiceRecord(MY_UUID_INSECURE);
                    }
                }
                catch (Java.IO.IOException e)
                {
                    Log.Error(TAG, "create() failed", e);
                }
                socket        = tmp;
                service.state = STATE_CONNECTING;
            }
Esempio n. 2
0
            public AcceptThread(BluetoothChatService service, bool secure)
            {
                BluetoothServerSocket tmp = null;

                socketType   = secure ? "Secure" : "Insecure";
                this.service = service;

                try
                {
                    if (secure)
                    {
                        tmp = service.btAdapter.ListenUsingRfcommWithServiceRecord(NAME_SECURE, MY_UUID_SECURE);
                    }
                    else
                    {
                        tmp = service.btAdapter.ListenUsingInsecureRfcommWithServiceRecord(NAME_INSECURE, MY_UUID_INSECURE);
                    }
                }
                catch (Java.IO.IOException e)
                {
                    Log.Error(TAG, "listen() failed", e);
                }
                serverSocket  = tmp;
                service.state = STATE_LISTEN;
            }
Esempio n. 3
0
            public ConnectedThread(BluetoothSocket socket, BluetoothChatService service, string socketType)
            {
                Log.Debug(TAG, $"create ConnectedThread: {socketType}");
                this.socket  = socket;
                this.service = service;
                Stream tmpIn  = null;
                Stream tmpOut = null;

                // Get the BluetoothSocket input and output streams
                try
                {
                    tmpIn  = socket.InputStream;
                    tmpOut = socket.OutputStream;
                }
                catch (Java.IO.IOException e)
                {
                    Log.Error(TAG, "temp sockets not created", e);
                }

                inStream      = tmpIn;
                outStream     = tmpOut;
                service.state = STATE_CONNECTED;
            }
Esempio n. 4
0
        public static ItemFourFragment NewInstance(BluetoothChatService bcs)
        {
            ItemFourFragment fragment = new ItemFourFragment(bcs);

            return(fragment);
        }
Esempio n. 5
0
 public ItemFourFragment(BluetoothChatService bcs) : base(bcs)
 {
 }
Esempio n. 6
0
 void SetupChat()
 {
     chatService = new BluetoothChatService(handler);
 }
Esempio n. 7
0
 public BChatFragment(BluetoothChatService bcs)
 {
     chatService = bcs;
 }
Esempio n. 8
0
 public ItemThreeFragment(BluetoothChatService bcs) : base(bcs)
 {
 }