I am working on the Bluetooth media player feature of an internet radio project written in C on Linux platform.
The idea is:
Connect to a nearby BT speaker which is supporting AVRCP profile
Transmit audio through BT to the BT speaker
Handle button push events
Initially I was following the MPRIS D-Bus Interface Specification: https://specifications.freedesktop.org/mpris-spec/latest/
If I understand it well, the specification tells the following:
Request a unique bus name which looks like this: org.mpris.MediaPlayer2.AnyName
Expose the /org/mpris/MediaPlayer2 object path
Implement the following interfaces:
org.mpris.MediaPlayer2
org.mpris.MediaPlayer2.Player
All these steps are done. I am using the D-Feet D-bus tool to test property queries, method calls and all of them are working properly.
Now my problem is, that when I connect to a BT speaker and I push the buttons, the application is not getting the events.
Can you please point out what I am missing and what should I do next?
Thanks in advance!
PM: Sorry if I am not clear, I am a newborn programmer and Stackoverflow user. Please ask me if you need more information. I will appreciate any advice you have :)
EDIT1: The source I have is 1200 line long and I dont know what can I extract from the code for you. But FYI I am using the High-level D-Bus Support of GLib: https://developer.gnome.org/gio/stable/gdbus-convenience.html
uinput module is used to write AVRCP key commands, hence you will require a client to read from uinput when BT headset(A2DP) is connected, check in profiles/audio/avctp.c::uinput_create(), when a avrcp profile is connected, keys are send from handle_panel_passthrough() function to uinput module in kernel
Related
I am working on a CX3 chip from cypress which has a USB 3.0 connectivity. I need to enumerate the USB to work as a UVC class(video class) and as a serial port simultaneously.
I have seen the USB documents related to the same but those don't clearly explain about how to write one.
The CX3 SDK provides help to generate the USB descriptors for a UVC class but that doesn't give info about how to add the COM port features into it.
So my query is how do you write the descriptor for the same.
Thanks in advance.
Refer to the attached project in this knowledge base article from Cypress - "Using CyU3PDebugPrint API to Send Debug Messages over USB-CDC Interface from FX3 Firmware – KBA231478"
This is a modified version on AN75779. You can compare this project with the original AN75779 appnote firmware available here to see the additions done for adding USB-CDC support in a UVC device.
Hope this helps!
In my linux program I need to read the key presses on a bluetooth keyboard.
I tried to follow a set of examples using libbluetooth, but have so far no success.
At the last stage I am totally confused on what API to use.
As I understood, the library provides SDP and HCI interfaces and they both seem to be suitable for my need. I even could read out some information about the keyboard, but I cannot get further how to receive key presses.
So, I need you help to understand:
do I need in general to use the libbluetooth or I have to use native BT sockets?
assuming, that I do need to use the lib, which API to use: SDP or HCI (perhaps another..)?
is the lib only required to initiate data transfer from the BT device, or also to receive the data
I would like to use an arduino with a bluetooth module to modify the volume and skip songs on my phone.
All the information I found was about how to code an application that would communicate with a device via bluetooth, which isn't what I am looking for. I want to know what protocol I should follow to connect to an android device via bluetooth like a car radio would do.
My goal is to be able to use my device as a remote to control the built-in music application.
I think you are looking for the AVRCP protocol. Please send more info about your hardware so I can digg a better answer (if you need more, anyways...).
Hi guys
I'm working on this project where I'll need to retrieve information from a database through sms/ussd, much like how you would check you credit on you mobile phone.
Would appreciate any help to head me in the right direction.
(Hope I put my question out clearly, if not ask me so I can clarify)
I can help you extensively in solving your problem. As far as I got understood what you want to achieve is, perhaps that when a SMS message comes to your GSM Modem or GSM Phone, your software should be capable enough to interpret that message according to your protocol and should respond accordingly, also when it needs to process database. This is absolutely possible. Let me describe it in brief. Following are the general steps:
You must connect your GSM Phone or Modem through your software with a particular COM port.
After assigning and configuring the port, You issue AT+CNMI=2,2,0,0,0 command to Modem, if it responds to OK, then it indicates that it supports this command, else an error is generated.
Now send an SMS from some other phone, you will see that the SMS directly goes to your software, now you can process it as per your needs.
The whole process is slightly a lengthy description, but it is possible.
I'm desperately looking for some C sample source code that describes how to implement a HID client using Bluez. More specifically, I would like to know how to write an application that sends keyboard inputs over bluetooth to another Linux system. (Really, the fact that the receiver is running Linux/Bluez shouldn't matter.)
-Cheers
hidclient http://anselm.hoffmeister.be/computer/hidclient/index.html.en ?
Shamelessly copying from a previous answer of mine:
Some time ago I found this project:
http://nohands.sourceforge.net/index.html
They emulate a full-blown headset with
audio and keyboard controls on the
Linux bluetooth stack. If they can
emulate something like that, you would
probably be able to emulate something
simpler like a keyboard.
Here is full example apply to keyboard and mouse include get report set report virtual unplug function. the client hid is slave side...
http://fatalfeel.blogspot.tw/2013/09/hid-client-of-bluez.html
and you can refer to bluez/android/hidhost.c(Master side) see how to connect to slave