I am trying to use the following function:
PCHAR pVID_PID="vid_04D8&pid_fc5f";
DWORD n= MPUSBGetDeviceCount(pVID_PID);
It is imported from mpusbapi.h, where it is defined as such:
DWORD (*MPUSBGetDeviceCount)(PCHAR pVID_PID);
I was wondering where I can find my USB device's VID&PID information. The one I am using doesn't seem to be working because cout<<n ouputs 0! Thanks in advance for any help.
You will normally find them in the driver '.inf' files associated with the device you are using.
Related
I am using devcon to query a verifone device to get the serial number and I a trying to find the serial number below "123-552-666" and output that to a text file. I have been playing around with various commands but just cant seem to get it.
I have used this:
findstr /RC:"[0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9]" "verifone1.txt"
But just got this lie returned
USB\VID_11CA&PID_0300\123-552-666_____
Below is the full data I am searching. Would appreciate any assistance
USB\VID_11CA&PID_0300\123-552-666_____
Name: Verifone V,P Family USB UART device (COM7)
Driver is running.
The problem is this:
I want to display on the LCD, the data transmitted by DHT11, but I fail to do so.
Simulation on Proteus
This is the main code: https://pastecode.io/s/nuw0hxkc
LCD library: https://pastecode.io/s/xh93auwq
DHT11 library: https://pastecode.io/s/7xma86jp
I don't understand where I'm wrong.
With the debugger we obtained these values for the variables:
I_RH=223
D_RH=225
I_Temp=225
D_Temp=225
CheckSum=225
I found the problem.
In the simulation I had to change CKSEL Fuses in Internal 8MHz.
I am using WiPy 2.0 Pycom Board.
When trying to resolve the names of the available devices the names are not resolved properly.
bluetooth.resolve_adv_data(adv.data,Bluetooth.ADV_NAME_CMPL)
This line prints the following data.
None
HE<�#?�'�?
When print the short name
bluetooth.resolve_adv_data(adv.data,Bluetooth.ADV_NAME_SHORT)
It prints out "None"
How to get the proper name of the scanned devices. I am new to this
Thank you!
Using manufacturer data, we can get the proper data from the sensor.
mfg_data = bluetooth.resolve_adv_data(adv.data, Bluetooth.ADV_MANUFACTURER_DATA)
advData = binascii.hexlify(mfg_data)
We have a Linux device which has a speaker and MIC devices. These devices are shared among different modules - example a VOIP call can use speaker, a hazard Warning system can use speaker, a Voice prompt can use a speaker etc:
There seems to be a function in ALSA which uses pcm to provide the status.
int snd_pcm_status (snd_pcm_t * pcm, snd_pcm_status_t * status)
However the *pcm is returned by snd_pcm_open. We do not want to open the device as we would like to know the status of the device using its "name"
Alsa API is here
How can we check if a resource/device is busy without opening it and using its name?
The same information for playback stream X of device Y on card Z is available in the file /proc/asound/cardZ/pcmYp/subX/status; when the device is not open, it just says "closed".
Please note that you cannot use this information to decide if you can open the device, because some other process could have openend it just after you've read this information. The only way to check if you can open it is to actually try.
Though it requires /dev/dsp, this seems to work:
#!/bin/dash
## If the speaker is not used by any, returns 0, and prints "free"
## Otherwise, returns 1 and prints "not free"
iExit (){
trap '' 0
exit $1
}
iCatch (){
# The speaker is already in use
echo not free
iExit 1
}
trap iCatch 0
{
exec 3>&1 1>/dev/dsp
# If the execution reaches here, the speaker is not used by any
# Otherwise, it's catched by iCatch
exec 1>&3
echo free
iExit 0
} 2>/dev/null
Without PulseAudio, it seems on some PC only one output is accepted at one time; on others simultaneous playbacks are allowed. But even in the latter case, the above code works.
NB: The above code does not work with bash; for bash, simply use if/else rather than trap.
NB 2: /dev/dsp may be lacking depending on the kernel configuration.
How to get the IMEI of a Java ME device in a common way that is applicable to all devices
Usually, using java.lang.System.getProperty() can return the device IMEI.
Unfortunately, the String parameter you need to use to get the IMEI will change from one handset manufacturer to the next.
Strings to try:
imei
phone.imei
com.lge.imei
com.nokia.imei
com.nokia.mid.imei
com.siemens.imei
com.sonyericsson.imei
com.motorola.imei
...
you get the idea.
you may need to uppercase the last part of the string.
the format of the result can change too.
it can be a full imei with a "IMEI" prefix and 3 "-" in the middle of 17 digits.
it can be a normalized imei of 13 or 15 digits...
there is no standard way to get the IMEI via Java ME. some phones expose the IMEI as a system property, but others don't or require the midlet to be signed to operator or manufacturer domain (ie. not by you).
In the game i'm developing, to get an unique id for every cellphone (so that they can't duplicate and share savefiles) i use the bluetooth mac address that is different for every single bluetooth device and the java code to get it is the same on every device =D
I have tried what is suggested by both ax and quickrecipeonsymbianos however they both solve the purpose in an elegant way. However, in the BlackBerry we have the getDeviceID() to get the unique id of the device, but Java ME lacks this functionality