Windows Mobile 6 intermittent connection status NOPATHTODESTINATION - windows

On a Windows Mobile 6 device we are trying to open an internet connection. This usually works but sometimes we get a return code of 0x80004005 with a status of CONNMGR_STATUS_NOPATHTODESTINATION. When this happens it will keep happening but if you launch IE on the device, it will connect and then our call to ConnMgrEstablishConnectionSync works. We have not been able to isolate what causes this to happen, it currently appears to be random (though I suspect it isn't). Any hints?
Our code looks basically like this:
CONNMGR_CONNECTIONINFO connInfo;
DWORD dwStatus = 0;
memset(&connInfo, 0, sizeof(connInfo));
connInfo.cbSize = sizeof(connInfo);
connInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;
connInfo.dwFlags = CONNMGR_FLAG_NO_ERROR_MSGS;
connInfo.dwPriority = CONNMGR_PRIORITY_HIPRIBKGND;
connInfo.guidDestNet = IID_DestNetInternet; /* Connect to the "Internet" network */
hr = ConnMgrEstablishConnectionSync(&connInfo, &s_hConnection, 120 * 1000, &dwStatus);

Windows Mobile connection manager is a huge PITA. Do you get the same error if you specify the network address by IP (e.g. "255.255.255.255/whatever") instead of by server name?
My guess is you could reproduce the lack-of-connection on demand with one of these methods:
Clearing the history in IE on the WM device
Closing IE from the running programs screen (in other words, really removing it from memory)
Soft resetting the device

Related

Reasons for rare sendto()/recvfrom() issues under Winsock?

We recently observe rare UDP communication issues that show the following symptoms:
A socket sendto() call fails with error WSAENOBUFS (10055)
A subsequent recvfrom() call on this socket does not receive anything, even though Wireshark shows that the network interface actually received the expected datagrams. This situation persists for approximately 8 seconds, afterwards new incoming datagrams can be received again from the socket.
In Windows System Log, there appears a Kernel-General information entry at the time of the sendto() error:
The access history in hive \??\C:\ProgramData\Microsoft\Provisioning\Microsoft-Desktop-Provisioning-Sequence.dat was cleared updating 0 keys and creating 0 modified pages.
The issue happens on a customer system running Microsoft Windows 10 Pro for Workstations, Version 10.0.17763 Build 17763.
On that system we were able to reproduce the issue with a simple test program written in C++ that echoes UDP datagrams. We verified that the thread receiving from the socket was actually responsive all the time, by specifying a timeout of 1 second using SO_RCVTIMEO, printing some “still alive” output and immediately calling recvfrom() again.
On our own test system, we were unable to observe the issue under the same circumstances as the customer. However, we were able to provoke similar effects when playing around with the network adapter settings while the test was running. Enabling Microsoft LLDP Protocol Driver showed the sendto() error and sometimes also resulted in the 8 second “silence” period, but without any Windows System Log entry.
Any hints are greatly appreciated.
The issue seems to be related to Microsoft Provisioning Tool since Windows 10 1809.
Disabling it fixed the issue in our case:
Open Task Scheduler, go to Microsoft/Windows/Manangement/Provisioning and disable Logon task.
Source: Windows TenForums

How Can I Establish A L2Capp Interrupt Channel Connection?

Im trying to open a L2Cap HID Channel And Interrupt channel so I can send HID commands to a bluetooth device.
I've done all my service advertising and device paring and established a baseband connection.
The Hid Control channel opens fine.
When I try to create my kBluetoothL2CAPPSMHIDInterrupt connection
l2capChannelQueueSpaceAvailable
delegate method called (not sure what this means) followed by
l2capChannelOpenComplete
but the connection closes immediately calling
l2capChannelClosed
How can I correctly open these connection?
I've spent a long time digging through the IOBlueTooth framework and the bluetooth.org HID spec but theres barely any helpful information (that I can find at least).
When i trace out my L2Cap channels I see some null values for
mIncomingDataListener
and
mEventDataListener
. I dont know how to set these or if they have anything to do with my problem.... just speculating.
The code snippet below is my attempt so far to make the connections after a connection to the device has been established.
-(void)establishL2CappConnections:(IOBluetoothDevice*)device
{
IOReturn r;
IOBluetoothL2CAPChannel *ch1;
r = [device openL2CAPChannelSync:&ch1
withPSM:(BluetoothL2CAPPSM)kBluetoothL2CAPPSMHIDControl
delegate:self];
self.mL2CappChannel=ch1;
NSLog(#"r == %i",r);
IOBluetoothL2CAPChannel *ch2;
r = [device openL2CAPChannelSync:&ch2
withPSM:(BluetoothL2CAPPSM)kBluetoothL2CAPPSMHIDInterrupt
delegate:self];
self.mL2CappInterruptChannel=ch2;
NSLog(#"r == %i",r);
}
Edit:1
I've attached my packet logs. It's strange, a request for
kBluetoothL2CAPPSMSDP 0x0001
gets made without me requesting it and then everything starts disconnecting.
BT Packet Logs
As per your logs its very clear that your device in in Limited Connection mode, its stays Active for 30sec or less. change device settings to make it General Discoverable.
kBluetoothL2CAPPSMSDP 0x0001
means Bit 13 - Limited Discoverable Mode
Playing with the Bluetooth settings will solve your problem

Unable to Open SCOAudio connection with phone

I am trying to use IOBluetooth framework on OS X 10.8.2 to connect with the bluetooth enabled phones emulating computer as a hands free device. I can successfully make a connection with the phone and phone can recognise the connection as a HandsFree connected to the phone.
But when I try to make a call with the phone and want to send the audio to the mac (by selecting the source as handsfree), the audio never reaches the computer.
As at this point the bluetooth framework tries to open a SCO Audio connection with the device, but the connection establishment is never successful and I get the error code 0x0D status code in scoConnectionOpened status.
I am using IOBluetoothAddSCOAudioDevice function to attach the SCO Audio device with bluetooth device and it is always successful.
//btDevice is paired
res=IOBluetoothAddSCOAudioDevice((IOBluetoothDeviceRef) btDevice,NULL);
if(res != kIOReturnSuccess)
{
self.error.title = [NSString stringWithFormat:
#"Could not attach the Audio device. Try paring device again"];
}
The console log says
24/11/2012 4:02:13.000 PM kernel[0]: [SendHCIRequestFormatted] ###
ERROR: [0x0428] (Setup Synchronous Connection) -- Send request failed
(err = 0x000D (kBluetoothHCIErrorHostRejectedLimitedResources))
24/11/2012 4:02:13.000 PM kernel[0]: REQUIRE_NO_ERR failure: 0xd -
file:
/SourceCache/IOBluetoothFamily_kexts/IOBluetoothFamily-4090.4.33/Core/Family/Drivers/IOBluetoothSCOAudioDriver/IOBluetoothSCOAudioDevice.cpp:872
Although console log says limited resources but I have tried it with multiple phones having their batteries full.
I am stumped on this and just thinking if I need to do any thing special or different?
Thanks in advance for much appreciated help.
This error ("Connection Rejected due to Limited resource") typically happens when a T2 request is sent to a T1-only SCO listener. If you read the patch notes to version 5 you can get a discussion about this problem linux-bluetooth v5 patch notes

libusb Windows using WinUSB BulkTransfer receiving inconsistant

I am attempting to communicate with a custom USB device through windows using libusbx. I have the WinUSB driver installed for the device and am able to get some communication to happen. It's just not operating as I expect.
I am trying to get some basic two way communication happening essentially from the PC I send a single byte and expect some number of bytes back. Currently if I reset the device and run my program that sends a byte, I only receive a single byte back. If I re-run my program, I get just the next byte back. This happens a few more times until eventually I receive what I expect.
For example:
PC sends an 'a'
the expected output is
buffer[0]=3c
buffer[1]=6c
buffer[2]=0
buffer[3]=3e
What I actually get is:
//First try
buffer[0]=3c
//Second Try
buffer[0]=6c
//Third Try
buffer[0]=0
buffer[1]=3e
//Fourth+ tries
buffer[0]=3c
buffer[1]=6c
buffer[2]=0
buffer[3]=3e
When I test the USB device over a com port using serial communication, everything operates as expected.
Here is a pastebin of the code being ran:
http://pastebin.com/bQtyS6vq
Has anyone experienced similar problems or have any suggestions for a fix?

Testing connectivity issues in Windows Phone 7 (using the emulator)

Is there a way in the Windows Phone 7 emulator to turn off the network connection (without yanking the cable and turning wi-fi off on my laptop)? I want to test the dropping of network connectivity without having a physical device or doing anything physical outside the emulator or the Windows Phone 7 SDK/Tools.
As an alternative to physically disabling the network connection I also, sometimes, find it useful to redirect the network connections through Fiddler2. It's then possible to use breakpoints to intercept some connections. You can then use this add a delay before the server can respond. Or you can force a timeout.
I find this a useful approach when you want to test some connections failing but not others.
No, not really. I find it useful to check network connectivity and assign the result to a boolean value so that I can then modify the result to test scenarios where there's no network connection.
Сreate a firewall rule for the application C:\Program Files\Microsoft XDE\1.0\XDE.exe and then enable/disable this rule.
You can do this using a custom rule in Fiddler.
Rules -> Customize Rules...
Find the code which adds the "Simulate &Modem Speeds" menu option, and add your new option
//Add a menu option under Rules -> Performance
public static RulesOption("Simulate Flight Mode", "Per&formance")
var bFlightMode: boolean = false;
Now, at the top of the OnBeforeRequest function, add the following code
// Cause Fiddler to respond to all requests with a 502 (Bad Gateway) - the same error you get when you remove all networks
if (bFlightMode){
oSession.oRequest.pipeClient.End();
oSession.utilCreateResponseAndBypassServer();
oSession.oResponse.headers.HTTPResponseCode = 502;
oSession.oResponse.headers.HTTPResponseStatus = "Fiddler Simulating Flight Mode";
oSession.state = SessionStates.Aborted;
return;
}
Now, under the 'Performance' menu, you can select 'Flight Mode' - or whatever you want to call it.
(Based on an #EricLaw Google Groups post)

Resources