Send a string from Arduino to Windows Store App via Bluetooth? - bluetooth

I am trying to get a Unity3d Windows Store App game to read a string of text that is sent from an Arduino Uno Rev3 over Bluetooth.
Unfortunately, the Windows Store App platform does not allow use of the System.IO.Ports namespace, so I am not sure how to get it to read the Bluetooth data.
Does anybody know how to read data from Bluetooth in a Windows Store App?
Any help is appreciated,
Thanks

If your HC-06 has COM-port capabilities, then you can use: [https://learn.microsoft.com/en-us/uwp/api/windows.devices.serialcommunication
there is a sample on Github:
[https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/SerialArduino
To find out if your device has COM-port capability on windows 10 go to settings/Bluetooth, pair device and go to more settings, tab com-ports and try to add port. If the list is empty unfortunately you can not use Windows.Devices.SerialCommunication APIs to communicate with an Arduino device.
Another way is to use the Bluetooth GATT protocol for communication.
It allows you to read and write data and subscribe to indicate and notify events.
For this there is also a sample on github:
[https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLEClient
It depends on your HC-06 what Gatt-services are available but there is most likely a service that can reed and write and get notifications.
Hope this can help you,
Groover

I ended up using a BLE solution based on this example:
https://www.simplicity.be/article/eddy-and-his-stones-diy-arduino-beacon-mobile-apps/

Related

Make the HID keyboard with BLED112

I use the BLED112 and want to make it act like a HID keyboard.
The BLED112 receives the keystroke from the Mobile. For example, "p".
Then the dongle act like a keyboard so we can see the "p" is written on Notepad of PC.
Sending data from Mobile to dongle is not matter. I have already done.
My problem is to send the keystroke event to the PC so the dongle works like a keyboard.
I want an example or the full guide.
Thanks.
BLED112 is a Bluetooth Low Energy dongle provided by Bluegiga (Now acquired by Silicon labs). If you have studied the BLED112 user manual and bluegiga API reference documents, you'd understand that there can be two possible ways to read/write data via BLED112:
Use bgscript
use the bglib library into your C/C++ application
BLED112 is enumerated as a virual com port. I don't recall the name of the windows application that comes with BLED112 but it sounded like BLEGUI or something. This application uses the APIs to handle connections, read and write events. In a nutshell, you need to implement the same thing that this application does. For that, you can leverage the logs it spits on the console. This log will help you with all the commands you need to send and all the response that you need to handle.
Then, you need to make your application communicate with the virtual com port over which these commands will be send and responses will be received at.
Once you establish this, you'd be able to display your keystrokes.
It is a substantial work if you haven't worked with BLE. But like people say, there aren't free lunches!

Custom UUID for bluetooth using bluez

I'm trying to pair my iPhone with my ubuntu computer over bluetooth. I'd like to use CoreBluetooth. I have bluez configured correctly, but I need a UUID for CoreBluetooth to connect to my computer. How do I go about setting a custom UUID in bluez?
Ultimately, I'd like to send commands with my iPhone to my pc and then use https://github.com/eelcocramer/node-bluetooth-serial-port to access the transferred data. Is there a better way to do this? I'm new to bluetooth.
Does your computer supports bluetooth 4.0? You can search for
[centralManager scanForPeripheralsWithServices:nil options:nil];
and every reachable device will be found.
With your other problem i can't help you sry.
You need to use bluetooth classic not the low energy for serial port communication

How to send data to website from GPS device using gprs?

I had planned to do mini project. With GPS modem using GPRS(sim card with internet connection) and i need to send the data from GPS modem to a website. Is it possible? If so how it can be done? What are the languages needed? And also tell me about the best GPS device?
GPS devices communicate using a standard protocol called the NMEA protocol.
Assuming you are using .NET you can check out the Positioning code in the DotSpatial open source project: http://dotspatial.codeplex.com/
They've got classes to decode the NMEA strings and can probably do much of what you are describing out of the box.
As for the best GPS device, if you need standard resolutions, any GPS device will do. They can be had for 10's of dollars. We often use the USGlobalSat model BU-353, although this is USB so it may not work in your application.
For what you want u must do 2 things
1. Create a TCP Listener which will wait for info using TCP in same port and put into database
2. Create a web or windows application for you read from database.
i have done something like this in my recent project.
Regards.

mobile receipt printing with J2ME via Bluetooth

I need to make an app in J2ME that can be able to read a SMS and then print it on an epson tm-p60 printer(ESC/POS emulation) via bluetooth.
i looked at the epson supprt site but the only ADK/drivers they provide are for:
1.Sun Java2 SDK Standard Edition Version 1.4.2_10
2.Sun Java2 SDK Standard Edition Version 1.4.2_04
3.Sun Java SE Development Kit 6 Update 3
so i don't know how am i gonna be able to use ESC/POS commands inJ2ME.
I'm a bit clueless on how i will approach this project.. plus w/c would be better to use for this project? Netbeans or Eclipse?
Thanks!
SPP (Serial Port Profile) over Bluetooth means using an RFCOMM connection to send and receive data as if it were a physical serial connection. This is part of JSR 82, so you will be able to develop only on handsets that support this JSR.
You need to:
Figure out how to discover bluetooth devices, and scan for SPP services on a discovered device, then connect to one of those services, using one of the many JSR 82 tutorials out there.
Then send ESC/POS protocol data over that connection -- I assume you have the protocol specification available? Google turned up this application programming guide.
HTH.
JSR-82 Bluetooth API support L2CAP protocol, RFCOMM and OBEX profile. I don't know detail of Bluetooth basic printing profile (BPP) but, if you look into basic printing profile document you can find that BPP built on OBEX profile.
I can't find open source project for BPP on JSR-82. Please try to search it, but if you can't find one you might need to write your own.

Auto Detect Windows Mobile Device programmatically

I am writing a windows application (written entirely in C++) which reads files from a storage card on a mobile phone running Windows Mobile. The tough part is, I don't know how to make my application detect the event that a user has connected the mobile phone to the USB of laptop. I did some reading on MSDN and have written a small code using RegisterDeviceNotification, which detects whenever a USB disk is attached/removed from the laptop. However, I am unable to tweak this to make it work for phone type devices. Please help me out through any links/tutroials which explains this(preferrably C++, as I don't know .NET or C#).
Thanks
Alok
According to this article you can use RegisterDeviceNotification to get notifications when activesync detects a device has been plugged/unplugged. (See option 3 at the end of the article)
It may just be a matter of setting up the correct notification filter.
Windows Mobile devices use RNDIS, a network interface protocol behind the scenes. Hence, the RegisterDeviceNotification method still works, but you're looking for a DEV_BROADCAST_DEVICEINTERFACE, not DEV_BROADCAST_VOLUME. (i.e. dbch_devicetype==DBT_DEVTYP_DEVICEINTERFACE)
You can use RAPI or RAPI2 to detect when a Windows Mobile device connects to a PC via Active Sync or Windows Mobile Device Center. RAPI can also be used to read the files on the storage card and much more.
RAPI is simpler to program because it is a C based API. RAPI2 has more functionality than RAPI, but is an object oriented COM API. If your needs are simple and you only care about one device/connection at a time then RAPI is good enough. There are two RAPI functions used to detect connections: CeRapiInit (blocking), and CeRapiInitEx (signals an event upon connection).

Resources