title: Python PyBluez connecting to passkey protected device
body: <p>I'm working on an application in Python (currently 2.7, can switch to 3.3 if necessary) that is supposed to:</p>
  
  <ol>
  <li>Detect bluetooth device (finger clip pulse oximeter, if you're interested).</li>
  <li>Establish connection with device (which is passkey protected)</li>
  <li>Stream data from the device to my computer</li>
  <li>Do more (currenly irrelevant) programming with the data</li>
  </ol>
  
  <p>To accomplish this, I'm using the PyBluez library for Python, as it is probably the most documented library I've found (which sadly is still quite little) that is compatible with Windows and Python2.7.</p>
  
  <p>I am very new to socket programming, so this is probably a simple question. The issue I've encountered, is that I cannot seem to figure out how to connect to the device since it is passkey protected. I can locate it and retrieve its address with no problem, I just don't know what port to use when connecting or how to enter a passkey.</p>
  
  <p>Thanks for your help!</p>
  
  <p>Reference Information:<br/>
  Pulse oximeter used: <a href="http://www.echostore.com/wireless-oximeter-cms50e.html" rel="nofollow">http://www.echostore.com/wireless-oximeter-cms50e.html</a> <br/>
  PyBluez library: <a href="http://pybluez.googlecode.com/svn/www/docs-0.7/index.html" rel="nofollow">http://pybluez.googlecode.com/svn/www/docs-0.7/index.html</a></p>