BlueZ D-Bus C or C++ Sample [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am trying to write an application which searches Bluetooth devices nearby and communicates with them. My application is going to be written in C++, and intended to work under Linux.
4 years ago, I used BlueZ. But now, as I see, the API has been changed a lot and now it's using D-Bus. I was not experienced with D-Bus. I looked at some tutorials related to client/server model. Now, I'm OK with D-Bus.
But I couldn't find any example which explains how to use BlueZ with D-Bus. I need some guidance for using BlueZ and D-Bus together.
Are there any tutorial or sample for working with BlueZ via D-Bus in C or C++?
(note: already googled it)

You might want to check out the main.c file in the client folder of the most recent Bluez source code. It's the source code for the bluetoothctl tool. Run it too. The source code shows exactly how they use GDBus, including proxies, agents, calling methods like described in the API documentation (/doc folder) and all that. It's in C and uses the high level API.
I suggest you step through the code because it took me 2 weeks endlessly trying to understand Bluez in C and the fact that there's no documentation, but when I read that main.c file I was ready in a day. Read up on proper DBus API documentation and more importantly the concepts. Some documents that helped me:
The gdbus tool: https://developer.gnome.org/gio/stable/gdbus.html
These contain all the calls to gdbus and objects in the main.c file and explain them very well. https://developer.gnome.org/gio/stable/gdbus-convenience.html
D-Feet, an invaluable tool to inspecting and learning about Dbus on your system. Try checking out the /bluez bus. https://wiki.gnome.org/action/show/Apps/DFeet?action=show&redirect=DFeet
or
sudo apt-get install d-feet
Not much of a tutorial, but worth a read to understand some concepts, as the bluetoothctl tool fits into what they're trying to say here. http://dbus.freedesktop.org/doc/dbus-tutorial.html
The bluetoothctl creates an interactive shell though, so it might not be wise to waste time trying to fit in your code, but just pick what you need from it.

Related

Cortana from Win32 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
This is a rather directionless post I'm afraid an I apologize. I'm trying to figure out how to use Cortana from win32 (non universal) applications. I found this link but I can't tell if there is a way to access these APIs from non-managed code. That sent me on a rabbit trail to find out what this UniversalApiContract stuff is and how to use it form native code but so far I am coming up very empty.
Could someone please provide me with some direction!! What do I even need to search for to begin to learn how to access these APIs natively? Is there some reading on windows runtime that I should undertake?
Thanks in advance and again I apologize for the general questions - not sure where else to turn.
[Expressed displeasure over how many people voted to close the thread without any useful response or suggestions]
Now, on to science.
After spending some time with this it would seem this is not possible. I was able to call the API from Win32 by using the Visual C++ Component Extensions. This allows you to use windows runtime and CLR like concepts but results in purely native code. As a side note, since I wanted to link this with an application that I did not want to recompile with this extension, I did this in a DLL and delay loaded it.
Unfortunately the call to install the voice command definition file failed with a COMException: The process has no package identity. This means I can successfully call the API, however it requires a package identity - in other words, it must be called from a Modern/Store/Universal App context with an application identity.
The only way remaining to me seems to be to use the Cortana background API to interface with a modern app I write in the background, and use it to broker calls from my Win32 app to Cortana through some sort of custom communication. Icky.
I hope this helps save someone else time.

Communication method for data exchange between a server and several clients for 10+ years [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
We're running an experiment which will involve collecting data from multiple stations around the world. Each station will be providing HDF5 files with magnetic field measurements in a rate of 1 kHz and some auxiliary data in real time. The latency is going to be a few minutes.
I'm assigned to design this program (in C++, with clients/server model, with server being in linux and clients being cross-platform), and apparently I'll be designing this from scratch. My first concern is not to really do everything from scratch because this will be more error prone and pure wrong, so my question here is: What information/file transfer protocols/libraries should I use so that
The program can live for 10+ years with minimal maintenance
I can have very good support from the community for when I need help.
Since we need something relatively secure, my first thought was libssh (the only cross platform opensource library available out there for ssh), but then after discussing with some pros there I realized that the support there isn't so wonderful because only a few people work with libssh. The pros there hesitated in suggesting OpenSSL, but with OpenSSL I'll have to write my own authentication (apparently, I'm not an expert and that's why I'm asking).
What would you suggest? Please share your vision to whether I should go for OpenSSL, libssh, or something else.
PS: Please, if you're going to start off by saying this question is off-topic, move on and ignore it. Consider being helpful rather than critical.
If you require any additional information, please ask.
I think that OpenSSL might be a good choice.
No you do not have to "write you own authentication" - you just need to generate certificates and keys and put them in the right places - that is all.
I would suggest to look at the examples in <openssl-source-dir>/demos and <openssl-source-dir>/apps to get you started. Reading a book about OpenSSL would also be a good idea - for many other reasons (sometimes not directly related with SSL/TLS).
I hope that helps.

Tools for making web applets [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Iv written a program in C++ that takes a set of n points and two double variables as input and output a graph with some special properties. I also wrote some OpenGL codes to visualize this graph. I showed the result to my teacher and he liked it and asked me if I can build an applet so he can put it in his web site so the other students can use it. I almost know nothing about making an applet. What are my options? is it possible to do such thing?
note that the C++ program itself is not simple.
an output of my program looks like this.
You could make your C++ program some specialized web server, using HTTP server libraries like libonion or Wt; you might also use FastCGI (i.e. make your program become a FastCGI server application), or, if your program is quasi-static and produce simple output and if you accept having a crude web interface, perhaps make it use old CGI
Of course you need to learn more about Web technologies (e.g. on w3schools - which is not perfect). You need to learn HTML5 with a bit of HTTP, Javascript (perhaps with JQuery) & Ajax, Html5 Canvas, perhaps WebGL. Google browsers also have Native Client (NaCl).
But all this requires a significant amount of work (weeks or perhaps months; if you do it, please publish your software as free software)
BTW, you might be interested in graphviz ...

Tutorial on how to host VST plugins using JUCE? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I would like to write some code to host VST plugins in my C++ application. It looks like the JUCE library may be helpful for this. Does anyone know where I can find a tutorial on how to host and connect together VST plugins in JUCE?
I've built the JUCE code and got the 'Plugin Host' sample working. It looks like the library will be able to do just what I want. My problem is that I'm finding the sample code hard to follow (not many comments etc). It also uses a lot of JUCE-specific coding for managing the UI and so on. I'm finding it hard to disentangle what I need to do to manage VST plugins from the other code in the sample.
If anyone knows of a tutorial I would be very grateful!
Most of the sample Juce code is indeed very Juce-specific, and if you're going to use that platform I'd encourage you to stick with it and push through the samples, even though they may not be very pretty.
It might be useful for you to know a bit more about VST hosting outside of Juce, though. Here's a tutorial on hosting VST's by hand in a C++ application.
This tutorial walks through the development of audio applications using JUCE, and in part 2 they cover hosting VST plugins.
(edit: I updated the links, also note they have a part 3 to the series)

QNX C/C++ software [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
How can I get QNX C/C++ sample code?
Since QNX is proprietary, it can be hard to get a "jump start".
But as Research In Motion (the makers of BlackBerry) acquired it and are heavily investing on it - in the hopes to get as many developers as possible to jump on the new BBX platform, you may benefit from learning QNX via RIM - and maybe even winning a free Playbook tablet.
You can download the Native Development Kit (NDK) from this website: https://bdsc.webapps.blackberry.com/native/
It is a slightly modified version of Eclipse called Momentics. Using the Playbook simulator (which runs under a - hopefully - free version of VMWare) you can write, compile and run your QNX softwares.
I suggest you taking a close look at PPS objects. They are the most outstanding "idiosyncrasy" of QNX and mastering it will pretty much enable you as a QNX developer. Also, try to register for Foundry27 on QNX website and there you will find handful of (unfortunately almost hidden from Google) resources on QNX.
I hope that helps!
EDIT: and with the NDK it comes with a handful of examples. You will find them pretty much similar to POSIX.
QNX Community Resources is always a good source of help and sample code for QNX.
Usually, library reference entries have a small sample code, e.g. MsgDeliverEvent.
If you go to QNX.com, download the QDE/Momentics trial, you'll get an Eclipse-CDT which will have examples available from the start page.
QNX Neutrino is also similar enough to Linux/Unix systems that most software examples (for example socket and terminal io code) will be equally applicable to QNX as they are for their Unix system.