Can I enable PC to support GATT server (peripheral) role? - bluetooth-lowenergy

I tested BluetoothAdapter adapter = await BluetoothAdapter.GetDefaultAsync();
and found out that IsPeripheralRoleSupported = false.
I tested on both desktop and laptop, which are both Windows10(1903), but had no luck.
Is there any way I can enable the PC to support peripheral role?
Or is this property unable to be changed?

Mike Petrichenko answered on the comment if anyone looking for the answer to this question!
You can but with very few Bluetooth Adapters. 100% working one is Laird BT851
You can not "enable" it. It depends only on hardware (Bluetooth module). Use compatible Bluetooth module (the one I posted above is compatible) and GATT server (peripheral mode) will work. Windows has very special requirements fro Bluetooth hardware to support peripheral mode and only few devices can be used.
It's a dongle (https://www.digikey.com/product-detail/en/laird-wireless-thermal-systems/BT851/BT851-ND/8251358). You should replace your one with this. Or, if you have build-in dongle, disable build-in. There are also 2 more known and tested models but they are not USB.

Related

Communicate between 2 WinCE devices using USB - how?

We've got two WinCE devices that need to talk to each other, they don't have WiFi or Bluetooth so I think a wired USB connection is our best chance. I've been reading up on using ActiveSync and serial over USB, but all the articles are geared towards talking between a WinCE device to a full Windows box, never between two WinCE devices.
If we can get ActiveSync working, that's fine, the other option is just to open COM ports on both sides and write our own communications protocol.
Given the project timelines, writing any sort of device driver isn't an option, this needs to be something that is built in to WinCE.
We are building WinCE for both devices, so I can make any modifications necessary at that level.
Is there a way to get these two guys talking to each other?
If you can't write your own driver then your fastest route is probably to get a USB to serial converter for both devices and then connect them via serial.
Obviously, you'll need to choose one that has support for Windows Mobile. I think FTDI based adapters should work.
Once that's working you just use the built-in serial API to read and write data.

API to access GSM signal on computer

Hope this is the right place to ask - assuming so as it is related to programming.
I am looking for some hardware (say a dongle) that would open up an API for my computer to a SIM card. Does that exist anywhere?
The idea would be that I can then use my existing SIM card on its existing network/contract and with a bit of code, send/receive calls and texts. I figured that if a phone can be programmed to do it why can't a computer? I just need the hardware.
Any suggestions if this kind of thing is possible? Even by maybe integrating a phone?
You can use AT commands with any modem or phone, whose driver exposes a modem port when you connect it to a computer. Plug in the phone or modem, and go to Windows Device Manager, and look under "Modems" and see what you've got. From "properties" of the Modem, you can see which COM port it is on.
AT commands are an older method of communicating with a modem. There is a standard set of commands for GSM/GPRS/3G/4G devices available from 3GPP.org, here. Manufacturers add their own proprietary commands for more obscure functions. Many but not all of these are in the public domain.
Some newer plug-in modems may appear as a network adapter (you can see this in Windows), due to their drivers. In this case, you can use the following interfaces:
on Vista: NDIS, proprietary interfaces
on Windows 7 and 8.x Desktop apps: Windows Mobile Broadband API
on Windows 8.x, in the Metro/app area: Windows.Networking and MobileBroadband APIs.
on Windows 10, UWP, there are UWP APIs here. But they do not give as much functionality as the Desktop APIs.
On Windows 8.1 and Windows 10, if the appropriate drives are present it is possible to use the new MBIM interface via the desktop Mobile Broadband DeviceServices API. Mobile Broadband Interface Model spec available here.
On Linux, use AT commands via the serial port.
I'm a bit puzzled by your requirement to make (voice?) calls via a phone connected to a computer. Do you mean Skype? In this case, of course, you wouldn't need any interface for making calls, you would just open an IP connection over a data session - which can be done via any of the above interfaces.
(added this comment as an answer, as there was more information)
I use this GSM device: http://www.mikroe.com/click/gsm2/ connected to a basic UART like: https://www.sparkfun.com/products/718?gclid=CIj1xOzbur4CFUVbfgodCpQASQ
Then use AT COMMANDS.
I also use a piece of software called QNavigator to inspect the modem/gsm: http://www.soselectronic.com/?str=1329

Are vendor-specific USB serial adapters supported in Metro apps?

