Communicate to PC over USB - c#

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.

Related

How to host an ad hoc 802.11 network from Windows 10 IoT

I want to allow my IoT device to receive a connection from a remote client without the device being connected to a wired network or a Wi-Fi access point. Bluetooth would be an obvious choice, but my clients might not have Bluetooth.
I thought WiFi Direct might be what I wanted but I see in the release notes for Windows 10 IoT Core build 10586 that
WiFi Direct limitations on IoTCore
1.The IoTCore device has to be the connecting device – it will not work as the advertising device with another device initiating the connection.
This implies that API's like WiFiDirectServiceAdvertiser are out and leaves me wondering what other options there are. If I want to do Wi-Fi it seems that I'll have to try to set up a non-WiFi Direct ad hoc Wi-Fi network. I can't find a .Net UWP API to do this (WiFiAdapter seems to only facilitate connecting to networks that can be scanned for). Is there a way of achieving what I want, perhaps using a non-.Net API that is available on Windows 10 IoT Core?
I'm a noob at Windows 10 IoT, but I have the same need.
I did notice that there's a way to onboard a device using the IoT dashboard, which seems to connect your computer to the device via wifi in order to then join the device to a network.
So possibly there are some API's that can do a similar thing?

Windows Mobile (C# code) - cannot download data from the Web when the device is connected to the PC

I develop an app which downloades a file from the Internet (over WiFi). The problem is when I connect to the WiFi network and then I connect my phone to the PC (to debug the code on the device) I cannot download any data from the web. If I disconnect the device from the PC everything works fine. Anyone knows what may causes the problem ?
On some devices, the WiFi drivers are disabled when the device is connected via ActiveSync. You can tell if yours is doing this by going to the Wireless Center and checking the state of your 802.11 WiFi radio.
You can get around this by having a thread in your application listen for NDISUIO_NOTIFICATION_DEVICE_POWER_DOWN events and then issuing a SetDevicePower( ..., D0 ); to re-enable the radio as soon as it is disabled.
-PaulH
Maybe the network that is used is changed when you connect to the PC.

Sending SMS from Windows Mobile

This is the question asked at many places but I could not find any satisfying answer so asking it in stackoverflow. Hope I will get answer soon.
I need to make an Windows Application (VC++/C#/VB.NET) which can send SMS using windows mobile which is connected through ActiveSync or Device center without GSM Modem.
Hope to get positive replies :)
Just so we're clear, you want to use a windows mobile application to send an SMS using the active sync connection to a PC rather than using a WWAN cellular modem?
If the PC is connected to the Internet, I suppose you could use your ActiveSync connection to get Internet access for your mobile device. From there, you could access a web service that allows sending SMS messages. Verizon provides one here: https://text.vzw.com/customer_site/jsp/messaging_lo.jsp
This seems silly, though. Why not just use the device's WLAN to connect to the internet instead of connecting it to a PC? If you must be connected to a PC, why not just use the PC to send the SMS?
-PaulH

Controlling Desktop Client with iPhone over Bluetooth

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.

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

Categories

Resources