device-driver

Iphone device token - NSData or NSString

主宰稳场 提交于 2019-11-30 06:24:44
问题 I am receiving iPhone device token in the form of NSData object. When I tested my notifications script function, I have only copied that object from log and the notifications went fine. However when I try now to automatically do it, I am sending the device token as ASCII encoded string in the form of variable self.deviceToken = [[NSString alloc] initWithData:webDeviceToken encoding:NSASCIIStringEncoding]; The string that I am getting has some funky characters and looks similar to this "å

How Can I put ARM processor in different modes using C program?

不羁岁月 提交于 2019-11-29 23:53:22
问题 I am going through different mode of ARM processor. I want to check the processor state(ex: register values) while it is in different mode. So can someone help me to find out sample code to put processor in different mode ? For example I found a code for undefined mode: asm volatile (".short 0xffff\n"); 回答1: If you wish to test the modes from user space, this is a difficult question. There maybe no way to go to FIQ mode, if there is no FIQ peripheral in the system. Your system may not be

OSX Kext not being properly freed

拈花ヽ惹草 提交于 2019-11-29 11:22:04
I have written a device driver kext for a hot-plug SCSI device, based somewhat on Wagerlabs code (using a driver-user client-application model) and everything works. The only remaining concern is that the driver appears not to be consistently freed, especially if the application crashes. For example, when I try to unload the kext, even with the device disconnected and the application closed, there are still outstanding instances of the driver and user client (with the driver generally outnumbering the user client). I have logging in the driver functions like free() , and when I shut down the

What is the difference between devm_kzalloc() and kzalloc() in linux driver programming

梦想的初衷 提交于 2019-11-29 02:55:13
问题 I have found devm_kzalloc() and kzalloc() in device driver programmong. But I don't know when/where to use these functions. Can anyone please specify the importance of these functions and their usage. 回答1: kzalloc() allocates kernel memory like kmalloc() , but it also zero-initializes the allocated memory. devm_kzalloc() is managed kzalloc() . The memory allocated with managed functions is associated with the device. When the device is detached from the system or the driver for the device is

How can I get a list of all the active kernel drivers on my Android system?

≡放荡痞女 提交于 2019-11-29 02:03:54
How can I get a list of all the active kernel drivers on my Android system?. What is the equivelant of Linux "lsmod" in Android? I used adb shell and also opened my Android Terminal emulator app and did an "lsmod". I get some kind of a lame list of two items from my BSP. But it doesn't list all the drivers on my entire system that the Linux kernel has actively running. Doing an 'ls /sys/module/' on my Samsung Galaxy S3 running 4.1.1 Jelly bean, I get the following output http://pastebin.com/2zF8RwvS That is a list of all the built-in modules in my Kernel 3.0.31 Additionally, there are loadable

Iphone device token - NSData or NSString

≡放荡痞女 提交于 2019-11-28 18:13:24
I am receiving iPhone device token in the form of NSData object. When I tested my notifications script function, I have only copied that object from log and the notifications went fine. However when I try now to automatically do it, I am sending the device token as ASCII encoded string in the form of variable self.deviceToken = [[NSString alloc] initWithData:webDeviceToken encoding:NSASCIIStringEncoding]; The string that I am getting has some funky characters and looks similar to this "å-0¾fZÿ÷ʺÎUQüRáqEªfÔk«" When server side script sends the notification to that token, I am not receiving

Can't read from linux character device

杀马特。学长 韩版系。学妹 提交于 2019-11-28 12:54:09
I am implementing an SPI driver for an accelerometer. The SPI part is done but I can't read values from userspace. static char charDevMessage[CD_BUFFER_SIZE] = { 0 }; ... static ssize_t char_dev_read(struct file *filep, char *buffer, size_t len, loff_t *position) { int error_count = 0; struct xyz_values xyz; size_t size_requested; xyz = adxl345_get_xyz(); memset(charDevMessage, 0, CD_BUFFER_SIZE); sprintf(charDevMessage, "%d,%d,%d", xyz.x, xyz.y, xyz.z); printk(KERN_INFO "MOB: %s, requested size: %d\n", charDevMessage, len); if (len >= CD_BUFFER_SIZE) { size_requested = CD_BUFFER_SIZE; } else

Getting device/driver information related to a COM port?

孤者浪人 提交于 2019-11-28 09:16:50
I have a Serial-to-USB device with a similarly named device driver in the Windows device manager. The devices do not always grab the same COM port on system boot, so my program needs to identify it on start up. I've tried using RXTX to enumerate the COM ports on the system, but this didn't work because CommPortIdentifier.getName() simply returns the COM name (eg. COM1, COM2, etc.) I need to acquire either the driver manufacturer name, or the driver name as it appears in the device manager, and associate it with the COM name. Can this easily be done in Java? (I'd be interested in any 3rd party

OSX Kext not being properly freed

只愿长相守 提交于 2019-11-28 04:36:43
问题 I have written a device driver kext for a hot-plug SCSI device, based somewhat on Wagerlabs code (using a driver-user client-application model) and everything works. The only remaining concern is that the driver appears not to be consistently freed, especially if the application crashes. For example, when I try to unload the kext, even with the device disconnected and the application closed, there are still outstanding instances of the driver and user client (with the driver generally

I/O completion port's advantages and disadvantages

天涯浪子 提交于 2019-11-28 03:06:15
Why do many people say I/O completion port is fast and nice model? What is the I/O completion port's advantages and disadvantages? I want to know some points which make faster IOCP than other model. If you can explain it comparing other models(select, epoll, traditional multi thread/process), it would be better. Damon I/O completion ports are awesome. There's no better word to describe them. If anything in Windows was done right, it's completion ports. You can create some number of threads (does not really matter how many) and make them all block on one completion port until an event (either