Beispiel #1
0
        protected override void OnResume()
        {
            base.OnResume();

            usbHandler = new Handler(
                (message) =>
            {
                //switch ((USBDeviceStatus)message.What)
                //{
                //    case USBDeviceStatus.UsbReading:
                //        break;
                //    case USBDeviceStatus.DeviceConnectionClosed:
                //        break;
                //}
                if (message.What == 111)
                {
                    string raw = message.Data.GetString("raw");
                    _usb_DataReceived(this, new BeaconInfoEventArgs(BeaconInfoData.FromString(raw), raw));
                }
            });
            _usb = new USBCommunicator(this, usbHandler);
            _usb.DataReceived += _usb_DataReceived;
            _usb.Connect();
        }
Beispiel #2
0
 public USBBroadcastReceiver(USBCommunicator communicator)
 {
     _communicator = communicator;
 }