lightblue-0.3.2/ 0000755 0000765 0000765 00000000000 10770565177 013024 5 ustar bea bea 0000000 0000000 lightblue-0.3.2/CHANGELOG 0000644 0000765 0000765 00000005575 10770564765 014254 0 ustar bea bea 0000000 0000000 Version 0.3.2 ============= + Fixed so doesn't raise exception when using 'from lightblue import *'. + For Linux: fixed bug where lightblue.obex.recvfile() was often refusing requests. + For Mac: fixed bug where NSInconsistencyException was being raised while blocking/processing events. Version 0.3.1 ============= + This fixes a bug in findservices() on Python for Series 60. Version 0.3 =========== + A new OBEXClient class for Mac OS X and Linux. It can send all the usual OBEX requests, with any type of headers (including custom headers). There is a new obex_ftp_client.py example that uses OBEXClient to implement an OBEX File Transfer client. + The library now works on Mac OS 10.5. Currently there are some deprecation warnings when you import lightblue, but there shouldn't be any issues otherwise. + The BTUtil framework has been renamed to "LightAquaBlue", and its OBEX-related classes have been completely rewritten; it now has a much better, more flexible API, that makes it possible to use it to build higher-level OBEX implementations. + The Linux version's internal OBEX code has been completely rewritten, and it's now much easier to customise and tweak the OBEX client and server implementations, if necessary. + The lightblue.obex sendfile() and recvfile() functions now accept any old file-like objects, instead of only accepting built-in file objects with proper file descriptors. + Fixed various unicode-related bugs. Version 0.2.3 ============= + Fixed Linux version to work with newer versions of PyBluez Version 0.2.2 ============= + The PyS60 3rd Edition binaries have (really) been fixed, and gethostaddr() and gethostclass() should also be fixed for PyS60 2nd Edition FP2 and FP3. + Since it's getting more difficult to build for PyS60 1st Edition, this build has been dropped for this version -- which isn't an issue for this release since there are no new features -- but there won't be any further builds for this edition. If you need to compile LightBlue for 1st Edition, feel free to email me with any issues. + Fixed functions on Mac OS X build that wait (e.g. finddevices(), recv() for sockets) so that they don't busy-wait and hog the CPU. Version 0.2.1 ============= + Hopefully fixed problems with PyS60 3rd Edition sisx binary + Added unsigned sis for PyS60 3rd Edition with maximum free dev cert capabilities Version 0.2 =========== + L2CAP client sockets for Mac OS X and Linux + finddevicename() now takes usecache argument to specify whether to do a remote name request if name is in local cache + stopadvertising() is now automatically called for a socket when close() is called on the socket + Added SIS build for Series 60 3rd Edition + If some of the SIS files for PyS60 didn't work before, they should now + Improved buffering of received data for sockets on Mac OS X + Fixed recv() for mac sockets if other side has closed connection + Fixed mac sockets to receive binary data lightblue-0.3.2/COPYING 0000644 0000765 0000765 00000005242 10533016742 014044 0 ustar bea bea 0000000 0000000 LightBlue is licensed under the MIT license, as reproduced below, and in each individual source code file. The LightBlue implementation for Python for Series 60 uses some source files from the PDIS project from the Helsinki Institute for Information Technology (HIIT). The license for these sources is also reproduced below. -------------------------------------------------------------------- LightBlue is: Copyright (c) 2006 Bea Lam. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------- The PDIS source code is: Copyright 2002-2005 Helsinki Institute for Information Technology (HIIT) and the authors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lightblue-0.3.2/doc/ 0000755 0000765 0000765 00000000000 10770565176 013570 5 ustar bea bea 0000000 0000000 lightblue-0.3.2/doc/._index.html 0000644 0000765 0000000 00000000122 10750353372 016317 0 ustar bea wheel 0000000 0000000 Mac OS X 2 R TEXT lightblue-0.3.2/doc/index.html 0000644 0000765 0000765 00000023152 10750353372 015557 0 ustar bea bea 0000000 0000000
LightBlue - a simple bluetooth library.
Performs a device discovery and returns the found devices as a list of (address, name, class-of-device) tuples. Raises BluetoothError if an error occurs. Arguments: - getnames=True: True if device names should be retrieved during discovery. If false, None will be returned instead of the device name. - length=10: the number of seconds to spend discovering devices (this argument has no effect on Python for Series 60) Do not invoke a new discovery before a previous discovery has finished. Also, to minimise interference with other wireless and bluetooth traffic, and to conserve battery power on the local device, discoveries should not be invoked too frequently (an interval of at least 20 seconds is recommended).
Performs a service discovery and returns the found services as a list of (device-address, service-port, service-name) tuples. Raises BluetoothError if an error occurs. Arguments: - addr=None: a device address, to search only for services on a specific device - name=None: a service name string, to search only for a service with a specific name - servicetype=None: can be RFCOMM or OBEX to search only for RFCOMM or OBEX-type services. (OBEX services are not returned from an RFCOMM search) If more than one criteria is specified, this returns services that match all criteria. Currently the Python for Series 60 implementation will only find RFCOMM and OBEX services.
Returns the name of the device with the given bluetooth address. finddevicename(gethostaddr()) returns the local device name. Arguments: - address: the address of the device to look up - usecache=True: if True, the device name will be fetched from a local cache if possible. If False, or if the device name is not in the cache, the remote device will be contacted to request its name. Raise BluetoothError if the name cannot be retrieved.
Displays a GUI which allows the end user to select a device from a list of discovered devices. Returns the selected device as an (address, name, class-of-device) tuple. Returns None if the selection was cancelled. (On Python For Series 60, the device selection will fail if there are any open bluetooth connections.)
Displays a GUI which allows the end user to select a service from a list of discovered devices and their services. Returns the selected service as a (device-address, service-port, service- name) tuple. Returns None if the selection was cancelled. (On Python For Series 60, the device selection will fail if there are any open bluetooth connections.) Currently the Python for Series 60 implementation will only find RFCOMM and OBEX services.
Returns the address of the local bluetooth device. Raise BluetoothError if the local device is not available.
Returns the class of device of the local bluetooth device. These values indicate the device's major services and the type of the device (e.g. mobile phone, laptop, etc.). If you google for "assigned numbers bluetooth baseband" you might find some documents that discuss how to extract this information from the class of device. Raise BluetoothError if the local device is not available.
socket(proto=RFCOMM) -> socket object Returns a new socket object. Arguments: - proto=RFCOMM: the type of socket to be created - either L2CAP or RFCOMM. Note that L2CAP sockets are not available on Python For Series 60, and only L2CAP client sockets are supported on Mac OS X and Linux (i.e. you can connect() the socket but not bind(), accept(), etc.).
Starts advertising a service with the given name, using the given server socket. Raises BluetoothError if the service cannot be advertised. Arguments: - name: name of the service to be advertised - sock: the socket object that will serve this service. The socket must be already bound to a channel. If a RFCOMM service is being advertised, the socket should also be listening. - servicetype: the type of service to advertise - either RFCOMM or OBEX. (L2CAP services are not currently supported.) (If the servicetype is RFCOMM, the service will be advertised with the Serial Port Profile; if the servicetype is OBEX, the service will be advertised with the OBEX Object Push Profile.)
Stops advertising the service on the given socket. Raises BluetoothError if no service is advertised on the socket. This will error if the given socket is already closed.
Splits the given class of device to return a 3-item tuple with the major service class, major device class and minor device class values. These values indicate the device's major services and the type of the device (e.g. mobile phone, laptop, etc.). If you google for "assigned numbers bluetooth baseband" you might find some documents that discuss how to extract this information from the class of device. Example:>>> splitclass(1057036) (129, 1, 3) >>>