I've lost my BT earphones, and am trying to determine the last time they were connected to my macbook, to narrow the time window and help the search.
How can I learn this from system logs?
I opened Console.app, and found numerous mentions of connections to BT devices, of the format:
com.apple.message.domain: com.apple.bluetooth.connect
com.apple.message.host: 05AC8290
com.apple.message.process: blued
com.apple.message.device: Unknown Name
com.apple.message.uuid: 0x001F
com.apple.message.direction: Outgoing
com.apple.message.rssi: 127
com.apple.message.pairing: LE
com.apple.message.rate: LE
com.apple.message.sco: LE
SenderMachUUID: 557AF7B3-7829-380F-83D7-684B2004E540
How do I determine which ones are connections to my BT earphones (not my smartphone)? I know the MAC addresses of both the devices that connect to this computer, but they don't seem to be mentioned in the logs.
Hold shift and option buttons at the same time and click on the Bluetooth icon:
Click on the Debug and then click on Enable Bluetooth logging. Then in the magnifier type "Console". In the search area, search for Bluetooth. You should be able to see the logs:
In order to check Bluetooth logs open the Console.app e.g. by pressing cmd + space, then typing "Console" and hitting Enter.
Inside the Console.app you can filter messages just to Bluetooth related by typing "bluetooth" inside Search field.
Tested on macOS Catalina.
Related
I'm trying to experiment with Bluetooth discovery from the command line.
I have tried:
btdiscovery from https://bluetoothinstaller.com/bluetooth-command-line-tools ( via https://superuser.com/questions/1604313/command-line-check-if-a-certain-bluetooth-device-is-discoverable )
The C code from https://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedotherprotocol4j.html (via Unable to connect to Bluetooth Device using Window's Bluetooth API in C++)
Both of these, have the same problem: that when I run Bluetooth "discovery", they report one or two devices maximum, and then they exit.
However, if in Windows 10, I go to: Windows Settings/Devices/Add Bluetooth or other device/Bluetooth, so I get "Add a device" window:
... I get a while bunch of devices that are continuously updated (and some disappear, then reappear again)
Does anyone know of a ready (C/C++) example that would reproduce the same results I get in this "Add a device" window, but in the command line/terminal?
Short of that - could anyone give me any pointers on what APIs I'd need to use, in order to replicate the same Bluetooth discovery results from this "Add a device" window in a command line application? (presumably, that would be a continuous Bluetooth discovery process, that would be interrupted by Ctrl-C or similar in the terminal)
I am trying to allow a POS web app to print directly to a StarMicronics (or any receipt printer, for that matter) using the Chrome webusb API.
I am using the example here almost exactly except I have modified the vendorId filter to the Vendor ID of StarMicronics. I have also tried it with a completely empty filter. It works great on the Mac computers I have tested it on, but the problem is on Windows.
When I click the print button, Chrome opens up the connection window, my device is listed and I can select it and click Connect. So navigator.usb.getDevices() is working great. When I refresh the window, after having connected the website to the device, Chrome finds the device again with no problem.
The problem comes when I try to do device.open(). I get this error in the console: DOMException: Access Denied. From this point, I can't do either device.selectConfiguration() or device.claimInterface() because I get the error that the device must first be opened, obviously.
I have enabled all the flags I know of in Chrome:
#enable-experimental-web-platform-features
#enable-webusb
#new-usb-backend
But none of this has helped. I have also tried using other printers, such as an HP deskjet and a Dymo Label Writer all with the same resulting error message that access is denied.
Again, it is working fine on Macs.
Any help on this would be greatly appreciated.
You get the "Access Denied" error on Windows because there is already a driver that has claimed the device. The Windows driver model requires that the "winusb.sys" driver be loaded for any device that will be accessed by a userspace application like Chrome.
See my answer to this earlier question about smartcard readers which encounter the same difficulty on Windows.
You'll need to first download the Star Micronics Windows Driver (available here for the SP700). You want the "USB Vendor Class Driver" (again, available here for the SP700)
Of course, there is no auto-installer (to my knowledge), so you'll have to open up the StarUSBVendorClassDriver_... zipped folder, and navigate to Manuals/usb-vendor-class-driver_im_en.pdf.
In reading this, you'll notice that you actually need to install the driver from the CMD line with the following cmd (note the <version_here>, don't COPY+PASTE):
pnputil -a StarUSBVendorClassDriver_<version_here>\USBVendorClassDriver\SMJUSBCOM.INF
Once you have the correct driver installed, download the Zadig utility from the download page here. The website is ad-ridden, but I had no problems.
Open Zadig, toggle the "Options" menu dropdown, and toggle "List All Devices".
You should then see your device in the drop down below. Select it as shown below.
Then, on the LHS dropdown, you will see a "non WinUSB" driver selected. On the RHS, ensure that WinUSB is selected, and click "Replace Driver".
This should enable WebUSB! Happy printing!
I am currently writing an application that receives touch input through the windows WM_INPUT messages and the HID API. Every touch point received has a handle to the device associated from which it came. This is the same device that the family of WM_POINTER messages would report for the same touch point. My application needs to know which monitor corresponds to a particular touch device. Is there a programmatic way to determine this? If I was using the WM_POINTER API I could use MonitorFromPoint or something similar.
In the control panel under "hardware and sound" there is a category "Tablet PC Settings". If you click this category, a dialog box launches which has a button "Setup". This button launches a calibration tool which allows you to pair a USB HID touch device with a monitor.
Does anyone know where these settings might be saved to?
relevant links:
structure received in WM_INPUT messages:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645562(v=vs.85).aspx
Structure received in WM_POINTER messages:
https://msdn.microsoft.com/en-us/library/windows/desktop/hh454907(v=vs.85).aspx
Thanks.
A generic way to determine where things are stored in the registry, is to watch registry changes. Process Monitor from the Windows Sysinternals Suite by Mark Russinovich, can be used to watch and log changes to the windows registry. So you can start it logging, and then perform your calibration, and then stop and examine the log for the desired registry activity.
Here is a link to a similar question I asked
Associate HID Touch Device with Pnp Monitor.
In short, you can use the details from the HIDApi calls with queries of registry keys to link HID Touch Devices to monitors.
I have a Bluetooth low-energy device paired to my Windows 10 machine, when an application try to use it, Windows automatically connects the paired device. I want to be able to read if the device is connected or just paired to Windows. Searching around Window's Device Manager (accessible from Control Panel), I saw that the device had the property "Is connected" under the details tab, it's value (true/false) was changing accordingly to the actual device status.
I tried to read to access this property using the SetupDiGetDeviceProperty function with the DEVPKEY_DeviceContainer_IsConnected predefined key but for some reason I get ERROR_NOT_FOUND.
Any ideas?
Is that possible to send characters to currently open text box via IME ? What I am trying to do is that I have Bluetooth module that handles connection between Bluetooth keyboard and windows mobile device , when user press key on Bluetooth keyboard Bluetooth module receive it and send it to currently open text box via IME. You Comment will greatly help me as i am newbie in Windows Mobile development.
if the BT keyboard is using the HID protocol you do not need any additional software. All key strokes should be automatically routed as keyboard input to the right input.
If you need to write your own software, you need to open a COM port connection to the BT keyboard. Then your app can receive the BT keyboard messages and issues them as keyboard messages. See also http://www.hjgode.de/wp/2011/11/10/keywedge-updated/
But at all, your WM6.5 should have the HID drivers and so, after connection to the BT keyboard you do not have to do anything more.
Post the device model name, if you need more assistance.
regards
Josef