Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     using (var hub = new BeaconHub(0x0A5C, 0x21E8))
     {
         hub.BeaconDetected += (sender, e) => { Bleep(e); };
         Console.ReadKey();
     }
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            using (var hub = new BeaconHub(0x0A12, 0x0001))
            {
                hub.BeaconDetected += (sender, e) => Console.WriteLine(e.Beacon.ToString());
                hub.EnableAdvertising(new Beacon("B9407F30-F5F8-466E-AFF9-25556B57FE6D", 1000, 2000, -52), TimeSpan.FromMilliseconds(200));

                Console.ReadKey();
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            using (var hub = new BeaconHub(0x050D, 0x065A))
            {
                hub.BeaconDetected += (sender, e) => Console.WriteLine(e.Beacon.ToString());

                hub.EnableAdvertising(new Beacon("B9407F30-F5F8-466E-AFF9-25556B57FE6D", 1000, 2000, -52));

                Console.ReadKey();
            }
        }
 // The bulk of the clean-up code is implemented in Dispose(bool)
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         // free managed resources
         if (_hub != null)
         {
             _hub.Dispose();
             _hub = null;
         }
     }
     // free native resources if there are any.
     //if (_hub != IntPtr.Zero)
     //{
     //    Marshal.FreeHGlobal(nativeResource);
     //    nativeResource = IntPtr.Zero;
     //}
 }
 public TiltHydrometerHub(int VID, int PID)
 {
     _hub = new BeaconHub(VID, PID);
     _hub.BeaconDetected += (sender, e) => { BeaconDetected(e); };
 }