hardware-interface

PC hardware port access from Java on Linux

喜夏-厌秋 提交于 2019-12-11 07:55:27
问题 What is the Java-on-Linux equivalent to the C byte-sized PC-architecture hardware port input/output functions? For output there is outb as in this: tmp = inb(0x61); if (tmp != (tmp | 0x01)) outb(0x61, tmp | 0x01); For input there is inb as in this: tmp = (inb(0x61) & 0xfe); outb(0x61, tmp); Purpose: I want to implement something that imposes less overhead than this: try { Runtime.getRuntime().exec("beep") } catch (IOException e) {} as an alternative to sending code 7 (the bell char) to the

UWP USB (Hid) Device Won't Connect

我们两清 提交于 2019-12-10 11:41:27
问题 This is my Hid library. It supports UWP, and Android. https://bitbucket.org/MelbourneDeveloper/hid.net/src/master/ This is an example of the library being used with the Trezor hardware wallet: https://github.com/MelbourneDeveloper/Trezor.Net I can connect to the Trezor with no problem on UWP, but I cannot connect to the KeepKey or Ledger which are other hardware wallets. This is the code I use to connect to both devices in my library. It looks through a list of devices, tries to connect and

Any way to use HTML as an interface to a C/C++ program?

淺唱寂寞╮ 提交于 2019-12-09 02:31:54
问题 I'm developing a product that is interfaced over USB. I want to write a control app for it, but I cannot program a GUI for poo, so I came up with the idea of using a web page (local to the app's install directory) as the interface to the program. So, the line of communication would be: User --> HTML page (not hosted - it's local) --> C++ program --> USB port I'd like to do it this way because it's portable, at least UI wise, and I can write HTML fluently. My question is this: would it be

Which Samsung devices do not support android's native fingerprint API?

无人久伴 提交于 2019-12-06 21:27:06
问题 I'm assuming that no phones with OS before marshmallow support the fingerprint API. My questions are: (a) Do all/any Samsung phones released with marshmallow support android fingerprint API (b) Does any Samsung phones whose OS is upgraded to marshmallow support Android fingerprint API? I've read these: Fingerprint scanner not detected when using Android 6.0 Fingerprint API on Samsung S5 Samsung galaxy note 4 fingerprint not found Android FingerPrint API isHardwareDetected returns false for

How to get the address of mmap-ed memory in Python?

一曲冷凌霜 提交于 2019-12-05 17:48:31
I cannot figure how to get the virtual address of the standard mmap objects in Python (from the mmap module). The documented methods only seem to access the memory as array of bytes or as character strings. But I need to access the mmap'ped memory by precisely 2 or 4 bytes at once - because this memory in my application is mapped to hardware registers (think /dev/mem or GPIO or such). Accessing memory in this way is possible with ctypes module - but for this I need the pointer - or virtual address - of the mapping. Currently I overcome this by using the native open() and mmap() functions from

How to read HardDisk Temperature?

不羁岁月 提交于 2019-12-05 00:15:28
Is it possible to see the Harrdisk temperature with somekind of S.M.A.R.T API or anything like that? i just want the temp, nothing else in C# Stecya Here is code snippet from this article Hope it helps //S.M.A.R.T. Temperature attribute const byte TEMPERATURE_ATTRIBUTE = 194; public List<byte> GetDriveTemp() { var retval = new List<byte>(); try { ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSStorageDriver_ATAPISmartData"); //loop through all the hard disks foreach (ManagementObject queryObj in searcher.Get()) { byte[] arrVendorSpecific = (byte[]

problem with two .NET threads and hardware access

China☆狼群 提交于 2019-12-04 19:58:42
问题 I'm creating an application which communicates with the device via FT2232H USB/RS232 converter. For communication I'm using FTD2XX_NET.dll library from FTDI website. I'm using two threads: first thread continuously reads data from the device the second thread is the main thread of the Windows Form Application I've got a problem when I'm trying to write any data to the device while the receiver's thread is running. The main thread simply hangs up on ftdiDevice.Write function. I tried to

Android capture hardware keyboard event without edittext view

北城以北 提交于 2019-12-03 14:47:52
How can I capture the hardware keyboard events without using an EditText field? For example, in a simple activity the display a square on the screen, when a "B" is pressed on the slide keyboard I want to turn it blue, when a "G" is presses, turn it Green, etc. I don't need help with the color code, just how to intercept the keypress This is not about the soft or virtual keyboard Android classes usually provide event handlers, you can implement when subclassing them. The Activity class has the following event handlers: onKeyDown(int keyCode, KeyEvent event) onKeyLongPress(int keyCode, KeyEvent

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

How to Read RS232 Serial Port in PHP like this QBasic Program

你离开我真会死。 提交于 2019-11-30 07:37:04
问题 I'm trying to port the following small QBASIC program (which works 100%) to PHP: OPEN "com1:2400,n,8,1,DS," FOR RANDOM AS #3 OPEN "data.dat" FOR OUTPUT AS #2 REM read 17 chars from the port scale$ = INPUT$(17, #3) PRINT scale$ WRITE #2, scale$ CLOSE #2 CLOSE #3 SYSTEM Currently I'm calling it in its compiled (exe) form from PHP (on WAMP5) but I'd like to get rid of the QBASIC and call it directly from PHP. I wrote this PHP function but it just hangs at the fgets() line: function read_port(