GPS Windows Mobile 6 (using Microsoft.WindowsMobile.Samples.Location;) - c#

well guys, i am part of one team. (I dont have the project yet, i am new).
They did a application using gps, problem is it fail sometimes...
why? they think gps fails because users has the device in "energy saving" mode; then the device hibernates
after 5 minutes if they dont use it.
GPS brings sometimes bad coordinates (for example coordinate shows users is on "SEA" or in "Japan". I repeat, My partners thinks problem is because device is in "energy saving" mode. how can i change this configuration with C# while application is running (maybe back old configuration when application has been closed).
I am using this library.
using Microsoft.WindowsMobile.Samples.Location;
I can't check if it works because now i dont have a device, and i my computer doesn't have GPS, do you have any idea for i can check the application?.
i am using
`"Windows Mobile 6.0 SDK"`

You can install networking functionality while using the Microsoft Device Emulator. This blog explains how to setup network functionality on Windows 7. Follow the official documentation if you're not using Windows 7.
You can emulate GPS functionality using the FakeGPS program supplied by Microsoft. If you want anything close to real data you'll need a text file containing raw NMEA to feed into FakeGPS. You can simply record bytes passed through the GPS COM port to a file to generate a NMEA file. If fake GPS doesn't like your file then remove the non-standard NMEA lines and try again.
You should do some research on Windows Mobile Power Management first to understand the problem. The quickest hack is to simply call SystemIdleTimerReset() more frequently than the battery idle timeout (use SystemParametersInfo() and SPI_GETBATTERYIDLETIMEOUT) to prevent the device from sleeping. This will decrease the battery life of the device! There are other more elegant solutions available such as using the Power Management API.

Related

Is there a way use Bluetooth LE libraries C# in Windows 10 to communicate with sensors or micro-controllers?

I spent some time looking for ways to exchange data from a micro-controller Bluno Beetle from DFRobots that uses Bluetooth LE and a desktop application written in C#. DFRobots actually has a code (in Java Android), where they use GATT profiles to exchange data from/to the micro-controller and an Android Phone. I tested this app myself and it works perfectly. I would like to have a similar application written in C# running on a Desktop. I recently bought a BLE dongle (the cheapest option I found on Amazon) which I can pair successfully.
So far, I found solutions that involve using UWP, being one of those an example for exchanging data between a Windows Phone and a Heart Rate monitor, and very little documentation on how to accomplish that for Desktop applications here and here, that involve using System.Runtime.WindowsRuntime but no other information about how to connect to a device or listen to what is being broadcast.
Do any of you guys know if it is really possible to accomplish that? And if so, are you aware of a tutorial I could use to help me?
Thanks!
but no other information about how to connect to a device or listen to what is being broadcast
Here is an official and complete BLE client/server sample which you can use as a starting point
Look into the BTFramework library. We have worked with it for years. It took one afternoon to establish good communication with an ioT device this week. We are using C# NET, by the way. Their libraries have worked well on all platforms from the latest versions of Windows 10 all the way back to barely-functioning XP machines, skipping Vista of course.
As to the dongles you can buy... we support a commercial product using those dongles, and found their marketing claims don't always support their performance. Some work fine for a day, then fail, then work again. And one large batch from one vendor may work fine, but a batch purchased months later may have a high failure rate when you are pushing the envelope.

Windows iot/apps Programmatic Bluetooth Pairing

I'm trying to broadcast a bluetooth signal from a Raspberry Pi 2 running Windows Iot Core so that I can connect to it from smartphones and other devices, but I've been stuck for the last couple days on actually receiving a pairing signal.
Using the Windows Bluetooth docs I am able to broadcast the signal and I can see it from my desktop as well as from my phone.
However, this is as far as I can get. I want to be able to pair without a PIN (the device will not have a screen), but the pairing fails any time the device is selected.
I am using
SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication
and
DevicePairingKinds.None
But the connection callback is never hit. I have looked at many similar questions that are either unanswered or do not have the appropriate information since I am using an RPI2 and not a desktop app.
I am not looking to pair via the web interface, but simply through code
.
[UPDATE]
I've tried the 32feet.NET library but it appears to be too old to support the PI2.
I also tried a few NuGet packages, nothing seems to work yet.
I am not master in IoT but recently, I have started exploring it so I know Raspberry Pi 2 is hardware and we can use it to develop some basic IoT device/concepts. I can not help you with the code but may be with some idea.
I remember, for making any embedded system, we used serial port of pc and transferred command to devices. Something similar I found in one of the tutorial from David Jones. It is about to connect Bluetooth to windows 10 using serial port.
In both the explanations, SPP (Serial Port Profile) is used and also Universal Windows App is referenced. May be you get some start point or spark to comlete you work.
Check this and this. It also uses RPi 2.

Serial Port Comm with Arduino Device from Windows Store C# App

I'm currently working on getting a Leonardo device recognized and communicating with my app over a serial port in C# for the Windows 8 App Store. I'm using http://msdn.microsoft.com/en-us/library/windows/hardware/dn312121(v=vs.85).aspx#step2 as a guide, in conjunction with http://code.msdn.microsoft.com/windowsapps/USB-CDC-Control-sample-5ba19caa to guide me.
I'm having problems however in the sense that my Arduino device isn't showing up despite me entering my PID/VID and Class/Subclass/Protocol so I feel I'm missing some steps and was hoping someone that has experience with this could point me to a more specific/granular example.
My device is an Arduino Leonardo and I'm running windows 8.1 using Visual Studio 2013 Ultimate, code is in C#
Any help is appreciated!
Just general thoughts on regular windows applications (not aware of W8 AppStore):
Might help or might not, in the second case, sorry for wasting your time...
To get a "regular COM" device in Windows, without any additional drivers, you should make the device appear as USB Communication Device Class (aka CDC) - this is, among others, done via the appropriate class/subclass/protocol. The VID/PID don't care. This means the device should provide CDC/ACM USB descriptors to the enumerating USB host (windows) and implement the required endpoints and commands - supposedly there is already something existing for your board and you downloaded the firmware to it, right? You might want to try to connect such configured device to windows and after successful enumeration, new COM port should appear. If you program regular application, you just connect to such COM port via SerialPort class instance, no matter it is provided via USB subsystem... If this works, you should be able to start the AppStore part (where I have no clue how to help).
I'm just going to answer this as not currently possible. I ended up writing a desktop WPF application using metro UI/UX guidelines. Between that and ClickOnce deployment the store app feel is fairly well recreated, despite the store being ideal.
I sincerely hope that Microsoft decides to support this in the near future, the Metro SDK is really nice and I would love to eventually port it.

C# - Windows Mobile - Bluetooth Pairing

I've been given the task of building a Windows Mobile app for our company that quickly pairs a device by scanning it's bar code. I can discover the device, and talk to it, but I am stuck as far as pairing.
In C# / Windows Mobile 6, how do I pair a device? I don't really need to talk to the device within the app, I need to pair it so other applications can use it.
Is there an API I need to do this? I've seen things saying I need to register a pass key, etc? I can't seem to find any documentation on the actual pairing process, just connecting to it. (Just connecting to it, doesn't actually pair it.)
You can use my library 32feet.NET. Use method BluetoothSecurity.PairRequest See e.g. Bluetooth Security (That should work regardless of whether the device has Microsoft's own Bluetooth stack installed or the device has Widcomm/Broadcom or SSO Bluetopia).
The process of 'pairing' should also enable the services at the same time. If not we probably have other APIs for that too. Which services are used? SerialPort, others?

Using Bluetooth to RECEIVE file - From Mobile to PC

I took me several time and days to research and try some codes applicable to my problem but unfortunately I wasn't able to see codes that pair and receive files (text, images etc..NOT audio or video in particular) from a mobile device.
Most of the examples found are for SENDING only (From PC to Mobile).
I have bluetooth device (USB) physically attached to my PC.
Summary:
All I need is a sample code that automatically detect/pair when a device is trying to send the file (like in Kodak kiosk but not limited to images only).
I also wanted to understand and study the code.
Perhaps use my 32feet.NET library and its ObexListener class see e.g. http://32feet.codeplex.com/wikipage?title=Server-side&referringTitle=OBEX
For more advanced scenarios use Andy Hume's Brecham.Obex library and his server sample application. See http://inthehand.co.uk/files/folders/objectexchange/entry9942.aspx
Which Bluetooth stack does your PC have installed? Microsoft, Widcomm, BlueSoleil...? See e.g. http://32feet.codeplex.com/wikipage?title=Supported%20Hardware%20and%20Software On Widcomm for instance the build-in OBEX server would have to be disabled to allow your server to get all the incoming connections...

Categories