Controlling Desktop Client with iPhone over Bluetooth - c#

Does anybody know any online tutorials about receiving data between a desktop client (in c# mostly) and an iPhone with bluetooth?
How would a C# desktop client connect over bluetooth... by reading the COM Ports?

From what I understand the iPhone will not pair with a PC as a bluetooth device, as an iPhone will only connect to approved device types. There may be some way to "fake" this and have the PC show up as an approved device, though I'm not sure there's a BT stack to do this.
An easier solution (if it meets your requirements) may be to try using the WIFI connection, you can open up a TCP socket between the device and PC fairly easily and push data through it at a high rate. You should be able to do this with an ad-hoc connection (so you don't need a router) though I've never tried it. You might want to look into cocoaasyncsocket if you do this.

Related

Communication between Hololens v2 and Android smartphone

Good afternoon, I'm developing a system with a pair of Hololensv2 and an android smartphone using Unity.
In my system the smartphone should send some data to the hololens, more precisely I'm trying to send the location data (GPS) cause in the hololens there's not that specific sensor.
I developed a full functioning UDP solution already, but now I need to build a network free one to be able to use everything outdoor.
The first possibility that came to my mind was to use Bluetooth, connect the 2 devices a send from the smartphone a message to the hololens.
Following this project on GitHub: https://github.com/FlipWebApps/HololensGPS i managed to build a theoretically working Bluetooth receiver on the headset, the problem is that it is a beacon receiver and not all the smartphone can be set as beacons.
Moreover, on Unity, I can't use directly Bluetooth directives but I need to pass through a plugin. I tried 2 already without good results:
https://assetstore.unity.com/packages/tools/integration/ibeacon-15260
https://assetstore.unity.com/packages/tools/network/bluetooth-networking-for-ios-tvos-and-android-124274
While with the first one I didn't get anywhere, with the second one I managed to find, without being able to connect to it, the hololens Bluetooth.
I really feel like I'm missing something...
I don't even know which option would be better between trying to connect the 2 devices directly or to keep trying to set the smartphone as a beacon and the hololens as a receiver...
Any idea/suggestion would be highly appreciated... Thank you all.
It really depends on the type of communication needed across devices, but since your networked version is UDP a one-way broadcast should work. If the Android device is broadcasting a value then the Hololens can just listen, and it should not matter if you have 2 or 200 of them. The trick is that none are 'connected' to the broadcaster, they are just observing.
You would only need to connect the two Hololenses to each other if they provide dependent services. In that case you might consider setting the Android as a WiFi host which would have greater range and is already coded ;)
If there is no need for that level of range or complexity, the Beacon protocol can act like UDP. As Beacons are Bluetooth Low Energy (BLE) you would need to set the Hololens to Observer mode so that it will listen but not connect. A very good explanation on how to do that with BLE on a Pi is here.
I was in the same situation as you, and I solved it using UDP. You need to have two phones, however, since Android phones (and I imagine iOS devices as well) do not make themselves a part of their own WiFi hotspot for security reasons. You have one phone acting as the switch, with its WiFi hotspot enabled. Your second phone connects to that hotspot, and broadcasts its GPS location over UDP. Your Hololens also connects to the same hotspot, and can then receive the UDP messages. All using Unity code, without the need for native Bluetooth plugins.

Get two devices to communicate over WiFi without going through IP (p2p over the WiFi layers only)

I need to get two machines to communicate via WiFi without using IP (I do not want to use IP sockets). The solution preferably should work with both WiFi modes (infrastructure such as regular WiFi and ad-hoc such as WiFi Direct). A C# sample code would be great please.
I have searched a lot and could not find any code similar to a socket program that sends and receives data between two machines (p2p) but using only WiFi without any IP.
Apple's Multi-Peer Connectivity framework supports setting up a Peer to Peer connection without the developer having to manage the IP connectivity directly, but it uses IP to deliver data and is limited to Apple devices.
It's possible to do this if you are willing to write the low-level c code to do it, but any solution which avoids IP will have to recreate significant portions of the protocol to be useful and would almost certainly require much more work than just using the IP features of the OS.
For very simple forms of communication between Wi-Fi stations you can use custom Action Frames and Information Elements, but those require very low-level access to the driver.

Communicate to PC over USB

How can I exchange data between my WP8 app and my desktop Windows app running on the PC that has the phone connected with a USB cable? On WP7, there was TCP/IP networking over USB connection. On WP8, it seems it no longer works.
On the device side, NetworkInterfaceList class lists the Ethernet adapter, however NetworkInformation.GetHostNames method says there is no IP address assigned to that NIC. Is there a way to assign an IP address to that NIC, and use it for phone-to-pc communication over the USB cable?
On the PC side, looks like the connectivity DLLs implement Smart Device Connectivity API. Where can I find Microsoft.Smartdevice.DeviceAgentTransport.dll for Windows Phone 8 platform?
Are there some other options?
P.S. I am not submitting anything to the marketplace, so private or undocumented APIs are OK for me.
I was just looking for this one myself and found a good resource over at msdn,
IP over USB. As long as you have the windows phone SDK installed you have everything.
Edit: A small update, it seems that the server code must be running on the device and the client on the host, but apart from that everything worked as expected.
Used regedit to add a new entry under HKEY_LOCAL_MACHINE\Software\Microsoft\IpOverUsbSDK and created values similar to other entries, just different ports.
It took a few seconds and a refresh of regedit for IpOverUsbEnum.exe to display the new service.

sending sms through mobile connected with pc

I am trying to develop the application which, any mobile is connected with PC and needs to send SMS through the mobile one by one, software is used only to connect the mobile and type the message.
When the send button is clicked the message should send through mobile not through any modems.
I have tried to search everywhere, but I couldn't find anything.
Can anybody guide me on how to proceed?
Thanks in advance.
If you want to do it on your own without using a sms-library you can open the modem in handset through a serial port and send out hayes at-commands for sms-operation.
Before you program you can try it using a terminal program.
Example
; Send message to "0170 00000" (Ctrl+Z to finish and send the message)
AT+CMGS="017000000"
> This is a SMS Test!!^Z
+CMGS: 3 ; OK, message gone
Note: these at-commands are not supported on every handset. Maybe the handset needs additional configuration through extra at commands (set textmode, set sms-gateway, ...)
Several sms hayes related commands are described in http://www.cellular.co.za/at_etsi.htm .
Yes, absolutely you can send sms through your pc connected with your cell phones. "Nokia PC Suite" is the only software; after installing software in your computer, connect your Nokia handset by usb cable with computer and select pc suite option. After then launch Nokia PC Suite. Now there u go.
What you are trying to do is difficult. It is difficult not because the programming is difficult, but because there are restrictions (security!) from the carrier side and from the mobile manufacturer side.
To be able to send messages from a mobile device connected to a PC, the mobile device must provide access to the internal functions its OS uses to deliver those SMSs. They could be low level modem commands, or a high level API; but in any case it will depend on the device manufacturer SDK.
If you want to type more efficiently, then maybe a mobile device with support for a bluetooth keyboard is a good idea.
I guess that depends strongly on the used mobile phone. I don't think there's a generic solution for all manufacturers. And such feature is probably hardly documented.
However, I'm not sure, if this is worth the effort at all, because e.g. Nokia provides the software "Ovi Suite" (or older PC Suite), which already supports sending SMS via connected phone. I think there are similar programs from other manufacturers.
It is possible to send SMS from a computer via a connected phone, but the phone itself will be the modem (I assume you don't want to connect another device for SMS). You can see this question, this question and (possibly) GSMComm for more info

C# and ActiveSync communication / open and read files

I have a device connected to a host computer through cradle usb. Now, I'm just wondering if I could use C# sockets to communicate with the device (ie device sending data, host computer processing it then replying back to the device). How can I accomplish this? by that, what ip address etc etc.. do I have to change so that it would connect cause I have the sockets working on wireless. If not, then is there a way to connect to the device, open and read a file (a text document to be more specific) from the device to my host application.. any ideas?
Thanks! :)
Depending on your target device, when you connect via ActiveSync it likely makes a local RNDIS network connection between teh two devices. You can resolve "ppp_peer" as the partner's network name instead of trying to use a hard-coded IP address (IIRC the IP is different on XP than on Vista).
Be aware that it's not a full connection. TCP packets gets passed through, but things like ICMP do not.
Of course, this just gives you a socket connection, just like if you were to connect between two PCs. It's not going to allow you to do file system operations unless you have an app on the other side listening for commands. If you want that type of thing, Microsoft provides the Remote API (RAPI) interface (wrapped in managed code here)for a lot of basic commands, and it can be extended (with C) to do anything you'd like.

Categories

Resources