Chances are that your boss, director, or CTO is using bluetooth on their phone.  Since they are using bluetooth you can scan the 2.4ghz radio band and look for devices that are within the proximity of your bluetooth dongle(radio).  This application scans that band for devices that are within your proximity and allows you to receive a pop-up message from the system tray when a known  device is in the area.  More importantly you can configure applications to be run, like..... "firefox www.yourcompanieswebsite.com"  when  say... your boss's bluetooth enabled phone is in the proximity.

You do not have to be paired with any bluetooth device to be able to discover it with the Coding 4 Fun bluetooth API.  Although using this method of discovery is not guaranteed I have found it to work in a variety of phones.  To increase the range of my radio I modified my dongle to accept an external antenna.  With this hardware I can get a range of about 50 feet tested.

Hardware:

  • Bluetooth Dongle - $1.99
  • SMA Female connector - Free (had one)
  • SMA to N-Male pigtail - $6.99
  • 9dbi Panel Antenna - Free (had one)

IMG_2067 IMG_2068 IMG_2071 IMG_2073

Software:

All you have to do is press "Discover" when the bluetooth device is in proximity and Add it to the Watchlist.  You may specify an alert message, a picture to display, and/or a program to run.  A worker thread is spawned when the Discover button is pressed:

   1: private void btnDiscover_Click(object sender, EventArgs e)
   2: {
   3:     btnDiscover.Text = "scanning";
   4:     btnDiscover.Enabled = false;
   5:  
   6:     m_EventStopThread.Reset();
   7:     m_EventThreadStopped.Reset();
   8:  
   9:     // create worker thread instance for discovering all devices
  10:     m_WorkerThread2 = new Thread(new ThreadStart(this.DiscoverWorkerThread));
  11:     m_WorkerThread2.Name = "Discovering Worker Thread";    // looks nice in Output window
  12:     m_WorkerThread2.Start();
  13:  
  14:     lbxDevices.Items.Clear();
  15:  
  16: }

 

On Form load, a timer is enabled for 10 seconds, when that timer "ticks" a DiscoverByName is performed by a worker thread:

   1: private void tmrMain_Tick(object sender, EventArgs e)
   2:        {
   3:            //read xml config >> watchList
   4:            //timer went off, foreach watchitem spawn worker thread to poll device
   5:            foreach(WatchItem tmp in watchList.WatchItems)
   6:            {
   7:                // reset events
   8:                m_EventStopThread.Reset();
   9:                m_EventThreadStopped.Reset();
  10:  
  11:                // create worker thread instance
  12:                m_WorkerThread = new Thread(new ParameterizedThreadStart(this.WorkerThreadFunction));
  13:                m_WorkerThread.Name = "Worker Thread Discover By Name";
  14:                m_WorkerThread.Start(tmp);
  15:  
  16:            }
  17:        }

From the "Worker" class, which actually does the polling and callback to the parent form delegate:

   1: private bool DevicePresent()
   2: {
   3:     BluetoothDeviceServicesManager workerBTMgr = new BluetoothDeviceServicesManager();
   4:     Device workerDevice = workerBTMgr.DiscoverDeviceByName(m_WatchItem.DeviceName);
   5:  
   6:     if (workerDevice != null)
   7:     {
   8:         return true;
   9:     }
  10:     else
  11:     {
  12:         return false;
  13:     }
  14:  
  15: }
  16:  
  17: public void Run()
  18: {
  19:     if (DevicePresent())
  20:     {
  21:         try
  22:         {
  23:             m_form.Invoke(m_form.m_NotifyDevicePresent, new object[] { m_WatchItem });
  24:         }
  25:         catch (Exception ex)
  26:         {
  27:             MessageBox.Show(ex.Message.ToString());
  28:             
  29:         }
  30:     }
  31:  
  32: }

bb-main  bb-watchitem

Once you have added a device to the watchlist a worker thread is spawned and tries to discover that device every 15 seconds or so.

 

bb-notify

Some code I used:

Download BlueBoss v1.0