I'm trying on some code to use ACR83 reader under Linux. I have successfully installed and tested pcsc and ccid drivers on my Ubuntu and also I can send/receive APDUs to my smart card. I was trying to use reader's LCD and Pinpad by a piece of code I have previousely tested on MS Windows successfully but each time I use a definition using IOCTL_SMARTCARD_READ_KEY I get an error on make saying: undefined reference to SCARD_CTL_CODE!!!
what is the diference between these definitions on Windows and Linux?
Should I change any thing?
Thanks for your replies.
I found the answer here.
If you define #define SCARD_CTL_CODE(code) (0x42000000 + (code)) your source will be compatible for different platforms, as mentioned in the link above.
Related
I am trying to implement remote desktop server using libvnc, I have downloaded the libvnc and build the library and able to run sample code. And in the example code I can see the function rfbGetScreen http://libvnc.github.io/doc/html/libvncserver_doc.html which display plain background not the desktop. Does that mean I have to find some other library to get desktop and share using vnc, or vnc has some inbuilt function to do this.
it does seem so. You need to put into rfbScreenInfoPtr::framebuffer screenshots. I've never saw any inbuilt functions yet. May be I've poorly searched.
Try SDL2. May be it will help.
Wanting to give Swift a try and cheaply as possible.
I'm running
Ubuntu 16.04
SQLite 3.11.0
Swift 3.0-dev
All is working, not pretty though, but I'm having a hell of a time connecting to SQLite within Swift.
Has anyone successfully connected and run a query against SQLite with this setup?
While I've seen a bunch of post for iOS solutions I'm not entirely sure these will work on Ubuntu. I wasn't sure if you could or needed to compile Objective-C on Ubuntu.
Since Objective-C as used on Apple's platforms is not well supported on Linux, I think a better approach might be to access the SQLite C API from Swift by either using a system module or bridging header. You might also want to wrap the SQLite API in a C library exposing a subset of the API that you need in a simplified form more suitable to be called from Swift. You would then invoke the wrapper by creating a system module for it (no system module is needed in this case for the SQLite API) or by using a bridging header.
The following may help:
Compile C code and expose it to Swift under Linux
Linking a C library and its supporting library in Swift (linux)
I'm trying to create a Linux application to run on my Zynq7020. However I don't understand how the Xilinx SDK generate the executable file.
When I create a hello world, for instance, it creates one .elf file and under the debug it creates one object (.o) and one dependency (.d). I want to run it under the Linux that is running on my board, how do I do it?
Thank you very much.
I want to run it under the Linux that is running on my board, how do I do it?
Most likely, you just need to copy/download the .elf file to your target board and run it.
If that doesn't work, try editing your question to supply more info. In particular, what commands "create a hello world" actually executes?
When creating the project in the Xilinx SDK, select that it runs on linux rather than standalone. See this official tutorial for an in-depth explanation.
I just tried to run a vala bluez example (found in the DbusClientSamples page) and I got this error:
GDBus.Error:org.freedesktop.DBus.Error.UnknownObject:
Method "DiscoverDevices" with signature "" on interface "org.bluez.Adapter"
doesn't exist
Is the sample using deprecated API? If yes, where can I find an updated document about bluez's DBUS API? All documents I find (by googling) contain the DiscoverDevices method, so I'm quite confused.
AFAICT org.bluez.Adapter is gone (I don't see it on my Fedora 20 system, running bluez-5.12). In its place is org.bluez.Adapter1. You can get all the latest documentation for the bluez D-Bus API at https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc
The best way to get the BlueZ DBus documentation is to download the source from the BlueZ web site, unpack it, then look in the doc directory. All of the current DBus APIs are listed there.
I've been using those documents a lot lately. You could ask for better, but they're good enough. It is mostly obvious, and the most non-obvious issues are explained.
The official BlueZ site also provides a blog post for BlueZ 5 API introduction and porting guide, that provides some descriptions on their DBus APIs. At the top of the page they wrote:
The BlueZ 5 D-Bus API contains significant changes compared to BlueZ
4. The bulk of the changes are due to the following features in BlueZ 5:
...
Introduction of interface versions (e.g. org.bluez.Adapter1). When new versions are introduced we’ll try to keep supporting at least the two latest versions simultaneously.
...
There is a section that discusses the DBus Object Manager:
Instead, an application would discover the available adapters by performing a ObjectManager.GetManagedObjects call and look for any returned objects with an “org.bluez.Adapter1″ interface.
Also, aside from checking out the docs directory of the BlueZ source code (as mentioned in the this and this answers), I find it also helpful to check the sample source codes in the test directory (https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test).
Here are parts of the example-advertisement code:
BLUEZ_SERVICE_NAME = 'org.bluez'
LE_ADVERTISING_MANAGER_IFACE = 'org.bluez.LEAdvertisingManager1'
DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager'
DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties'
...
def main(timeout=0):
...
adapter_props = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, adapter),
"org.freedesktop.DBus.Properties")
adapter_props.Set("org.bluez.Adapter1", "Powered", dbus.Boolean(1))
I plan to learn embedded linux and writing linux device drivers.
After reading about device drivers and walking through some tutorials, I'm a little confused about the kernel-source that to be used for compilation.
I am using ubuntu 11.04 and in my /usr/src/ me find the following:
tijin#tijin-Vostro-460:/usr/src$ ls
gcc-4.4 linux-headers-2.6.38-10-generic-pae
linux-headers-2.6.38-10 linux-headers-2.6.38-8
my questions:
1)do I need a kernel-source to compile the driver code or the headers are enough?
2)where can I get the kernel source code and what is the procedure to install the source code. Please let me know the details.
Headers is enough
from kernel.org - or for Ubuntu specific kernels, follow the documentation
For module compilation instructions, see this question
Yes. You need not only the source but a "make"d source (a compiled kernel source).
The main location to get the kernel source is: http://www.kernel.org
As you're using Ubuntu you can just download the source from the repositories.
Here's the page indicated at Ubuntu's help as a guide for compiling a kernel from source on Natty (11.04):
http://blog.avirtualhome.com/2011/08/03/how-to-compile-a-new-ubuntu-11-04-natty-kernel/
For a fresher to device driver coding the "hello world" driver code reference is here :
http://www.linuxquestions.org/questions/linux-kernel-70/simple-makefile-error-all-nothing-need-to-be-done-600403/ .
This link also discussing the issues related to the Makefile. Important idea that i got from the reference is: Never ever copy-paste the content of a document for creating Makefile.
If you are getting trouble with seeing logs then please refer the link :
http://www.cyberciti.biz/faq/linux-log-files-location-and-how-do-i-view-logs-files/
thanks.