There's a sample provided for CDC compliant USB devices here. Are vendor-specific USB devices supported too? Or are CDC compliant USB devices the only ones supported in Metro apps?
Your help is much appreciated!!
Vendor specific USB to UART bridge devices will not be supported under CDC, only a USB CDC class device would be supported in that case.
However, since Microsoft has opened up a USB API you could still access vendor specific devices. The downside here is that the devices will not look like a COM port, you would need to use the Windows.Devices.Usb namespace to access the device directly through it's USB protocol. This means that the vendor for a specific device would need to publish their protocol, or you could reverse engineer or use the Linux source as an example of what the setup packets for certain commands should look like.
Since you're using an FTDI converter you can get the device protocol information from their Linux Source (this is from 3.13 kernel) and use this to access the device through Windows RT.
FTDI might support Win RT in the future (today is 2014-Apr-15), you can ask for a beta driver here:
Windows RT Driver

WinCE and PC USB communication

We are developing some device and we need to find good solution for one of needed functionality.
Thing is that we need communicate WinCE 6.0 (ARM) and Windows on PC.
Easiest way is of course COM port but in our case it is impossible (all serial ports are used on WinCE and we don't want to add one more).
Second option is LAN but for us it is not the best option for few reasons.
So there is third option we could use. USB to USB communication but how to do that ?
Of course WinCE is USB Device and PC is USB Host so all hardware basics are meet.
We could use Active sync but there are few problems with it:
- WinCE 6.0 is not working with WMDC (drivers on device just crash after connecting device with PC) and I didn't find any solution for it so in this case we need to use WinXP on PC side (old ActiveSync)
- we need to filter communication with active sync to only our application, no other non authorized software should be allowed (what I know this is imposible to obtain).
So propably best way to do what we need is to communicate throug USB like standard COM (serial communication).
The question is, how it could be made, are we need to write driver on WinCE and also a Driver on Windows (PC), or there are better solution? Maybe some driver for WinCE 6.0 that would emulate Virtual COM on PC side (and of course allow standard Read/Write to it on WinCE side) ? Could someone tell me if something like that exists ?
We probably found best solution for our problem. We use TCP/IP over ActiveSync (standard WinSock connection over USB). It is possible because ActiveSync provides an IP address for Host PC. It can be acquired trough something like that (on WinCE):
std::string lIPAddress = "ppp_peer";
struct hostent * lH = gethostbyname(lIPAddress.c_str());
DEBUGMSG(ZONE_ERROR, (TEXT("Addr: %S\r\n"), lH->h_addr_list[0])); // just a debug info
lServerAddress.sin_addr.S_un.S_addr = *(u_long *)lH->h_addr_list[0];
Of course this is not full example, it's just a sample :)

PIC32 bluetooth

I want to implement bluetooth communication on my final bachelor project, but I'm having a lot of doubts.
One of the requisites of this project is to have a Java application that can talk to the micro via Bluetooth. After a lot of research, I've found one that I think it's very good with a SPP profile, but I still have a lot of questions about it:
All the bluetooth on a PC implements the SPP profile stack?
If you need to develop a Java application that runs on every PC that implements the SPP stack, how would you do it?
We started by trying to use BlueCove and JavaBluetooth.org API, the first one runs great but I don't know if it's just on my PC and the second one sends an error (Stack not initialized). Which one would you use, and why?
We decided to buy this bluetooth module, from Sparkfun, any comments for those of you who already use it?
Thanks
I used a similar product for my senior design project from Sparkfun (RN-41): http://www.sparkfun.com/products/10559
It worked right out of the box as a simple UART. This allowed my team and I to develop a simple C# application that used the .NET SerialPort class (System.IO.Ports) to communicate between an MSP430 and the PC application we were developing. If streaming data is all you care about, these Bluetooth modules work great. Java implements a similar SerialPort class for RS-232 communications. Don't forget that Bluetooth was developed to replace a serial cable.
I hope this answer helps! Good luck.
I personnally achieved to use the Sparkfun's bluesmirf devices to communicate with my own Java application (an Eclipse plug-in). I tested it successfully under Windows, MacOS & Linux based systems.
I used the RXTX Java library to connect to the corresponding serial port once the Bluetooth devices were paired. Under Linux I even achieved to configure rfcomm to automatically pair the Bluetooth devices on demand.
From my experiment I encountered some stability issues... Sometimes it simply fails to connect to the given port even if it exists or refuse to reconnect on it. Sometimes it hangs the whole system...
I never found any good solution to fix those issues that seems to be completely system dependent. I would be interested if any one achieved to use it properly...

Resources