Capture/receive IR signals in an Android application? - infrared

Is it possible to get the HEX code of remote control from an application and a smartphone that has a infrared transmitter ? (Samsung S4)

Android SDK, starting from 19, introduced a function for transmitting infrared signals only. so the answer is No.
But it's possible to do that if the manufacturer has a public API for doing that. which requires the IR module to be both transmitter and receiver and the OS driver being able to receive the data, etc.

Sorry! I don't know about that. But you can use an Arduino board with IR receiver to capture and decode the IR signal and a Bluetooth module to send it to your device.

Related

How to enable wake on usb (remote wakeup) in android?

I have an AOSP tree compiled on my board. I bought a wireless keyboard and connected it to my board via usb port. I expect when the board is in the suspend state, it will wakeup by pressing a key on keyboard. But it is not so.
I tried several ways in my bootloader (uboot), kernel, etc. But no effect. Additionally I made an experiment and found out that in the sleep state, my usb port (which has a dongle in it) has just 1-5 mA. But it should be higher for the dongle to work!
Has anyone experienced this? How to enable remote wakeup for usb in android?
Thanks
More info:
The uboot supports usb host controller interface. I tweaked kernel build options. but these two actions has no effect.
EDIT : I work on p212 reference board of amlogic. Its SoC is Amlogic S905X.
EDIT 2 : I tested the board (which is a tv box actually) using my phone and its charger and I found that when the box goes to sleep, the charging is stopped!! So I can deduce that the dongle has not enough power to stay alive! (yet to send wake signal to SoC !)
Then I carried out a second experiment: I connected the phone using a USB charger which only has two pin instead of four. (Just voltage supply; differential pins (signal pins) are disconnected). The result: my phone is charging now!! It seems when the SoC is suspending, it sends a signal to USB peripherals telling them to not draw power. Am I correct? How can I configure my AOSP tree and Linux kernel and uboot bootloader to avoid happening this?
Please guide me how to fix it in kernel or other parts of stack!
EDIT 3 :
I have pasted my kernel config here. I configured these options to y but has no effect:
CONFIG_PM_RUNTIME=y
CONFIG_PM_AUTOSLEEP=y
CONFIG_PM_DEBUG=y
CONFIG_USB_OTG_WAKELOCK=y
CONFIG_USB_DEBUG=y
CONFIG_USB_OTG=y
Also this link is my device tree files. (in kernel. NOT uboot)

UWP UART send/recieve bytes incorrectly

i have Pi3 and i'm developing UWP to transfer data from/to Pi3 and another device (currently PC over UART)
but i can't get the right data, i'm using the Sample from Microsoft SerialSample but it didn't work, the data comes not right, i enforced the encoding in the App in both sides but no luck.
Link to the sample
You need check hardware compatibility list to see if your device is supported on Windows IoT core.
Also, and for serial sample here is a note to state the supported USB-to-TTL cables or modules:
NOTE: Only USB-to-TTL cables and modules with Silicon Labs chipsets are natively supported on MinnowBoard Max and Raspberry Pi2.
So, USB-Serial CH340 is not supported on Windows IoT core.
For doing self testing of the device, you can use the sample and do the following two tests :
First, shorten Tx and Rx of the USB-to-TTL cable to test it on PC.
Second, shorten Tx and Rx pins on Raspberry Pi to test its on-board UART.
You will receive what you have sent if the device works normally.

Bluetooth MIDI - Windows

I am trying to connect a Bluetooth Low Energy enabled MIDI hardware to wirelessly send data to a Windows PC and get it to detect as a MIDI device in Windows. Currently, the device is able to pair with my Windows 10 laptop and I am able to read the incoming data off of it.
The same hardware is configured and working fine as a wireless MIDI device on Mac and iOS devices(which natively supports MIDI over Bluetooth). I am trying to get this feature implemented on Windows(which doesn't support MIDI over Bluetooth, although it was promised in Windows 10).
The device, when is paired, is showing up in the 'Bluetooth devices' section in device manager, I am trying to make this device showing up as a MIDI device in 'Sound, video and game controllers' section.
Any help/resources somebody can provide to help me crack this problem is highly appreciated.
Following is my current thought process to implement this.
Pair the device and read the data off of it. (Already implemented)
Create a virtual MIDI port. (Don't know how to implement this, I am currently checking out rtpMIDI)
Send the MIDI data which was read from the BLE device to the virtual MIDI port. (Still don't know how to implement this)
Any suggestions/comments on the above thought process as I am absolutely new to Windows Driver Development.

How can I make an application on pc as a bluetooth low energy device?

I try to make an app on iPhone which can receive date from ble device.
I've read the api from Apple.
But I want to send this data from PC with ble dongle.
There are some samples for receiving data from ble device.
But I need to make the pc simulate ble device.
Is that possible? And if it is, how can I do taht?
If you own a Mac(, considering that you are making an iPhone app), you can create a OS X project that provides GATT and GAP with CoreBluetooth. See the sample code CoreBluetooth: Health Thermometer. Note that the sample code serves as a Central, however, you need to implement a Peripheral with a CBPeripheralManager instance and other delegates.
In your Mac OS X app, you need to provide a characteristic with CBCharacteristicPropertyIndicate or CBCharacteristicPropertyNotify.
In your iPhone app, you need to set this characteristic notifying.

How to read from USB without any driver?

We are creating small system which has GPS receiver and PC. We want to test my GPS receiver, We do not want to go for a driver on the first go. First I would like to test my circuit works or nor. GPS IC has been set to output NMEA sentence. We want a program which just reads data from USB port and print it on the screen.
Can we write something like this easily ? Do we have any open source tool which will achieve this purpose ?
Platform : Windows 7
All devices need a driver, so I'm going to interpret your question as "how can I read NMEA data from my GPS using only drivers provided by the OS, so I don't have to write my own?"
If the GPS chip has a USB interface, then you should have gotten a driver with it. But most GPS chips have a UART interface which in your case sounds like it is connected to a separate USB-UART conversion chip. That conversion chip most likely came with a driver as well, but if not, you could jumper the reset pin of the converter chip, disabling it, and then attach a TTL/RS-232 level converter (available off-the-shelf) to the UART traces and then to your computer's serial port.
Unless you suspect that the driver for the USB-UART converter is causing problems, I wouldn't bother.
Anything connected via USB is a device. Devices require a device driver, period.
You might be able to get away with an existing driver built into Windows. This is how USB memory keys work for example - they present a generic device that looks like a removable disk, and Windows already includes the drivers for generic removable disks.
You would need to check the documentation for your device to see if it can emulate a device which already has drivers. Otherwise you must install the company's drivers, or you're out of luck.
Have a look at libusb. You should be able to read the data with that and a little code. (Yes, it's a driver. I take the question to mean "without writing a driver".)
You need a device driver for your device. Unless Windows already have a class driver for the device.
For USB devices on Windows 7 you can write a user-mode driver, see UMDF.

Resources