w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to create an event# device for a virtual input device (/dev/input/js3) in linux kernel module?
Here is an example, you can use 1. class_create to create the class specified for the device, 2. device_create to create the device node 3. cdev_init to initialize and 4. cdev_add to add the device to the /dev list For example you can refer the below link :Create a device node in kernel module

Categories : Linux

Choose SIM card when sending SMS on a dual SIM Android device
Please refer to this Dual Sim Android article. If you follow this direction, I think you can make it, even if current android api doesn't support it.

Categories : Android

How to tell if android device detected by ADB?
By using ddmlib.jar, which is also used by Eclipse plugins, you can monitor the device connect/disconnect event. The ddmlib is usually found in the tools/lib directory in Android SDK. But there is no the official documents about how to use it. Below is the code example. You have to include the ddmlib.jar and change the adb location according to your environment. import java.io.IOException; import com.android.ddmlib.AndroidDebugBridge; import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; import com.android.ddmlib.IDevice; public class Main { public static void main(String[] args) throws IOException { AndroidDebugBridge.init(false); AndroidDebugBridge debugBridge = AndroidDebugBridge.createBridge("D:\android-sdk\platform-tools\adb.exe", true);

Categories : Java

QT UTC linux Clock skew detected. Your build may be incomplete
I think this error happens when your file times are newer than your system clock. make warns you that it may not be building everything correctly because of this. touching all your files should sort out the problem. One of the causes is an SCM system that preserves file times and is ahead of your system clock.

Categories : C++

How to make the Bluetooth connection after device detected by swing application
Take a look: Connect to bluetooth device with Android/Java http://www.aviyehuda.com/blog/2010/01/08/connecting-to-bluetooth-devices-with-java/

Categories : Java

Uinput virtual device is detected as physical keyboard on android
To solve this issue I made my custom IME: I took the SoftKeyboard from com.example.android.softkeyboard package and then what there's to do is simply override the onEvaluateInputViewShown method this way: @Override public boolean onEvaluateInputViewShown() { return true; }

Categories : Android

Input not detected in jQuery
check this sample. I just removed the "fast" parameter from your .show() call. http://jsfiddle.net/juaning/PsvS7/ From those to calls, let me know if that fix your problem. $('#checkuser').show(fast);alert('hsdi'); $('#checkuser').show(fast);

Categories : PHP

Finding the distance of object from a logitech camera .
though i could barely understand your question i think you are looking for z-direction information even though the image from a camera only gives x-direction and y-direction information. what you have embarked upon is considerably tricky. at you current stage of investigation i would recommend that you go through chapter 4 and 5 of Programming Computer Vision with Python. Then try an algorithm, if your code is giving you errors then someone at SO can help you. even if you have never worked with python the codes in that book will still be understandable because they have lots of explanation. essentially, you could get the algorithm and pseudocode you need for your problem. alternatively, cameras output metadata which is available when you save an image from the camera. this could be a

Categories : Opencv

How do I make the width of and element change when a touch and drag is detected on a touch device?
What I had before was just not working so I started with a script that detected the x position of the mouse and change the width accordingly. var oldXPos = 0; var isDragging = false; $(document).mousemove(function(event) { if (isDragging) { var difference = event.pageX - oldXPos; $('#changeMe').css({width: '+='+ difference}); } oldXPos = event.pageX; $('#changeMe').mousedown(function(){isDragging = true;}) $('#changeMe').mouseup(function(){isDragging = false;}) }); But I also wanted to have it work on a touch device. So I bond the events to touchmove, touchstart and touchend. I also had to change the listener for the mouse position. oldXPos = event.originalEvent.targetTouches[0].pageX; This allow me to get the current position of the t

Categories : Jquery

Installation of ubuntu 12.04: win7 not detected, partitions not detected
You need to run the Ubuntu GRUB bootloader, follow the instructions on the Ubuntu website https://help.ubuntu.com/community/Grub2/Installing#Reinstalling_GRUB_2 When I installed ubuntu, I lost my partitions on the drive, in the end I reverted to having two drives one with Windows 7 and the other with Ubuntu, I had to recover the drive with partition recovery software (TestDisk). Skipping the quick scan saves time as you will probably want to do a full scan. http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

Categories : Ubuntu

How to prevent the input received in one Activity via a bluetooth input device from propagating to other activities started after this one finishes
here's how to hide the softkeyboard of the view: /** hides the soft keyboard for a specific view */ public static void hideSoftKeyboardFromFocusedView(final Context context, final View view) { final InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } a similar thing can be done to show the softkeyboard. here's how to force focus on a EditText, and by this, also show the softkeyboard, even if the view already has focus: public static void forceFocusOnView(final View view) { view.post(new Runnable() { @Override public void run() { view.clearFocus(); view.post(new Runnable() { @Override public void run()

Categories : Android

Linux Device Driver
Probe and remove function is not calling because you have not registered your driver with i2c subsystem. Register your driver using i2c_add_driver() API. In your case, static int __init qt2120_init(void) { return i2c_add_driver(&qt2120_dev); } static void __exit qt2120_remove(void) { return i2c_del_driver(&qt2120_dev); }

Categories : Linux

Linux Device Drivers 3rd Ed and 3.2 kernel
I like LDD3. The teaching style is outstanding. I see the most references to that text in SO, LWN etc. I tried just reading it, that had limited value. It was better to get the examples built and running, play some e.g. with scull, then study the text hard to see how the code was really working. But, to do that with modern kernels, you need updated code. I found martinezjavier code built OK with 3.1 kernel (I deleted tty from Makefile, and added simple_open() definition) then life was great. Also I found some nice work from cs.fsu, including online cross-reference. Cooperstein text also exists, and has exercise solutions with multiple kernel versions, but I haven't used this text.

Categories : Linux

Writing Device Driver in Linux
1. As long as the peripheral is interfaced similarly to the SoC(i.e. uses the same hardware interface on both the platforms), the same driver can be used on both x86 and ARM. This is the advantage of developing modular drivers independent from the Linux kernel core. 2. If your particular peripheral does NOT exist in the current address map(/proc/iomem) then it could mean one of two possibilities : The device driver is not loaded yet. The device uses other form of addressing (NOT memory mapped I/O) Any additional info about the peripheral? How is it connected to the SoC? 3. A device-tree in the Linux kernel is used to describe the numerous hardware (both-on-chip and peripherals), their inter-connectivity and the basic params applicable for their proper configuration and init

Categories : Linux

How do I intercept messages from a USB device on Linux?
Actually you missed a buzzword "USB sniffing". ;-) Here are a few tutorials on USB sniffing on Linux, to get you started. Official Wireshark wiki for USB monitoring biot.com/blog/usb-sniffing-on-linux tjworld.net/wiki/Linux/Ubuntu/USBmonitoring Essentially you use the usbmon Linux kernel module to capture the USB-packets and Wireshark as a front-end to display and analyse the captured USB stream.

Categories : Linux

USB Serial driver in Linux and device name
use /proc/devices for reading major number and device name information. a sample output is attached. useer@useer-VirtualBox:~$ cat /proc/devices Character devices: 1 mem 4 /dev/vc/0 4 tty 4 ttyS 5 /dev/tty 5 /dev/console 5 /dev/ptmx 5 ttyprintk 6 lp 7 vcs 10 misc 13 input Left side integers are major number of the corresponding devices.

Categories : Linux

Linux dma device driver dma_request_channel fails
Could someone explain what LIST_HEAD_INIT does? What C syntax is that? LIST_HEAD_INIT is a macro which initializes the members of struct list_head in LIST_HEAD macro. #define LIST_HEAD_INIT(name) { &(name), &(name) } #define LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name) //Taken from scripts/kconfig/list.h struct list_head { struct list_head *next, *prev; }; Here both prev and next is initialized with same member.

Categories : C

Action to know if there is any bluetooth paired device
If someone is interested, the way that I get solved this, is this: To check if there is any device conected to perform an action, I've used methods based on the BluetoothChat example app. public class Transmission { .... /** * Return the current connection state. */ public synchronized int getState() { return GlobalVar.mState; } In this class, I only declared some variables: public class GlobalVar { .... public static int mState; // Constants that indicate the current connection state public static final int STATE_NONE = 0; // we're doing nothing public static final int STATE_LISTEN = 1; // now listening for incoming connections public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection

Categories : Android

BOOT_COMPLETED action works on one device but not another
I had the same problem. and I solved it by transfering the application into the telephone instead of SD memory card. Alcatel is always installing applications to SD card even if you define the installation directory as telephone.

Categories : Android

linux kernel:why not put device as the first member of platform_device struct
Portability mostly. You don't control the struct definition and it might change in a subsequent version of the linux kernel. And if you depend on the dev being first then the device will suddenly break on an updated version of the kernel. The container_of is a constant expression, thus it gets calculated at compile time and there's no overhead to this.

Categories : C

reading and writing a register linux device driver
If you plan to use Linux Kernel then you can use following api's for reading and writing to peripheral registers: 1. ioremap() (Map the physical address into kernel virtual memory) 2. ioread32() (Read from 32 bit register) 3. iowrite32() (Write to 32 bit register) and finally iounmap() (Unmapping memory which you allocated with ioremap()) Now please refer to below two things: 1. OMAP4 datasheet/manual to get the physical address of registers. 2. Link for explaining above mentioned api's: http://www.makelinux.net/ldd3/chp-9-sect-4

Categories : Misc

Linux terminal input: reading user input from terminal truncating lines at 4095 character limit
I do not have a workaround for you, but I can answer question 2. In linux PIPE_BUF is set to 4096 (in limits.h) If you do a write of more than 4096 to a pipe it will be truncated. From /usr/include/linux/limits.h: #ifndef _LINUX_LIMITS_H #define _LINUX_LIMITS_H #define NR_OPEN 1024 #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ #define LINK_MAX 127 /* # links a file may have */ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX 255 /* # chars in a file name */ #define PATH_MAX 4096 /* # chars in a path name including nul */ #define PIPE_BUF

Categories : Linux

An input in a form named 'action' overrides the form's action property. Is this a bug?
I would not call this a bug. This effect occurs, because attributes can be read by using element.attributename and named inputs inside a form can be accessed in the same way, formelement.inputname. If there is an attribute and an input with the same name, there is no guarantee which one will be used. It probably behaves differently in different browsers. I personally use getAttribute if I am reading a known attribute that was included in the markup or added using setAttribute in JavaScript. For dynamic values like, for example, the checked attribute of a checkbox, I don't use getAttribute. But this is more a question of personal preference, I guess.

Categories : Javascript

Any test tool for the Linux network device drivers testing
Check SymDrive , AutoTest , Linux Driver Verification and Linux Test Project

Categories : Testing

How to get action that android application is trying removed/uninstalled from device
Please try to get the top activity in the task via ActivityManager, and check if it is the uninstall activity. Core code: ComponentName topActivity = mActivityManager.getRunningTasks(1).get(0).topActivity; String packageName = topActivity.getPackageName(); String className = topActivity.getClassName(); Log.v(TAG, "packageName" + packageName); Log.v(TAG, "className" + className); if ("com.android.packageinstaller".equals(packageName) && "com.android.packageinstaller.UninstallerActivity".equals(className)) { //Do anything you want here }

Categories : Android

How does Linux knows about deferred work in a driver and when exactly to use the data brought from hardware device?
The block device driver API has changed a few times since the inception of Linux, but today it basically looks like what follows. The initialization function calls blk_init_queue, passing a request callback and an optional lock for that queue: struct request_queue *q; q = blk_init_queue(my_request_cb, &my_dev->lock); my_request_cb is a callback that will handle all I/O for that block device. I/O requests will be pushed into this queue and my_request_cb will be called to handle them one after the other, when the kernel block driver layer decides. This queue is then added to the disk: struct gendisk *disk; disk->queue = q; and then the disk is added to the system: add_disk(disk); The disk has other informations like the major number, the first minor number and other file

Categories : Linux

Using linux, how can I create a device file outside of the /dev directory that will give me permission to open and read it?
Device files are created with mknod. Permissions and owner can be changed with chmod and chown respectively. If the device file already exists, you may want to create a symbolic link to it instead using ln -s.

Categories : Linux

Bluetooth connection between Android and Linux (RPi) lost on first write action
It turned out that the default Bluez configuration on Debian was the cause of the connection issues (as described in this answer. Disabling the pnat plugin in /etc/bluetooth/main.conf allowed for communication between Android and the RPi. DisablePlugins = pnat For future reference, the UUID used by the applications is 00000003-0000-1000-8000-00805F9B34FB.

Categories : Android

highcharts issue on Android mobile device - the series are hidden when trying to prevent zoom action
Indeed it looks like a bug, so I reported to the developers https://github.com/highslide-software/highcharts.com/issues/1963

Categories : Highcharts

Input not read in Python for Linux
You've deliberately chosen a getch implementation that avoids queueing and only grabs the latest character. You can service input faster by moving the # Do Something # part to a background thread, or use an event-loop-like implementation where you queue up all available characters before trying to process the first one off the queue, etc. But none of that will guarantee you get all characters. If you want to allow characters to queue up to make sure you don't miss any, just… don't use an implementation that's designed not to let them queue up. If you don't need getch to timeout after 2 seconds, you can just do this by just not calling select. That also means you don't need TCSADRAIN. Also, instead of calling setraw, try turning off just the flags you care about. Disabling ICANON is

Categories : Python

Read raw input in Linux in non blocking way
You can check out the poll system call for this. Is for handling I/O on multiple file descriptors. One possibility would be to spawn only one thread to poll for events on multiple file descriptors. Here is some reading material : http://www.makelinux.net/ldd3/chp-6-sect-3

Categories : C++

Linux command input done in Java
You process the parameters of your main(String[] args) method. If an argument is supplied, args[0] will be non-empty, so you can assume/verify it's a filename. Otherwise, assume/verify input is provided via stdin. In code: public static void main(String[] args) { if (args.length > 0) { String filename = args[0]; ... // process the file } else { Scanner sc = new Scanner(System.in); ... // process STDIN } }

Categories : Java

read input value from external device STM32F107
The balance has a load cell inside it, which generates an analog voltage. The processor on the balance is some how not utilized (i assume this as not much details are present in your question). The stm32 f107 controller has an on-chip ADC (analog to digital convertor). Connect the output of load cell (analog signal coming from balance) to the analog input pin of stm32 f107. Configure the ADC to sample and convert the analog signal into digital (use the example code as reference to write the software).

Categories : C

using input tag in a form for IOS - does it save the image on the device?
See this question, that I asked: UIImagePickerController, when didFinishPickingMediaWithInfo not implemented The image is not retained. Your tag will invoke the same methods. You cannot retrieve the image.

Categories : Iphone

hide keyboard on ios device when focus in input
You would have to blur it again but the keyboard might flash. $('input').on('focus', function() { $(this).blur(); }); Or, depending on if you have dynamically created input elements. $('#wrapper').on('focus', 'input', function() { $(this).blur(); });

Categories : Javascript

Getting input device supported formats with NAudio
there was an example on the web, i edited it, and this works for me to get all the capabilites from different devices (it's quite ugly, but it works...): using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Collections; namespace _4ch_stream { class clsRecDevices { [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct WaveInCaps { public short wMid; public short wPid; public int vDriverVersion; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public char[] szPname; public uint dwFormats; public short wChannels; public short wReserved1; } [DllImport("winmm.dll")]

Categories : Windows

Action for input-helper
You could try to do it like this: <input type="text" id="test" {{bindAttr placeholder=view.text}} {{action expand target="view"}} /> See here for a working example. Hope it helps

Categories : Ember Js

GTK Linux C Get Input from Entry Box via Button Widget
Your callback function (named callback) needs to access both GtkEntry widgets in order to obtain their values. There are several ways this can be accomplished. Many GTK C programs use global variables, or global variables with file scope (ie a variable declared as static outside of any function within a file). Remove your entry1 and entry2 variables near the top of the file before any functions: static GtkWidget *entry1 = 0; static GtkWidget *entry2 = 0; And then modify the callback like so: /* Our callback. * The data passed to this function is printed to stdout */ static void callback( GtkWidget *widget, gpointer data) { const gchar *entry_text1; const gchar *entry_text2; g_print ("Hello again - %s was pressed ", (char *) data); entry_text1 = gtk_entry_get_text (G

Categories : C

Linux input event interface numbering
If you mean by "mapping" specifying the name of the /dev/input/eventX 'file', you should use Udev. The kernel assigns the number of the event device, it is a bad idea and probably impossible to try and force this number since you never know which other device may have gotten this number first. My recommendation would be to let Udev create a symlink that points to your device; you can choose your own name and use that in your program (i.e. /dev/my_first_keypad). For example, my Wacom tablet is assigned /dev/wacom with the following udev rule: KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="input", ATTRS{name}=="Wacom Volito", SYMLINK+="wacom" The trick is to find the proper set of variables to exactly specify your keypad. If it is USB based, the vender/product ID are a good start. Ot

Categories : Linux

Edit text not allowing keyboard input on device?
Your question is a bit blunt so my answer will also be blunt. If you are talking about text not appearing in the box when you type with the emulator keyboard, then it is the emulator. To fix this, edit the emulator and enable hardware. Also: Do you have a corresponding Java class which has an ActionListener for each element (including the EditText)? From there, you can use methods such as getText(). I will edit this as necessary.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.