device

How do I uniquely identify an USB-device?

﹥>﹥吖頭↗ 提交于 2019-12-01 19:22:17
I was wondering how to get the unique id of a USB storage device. I already know how to fetch the SCSI serial id from this post : USB-drive serial number under linux C++ The post mentions using the Device Descriptor to get the ID. Can someone post some code to determine the Device Descriptor information under Linux? ls -l /dev/disk/by-id I do it with HAL in C++ / C by using QT. Found some blog about it: How to detect if /dev/* is a USB device Would be also possible to do it by using shell & HAL. I suggest to use libusb . You can find the documentation here . duskwuff To add to what everyone

WP7: Get phone name

好久不见. 提交于 2019-12-01 18:45:56
I'm looking for a simple information. I want to get the name of the device the user is currently using. For example, I want to get "Eric's Phone" (like in Zune). Is it possible? I looked for the DeviceExtendedProperties (see link ) or the UserExtendedProperties see link ) Thanks for you time. "That information is not available to third-party apps." Credit : Krome Studios 来源: https://stackoverflow.com/questions/5616546/wp7-get-phone-name

Getting the Listview default clicked color, depending on the Device

一曲冷凌霜 提交于 2019-12-01 18:39:10
In my android application, I use a listview and some linear layout on wich the user can click. Of course, I had to set the background of my LinearLayout to a xml file where the stated pressed, selected are defined: myView.setBackgroundDrawable( getDrawable(android.R.drawable.list_selector_background)); So no problem I set the drawable to transparent when normal use and orange when clicked. My only problem is that on the galaxy S and some other customized phone (Sense UI) the color of the listview clicked is blue or green! So I need to pick this color to set it to the background of my

Getting live info from /dev/input

雨燕双飞 提交于 2019-12-01 16:22:55
I am unsure if this is the correct place for this question. I am attempting to obtain the axis position values from a joystick /dev/input/js0 on my system. If I run jstest /dev/input/js0 it will give me live feedback on all buttons and axis positions. I am trying to feed this information into my C program to control servos. Is there a function for doing this? I have not worked much with input devices in programming so this is all new to me. This page: http://scaryreasoner.wordpress.com/2008/02/22/programming-joysticks-with-linux/ has a nice writeup on how to read the info from /dev/input/js0

Getting live info from /dev/input

穿精又带淫゛_ 提交于 2019-12-01 15:25:28
问题 This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I am unsure if this is the correct place for this question. I am attempting to obtain the axis position values from a joystick /dev/input/js0 on my system. If I run jstest /dev/input/js0 it will give me live feedback on all buttons and axis positions. I am trying to feed this information into my C program to control servos. Is there a function for doing this? I have

howto check a network devices status in C?

痴心易碎 提交于 2019-12-01 09:31:01
I would like to check a network devices status e.g. promiscous mode. Basically like shown with ip a command. Maybe someone could push me in the right direction? I want to do this in C for linux so linux specific headers are available. You need to use the SIOCGIFFLAGS ioctl to retrieve the flags associated with an interface. You can then check if the IFF_PROMISC flag is set: #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/ioctl.h> /* ioctl() */ #include <sys/socket.h> /* socket() */ #include <arpa/inet.h> #include <unistd.h> /* close() */ #include <linux/if.h> /* struct

Google Play says my apk uses two Native Platforms ( my libraries) and so it supports 0 devices

懵懂的女人 提交于 2019-12-01 08:02:14
When i publish the .apk on Google Play it says: 0 devices supported. And on the bottom of the apk description it's written: Native Platforms: actionbarsherlock, SherlockNavigatorDrawer. These are the libraries i used for my project. They are not .jars, they are folders i put into the libs folder of the app. The problem is this: Google Play considers these two libraries as "Native Platforms" (I'm not sure what it exactly means or is), and this causes a filtering in the support of devices. I'm thinking about what can be the causes of this. My project is a collaboration with a friend and the

Find bus number and device number with device file symlink

北慕城南 提交于 2019-12-01 06:40:20
I have a device file( SYMLINK ) /dev/CDMAModem generated by a udev rule. I want to find the bus number and device number of the actual device. Actually I want to perform USBDEVFS_RESET ioctl on device /dev/bus/usb/BUS_NO/DEVICE_NO in my C++ program. ----udev rule---- SUBSYSTEMS=="usb", ACTION=="add", DRIVERS=="zte_ev", ATTRS{bNumEndpoints}=="03", SYMLINK+="CDMAModem" SUBSYSTEMS=="usb", ACTION=="remove", DRIVERS=="zte_ev", ATTRS{bNumEndpoints}=="03", SYMLINK-="CDMAModem" Charles Pehlivanian I think libudev will give you that: #include <libudev.h> #include <stdio.h> #include <stdlib.h> #include

How to know whether its a tablet or phone in android programmatically? [duplicate]

守給你的承諾、 提交于 2019-12-01 06:20:36
问题 This question already has answers here : Tablet or Phone - Android (30 answers) Closed 5 years ago . I would like to get to detect whether the given device is a tablet or phone in android.I have tried the two in the simulator but none worked. Both are here: First if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) { //code } Second private boolean isTabletDevice() { if (android.os.Build.VERSION.SDK_INT >= 11) {

Drive Letter to Device Instance ID

放肆的年华 提交于 2019-12-01 05:59:15
问题 How do I get from a drive letter to a device instance ID? My process starts with a device arrival message. I have been successful in getting the drive letter from the arrival message and in opening the dvd tray. I have searched the various Setup API items; but I haven't found anything that gets me from a drive letter to a device instance ID. A solution in C# or VB.NET would be ideal, but I'm willing to figure it out from any other language as long as I can see the API calls. Thanks in advance