Determining if a device is a touchscreen device in linux - linux

I am trying to determine what /dev/input/eventX device is the touchScreen. I am currently looking at the return of EVIOCGNAME to get device name. Looking at the return values of the EVIOCGBIT ioctl I don't think there is a generic way to determine what is the touchscreen. I am interested in any sort of solution to this problem. Thanks in advance for your time!!!

Take a look at:
/dev/input/by-path/
/dev/input/by-id/
/sys/class/input/event?/device/
These might have enough info for your needs. Wish I had a touchscreen to test ;)

If the mask returned by ioctl(EV_ABS) contains ABS_PRESSURE, and ioctl(EV_KEY) contains BTN_TOOL_FINGER, then it's probably a touchscreen.

Related

Beacon/device that is able to receive signal from another beacon and pass it to smartphone

I've been searching in articles for some simple device that is able to do that(title), but I didnt find any. I am looking for a simple device that is able to get RSSI from some unique beacon in range and then pass it (reveiced RSSI value) to the smartphone(via bluetooth).
I thought about some "smart beacon" that is able to work bidirectional (Get signal from another beacon, then pass it to the smartphone). Has it ever been done?(If yes I would be grateful for any articles).
If I wouldn't find anything I will use another smartphone as that device.
I am unaware of any commercially available products that do this. A more common solution might be a device that scans for other beacons in the vicinity and reports them directly to a server.
The reason that reporting scanned beacons to a smartphone over BLE isn't a common solution is because it would be simpler for the phone to do the scanning itself. Why would you need a separate hardware device to do this?
Such a solution you propose might have the advantage of extending the range of the smartphone, but probably not by much. Consider that if the reliable range of BLE is 40 meters, then a phone 40 meters away from the device you suggest might be able to pick up beacons at most 80 meters away in the same direction. Practically speaking this would rarely even double the scan area covered by the phone simply working by itself.

Ubunu, BlueZ, Enumerating paired devices

Using the BlueZ BlueTooth stack, How do I programatiacally enumerate devices that are already paired and not necessarily connected?
Update: The below wasn't as easy as I initially thought to be. adapter_get_devices is only the starting point. It will be helpful, if you could post a sample out of that.
If you don't have enough time, you can as well use the same bt-device tool from command line with appropriate command line params and get the output via pipe. Other choice is to use the ListDevices API in org.bluez.Adapter interface to get a list of paired devices and then I hope some thing in org.bluez.Devices interface will help you.
Update 2: In devices interface you can use, GetProperties method as in this answer
Does this gsoc code sample link help. It is in C now and hope it could be done over Python dbus as well. API is adapter_get_devices. I am yet to try this.

Modifying Bluetooth Low Energy Beacon

I was wondering if it is possible to modify the contents of a BLE beacon to include extra information. If you insert an extra bit at the end you could potentially broadcast a boolean in one direction. Theoretically, if you modified your device to read the extra bit of information this would work. Given existing protocols though it sounds like this would be a lot of work. Is there something out there like this already?
For info, I'm working on the mbed platform where you can modify your own bluetooth beacon payload.
Yes, you can do this with the new AltBeacon specification. There is a one byte manufacturer reserved field which you can use for whatever you want (tied to your manufacturer ID).
There are reference implementations of the specification available for Linux to show you how it works, and there is no reason you cannot implement it on the mbed platform.

How can USB vendor ID and product ID values be spoofed on OSX?

We are considering using the vendor and product ID of a USB device (obtained via IOKit) to unlock certain features of an application. I'm aware that these values can be spoofed, but I'm not sure how easily it can be done on OSX. What is involved in spoofing the vendor and product ID? Is it something that a non-programmer can do fairly easily?
I suspect it would be fairly easy (for a programmer) to create a kext that creates a reasonably realistic IOUSBDevice object in kernel space. However, once done anyone would be able to load it.
It may also be possible to build a codeless kext using AppleUSBMergeNub to masquerade a device as another (though I haven't tested this, it looks like it might work, assuming you only try to match the IOUSBDevice without actually using it).
It would probably be easier to just hijack your API calls in userspace and give your software the answers it expects.
A non-programmer cannot do that. What you can do is writing a kernel extension (an IOKit driver) for the device, that has a matching dictionary matching the real vendor-/product-ID of the device, which causes the system to automatically load the kernel extension when this device is connected and pass a reference to the device object. The driver is now responsible for initializing the device and create all necessary user space information that is necessary for the IOKit framework (the user space library) to communicate with the device. Usually Apple has default IOKit drivers for most USB device classes (that's why you don't need an extra driver for every USB mouse or keyboard for example), but if there is a more specific driver found, then this driver will be used instead. And when creating the user space data, of course the driver may lie about the vendor-/product-ID, causing the user space program to see false values. Since IOKit is written in C++ and heavily depends upon objects and object inheritance, it is not even necessary to write the driver from scratch, but instead it can inherit from Apple's default driver and just override some methods and otherwise rely upon the super implementation. However, writing IOKit kernel drivers is not that easy and even people developing Mac software for years may have no idea how to do that and the IOKit documentation is one of the worst ones Apple is offering.
So to answer your question: Is it possible? Yes. Is it fairly easy? No. Can non-programmers do it? Certainly not, unless someone else has written a ready to use extension for them, that they only need to install.
It's actually rather EASY, and I'm definitely not a programmer!
Found the guide here
http://rolande.wordpress.com/2012/10/25/getting-the-aten-usb-serial-adapter-working-with-mac-osx-lion
Thanks, Rolande!
I was able to change the IDs of a USB Ethernet adaptor I bought on eBay to use another driver with Mac OS X 10.8.
Since nobody has answered so far, I've stumbled across a page which basically says that you can get an Arduino and program it to return any VID/PID/serial that you want. I still can't find any software-only way to do this.
I can create A OCX in Delphi code to do that
And supply infomation to send/receive data to the USB with other states like:- is it still connected.
Natraly I need a little more detail than that in case that same chip is connected from another product.
example frendly name, device desription.............

Iphone4 and GPS alternatives

provided GPS will not work precisely in closed environment like rooms etc,I m interested to know whether Accelerometer can be used to find the position of object relative to certain point? If not then what other technology iphone4 provides to cater it?
Thanks
The accelerometer cannot reliably provide location information, even with the aid of the gyroscope. GPS is the best you are likely to get.
OTOH, work-arounds abound in the augmented-reality space. Consider the ARDefender game.

Resources