Achieve AVRCP using Pybluez in Linux - python

I want to make my PC as AVRCP bluetooth controller (CT) and handle a device which supports AVRCP bluetooth profile This has to be done using python scripting. Can I achieve this from pyBluez. If yes can some one give me some pointer of how to achieve this.
Thanks in Advance

There is a new Linux Bluetooth Stack supporting AVRCP. See here.
There seems to be an implementation of AVRCP in Python here.
Have a look at it and try it.

I'm also exploring this area. Further to the links provided by Radu, I've found https://trac.ctdo.de/ctdo/browser/btctl/src/pyavrcp which appears to implement the controller (CT) side of AVRCP, as well as the target (player).

Related

Programmatic access to Brother ADS-1000W

I've got a Brother ADS-1000W receipt scanner and using the ControlCenter4 software it works great. However I would like to be able automate the scanning process and I can't find any pointers/clues on where to get access to the ADS-1000W specific features. With the ControlCenter4 software, I can have the scanner deskew images. It also scans to an arbitrary length and width (matching the scanned receipt). I'm assuming this is being handled by the scanner, but it may be happening in the ControlCenter4 software. These features specifically don't seem to be accessible in the TWAIN interface. I tried using TWAINCommander 3 and it doesn't show the deskew and arbitrary size features in the TWAIN interface.
I've got both Linux and Windows machines available and I'm cool with a commandline solution or an SDK that I have to write software to implement. If it's an SDK, I prefer Python.
I know this is somewhat open-ended, but hoping someone can point in a direction for further research.
Just in case anyone else stumbles across this question: The ADS-1000W supports scanning to FTP. If PDF is selected, then the scanner supports the de-skew option, so I installed vsftpd on my linux box and used Python to process the files as their uploaded.

How do I connect/disconnect/configure a wireless network in python?

I'm looking to see if there is a way to connect or disconnect to a wireless network in python, preferably a way that would work for both public and secured networks if I supplied the password. If I can configure the options about wireless, that would be an added bonus (ex. see all networks in range, see information about networks in range (like encryption type)). I run a windows computer, so I see many answers to this question in Linux, or other operating systems, but none in windows. Thanks in advance.
You'll probably have to use one of the DLLs in windows for that. Using ctypes you can get access to the win32 API from Python.
It looks like the functions from wlanapi.dll, starting with WlanOpenHandle and WlanEnumInterfaces might do what you want.
Edit: For example code, see the accepted answer to this.

put interface down in windows with python?

A friend asked me for a program to switch his integrated wifi card off and on. I've googled it with no luck. Can someone tell me if there's any way to do that natively in python?
Does the solution have to be native? I would use a utility called 'devcon' which is created by Microsoft. You could use Python to call devcon and parse the output and disable the required device(s).
Here's an example:
http://en.kioskea.net/faq/1886-enable-disable-a-device-from-the-command-line
You can get the list of network devices with
devcon hwids =net
You can try to parse the one with WiFi in it and the lines that start with PCI.
Or you can do something like:
devcon disable hwids =net, unfortunately this disables the ethernet devices as well.
If you need to just disconnect from WiFi you can use netsh wlan disconnect
EDIT: Ok, finally found the perfect solution (IMHO).
You will need to install two packages pywin32 and wmi.
Using WMI (Windows Management Instrumentation) bindings for Python this becomes pretty easy.
import wmi
cur=wmi.WMI()
wireless_devices=cur.query("select * from Win32_NetworkAdapter WHERE NetConnectionID = 'Wireless Network Connection'")
for device in wireless_devices:
device.Disable()
If it returns a tuple with the first value of (0) it succeeded. Obviously, this must be run as an administrator (otherwise you will get 5 as the return value).
If there is a way to do it from the win32 API in C/C++ (I honestly don't know), then you can use the pywin32 bindings to do it from Python.

Using python to control a phone with bluetooth

I would like to know if there are any API's for python to programmatically control a phone, like starting and ending calls, but also to record conversations.
I would also like to use the Headphones and Mic of the computer to talk over the phone.
Any info would be great, I tried googling for something, but nothing useful came up.
Be careful when using PyBluez! The results will actually depend on the BT-USB dongle you are using. Depending on the hardware(the BT chip in there), PyBluez will use one or another BT stack - for example there was one from WIDCOMM. Results will vary, as PyBluez is actually wrapping around those stacks - all of which are far from complete.
So, when you have a working project, be sure to know what actual BT stack you were using :)
For Python audio stuff, you could try this.
PyBluez is an effort to create python wrappers around system Bluetooth resources to allow Python developers to easily and quickly create Bluetooth applications.
Unfortunately I've not found a page dedicated to its features, but it could be a good starting point, whether everything you need is in its feature set, or if you could build your application upon it by extending it.
http://code.google.com/p/pybluez/

Multiple mouse pointers?

Is there a way to accept input from more than one mouse separately? I'm interested in making a multi-user application and I thought it would be great if I could have 2 or more users holding wireless mice each interacting with the app individually with a separate mouse arrow.
Is this something I should try to farm out to some other application/driver/os_magic? or is there a library I can use to accomplish this? Language isn't a HUGE deal, but C, C++, and Python are preferrable.
Thanks :)
edit:
Found this multi-pointer toolkit for linux (it's actually a multi-pointer x server):
http://wearables.unisa.edu.au/mpx/
You could try the Microsoft Windows MultiPoint Software Development Kit 1.1
or the new
Microsoft Windows MultiPoint Software Development Kit 1.5
and the main Microsoft Multipoint site
Yes. I know of at least one program that does this, KidPad. I think it's written in Java and was developed by Juan Pablo Hourcade, now at the University of Iowa. You'd have to ask him how it was implemented.
http://code.google.com/p/pymultimouse/ is a library using windows raw input, it worked in a test with 2 mice.
You could use DirectInput with C/C++ (there's probably also bindings in other languages). You use IDirectInput8::EnumDevices() (using DX8; same function, different interface in other versions of DirectX) to get a list of all attached devices. Then, you create the devices and poll them IDirectInputDevice8::Poll(). This should almost definitely work with any number of mice, keyboards, and other input devices. MSDN has really good documentation on this.
I have this vague feeling that BeOS used to let one pair a mouse and keyboard and have separate active windows and inputs. Wow... that was a long time ago. I thought that it would be very interesting for "paired" programming.
See my answer here (avoid the JNI stuff): How can I handle multiple mouse inputs in Java?

Categories

Resources