Wireless Communication Library Support Forum
Frameworks => Bluetooth Framework => Topic started by: rameshwar on August 18, 2012, 08:47:09 PM
-
Why is sometimes, though very rare, IsInRange causing System.NullReferenceException?
Application: MyApp.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception.
Exception Info:
System.NullReferenceException Stack:
at <Module>.wcl.wcl_int.CwclSDPParser.Parse(wcl.wcl_int.CwclSDPParser*, Byte*, UInt32)
at <Module>.wcl.wcl_int.CwclSDPParser.{ctor}(wcl.wcl_int.CwclSDPParser*, Byte*, UInt32)
at <Module>.wcl.wcl_int.CwclBluetoothDevice.EnumServicesMicrosoft(wcl.wcl_int.CwclBluetoothDevice*, wcl.wcl_int.CwclBluetoothServices*, _GUID*)
at <Module>.wcl.wcl_int.CwclBluetoothDevice.EnumServices(wcl.wcl_int.CwclBluetoothDevice*,
wcl.wcl_int.CwclBluetoothRadio*, wcl.wcl_int.CwclBluetoothServices*, _GUID*)
at <Module>.wcl.wcl_int.CwclBluetoothDevice.IsInRange(wcl.wcl_int.CwclBluetoothDevice*, wcl.wcl_int.CwclBluetoothRadio*, Boolean*)
at wcl.wclBluetoothDevice.IsInRange(wcl.wclBluetoothRadio, Boolean ByRef)
at MyApp.Server.DiscoveryService.wclBluetoothDiscovery_OnDiscoveryComplete(System.Object, wcl.wclBluetoothDiscoveryCompleteEventArgs)
-
Hello,
Looks like a bug in SDP parser. We will check that out and fix.
-
Hello,
Can you please try BluetoothDiscovery demo application and its Enum services button: I helps to check were bug is. It works or does not.
-
I tried BluetoothDiscovery demo application and its Enum services button. It works.
I am not sure, I'll investigate more and then report to you, it seems to me that the exception occurs when two applications are using WCL at the same time. In our program one app is for configuration and the other is the main app. I guess, when both access WCL at the same time then the exception occurs. I'm not sure, I'll investigate and report to you. Thank you.
-
I should have attached this image in my previous post. Thank you.
[attachment deleted by admin]
-
Hello,
Thank you for so detailed information. I will recheck it once again and try to reproduce the issue. WCL should work even used from few apps at the same time so, as I told before, it looks as our bug in WCL and we will do all our best to fix it as soon as possible.
-
Hello,
I have rechecked the IsInRange code (and SDP Parser code as well). Unfortunately I couldn't reproduce the issue with debices we have but that doesn't mean that there is no bug. So I'll continue working on this matter and hopefully can find where problem is.
-
I have had this once or twice, too.
-
We are working on this issue but still can't reproduce it.
-
I can, but the pc is not within our LAN. Do you maybe want to build me some version that collects the info you need?
-
Will do today and send to you. Thank you.
-
Creating a Ghost image of the current state, take your time.
-
Do you still want me to test it or can I get rid of the image?
-
Hi,
Have you tryed latest 6.11.4? Is problem still there?
-
Hi,
Finally issue has been reproduced and fixed. If you need fixed version send us a request as it is not published yet.
-
Sounds great! We have been developing an app that uses WCL for almost last one year and this was the only reason that forced me to write our own small library of utility functions using Windows API, which is working fine for our requirements. However, we are yet to release our commercial product and if this issue has been fixed then we shall definitely be using WCL as we can do more with it when needed and as of now we have not found any other bug in WCL. Thank you for this great news. How can we obtain the fixed version? Thank you. Rameshwar
-
Hello,
If you are registered user you can download latest version from registered users area. If you use WCL demo download the latest demo from our site.
-
Hello
Have you removed the Demo warning dialog from Demo version?
My previous experience was that Demo Version does not work with Windows Service applications due to Demo Warning Dialog, this is because Windows Service is not meant for interactive desktop.
I was fortunate enough to have received the full version from you for evaluation and then this Exception started occurring. I am not a registered user as yet.
Thank you
Rameshwar
-
Hello,
No, we did not and I do not think we ever do. However, you can check that the bug is fixed (or not) if simple run BluetoothDiscovery demo application from WCL package.
-
Thank you for your reply.
I have created many testing scenarios and come to the conclusion that I cannot test for exception caused in our product by WCL simply by running BluetoothDiscovery demo.
Accordingly, since no demo is available, I have decided to move on.
Also, if we decide to buy and the exception still exists then shall we get the refund?
Thank you
Rameshwar
-
Hello,
In fact we can not guaratee that Bluetooth part of WCL will work in service application as there are some things out of our control. For example, WidComm and Toshiba have limitations for using it from Windows Service. Also as WCL has unlimited trial period usualy we do not do refunds.
-
Based on your assurance that the exception has been fixed we purchased Lite license in the name Saucepan Productions as "License Comparison Tool" list for Lite includes the features we wanted to use including pairing. The accompanying documents too contained these classes. However, when I use it build the solution I get following errors -
(1) For the following classes the error is -
The type or namespace name ... does not exist in the namespace 'wcl'
'wclAuthenticator'
'wclPairedEventHandler'
'wclAuthenticationRequestEventHandler'
'wclPINRequestEventHandler'
'wclPINRequestEventArgs'
'wclAuthenticationRequestEventArgs'
'wclPairedEventArgs'
'wclClientTransport'
(2) The other error is -
'wcl.wclBluetoothRadio' does not contain a constructor that takes 1 arguments
I have downloaded version 6 12 0 0
Thank you
Rameshwar
-
Hello,
Thank you for your purchase. Unfortunately wclAuthenticator (as described in License Comparison Table, SilentAuth) is available in Personal License. However, manual pairing (wclBluetoothDevice.Pair) is available in Lite License.
wclClientTransport is depricated since 6.11.4.0 (www.btframework.com/news.htm#a28022013) and in latest WCL you have to use wclTransport.
Events in WCL authenticator have been changed since 6.11.3.0 (www.btframework.com/news.htm#a22022013).
Copy constructors have been removed. You should use Assign method instead (as it was in always in WCL).
-
From the downloaded licensed version when I run the BluetoothDiscoveryDemo I get the following errors -
The type or namespace name ... does not exist in the namespace 'wcl' - for the following
'wclPINRequestEventArgs'
'wclNumericComparisonEventArgs'
Thank you
Rameshwar
-
Looks like something went wrong when building setup it demo from old version appears in this installation. Please find attached correct demo. Also we will upload fixed installtion in few minutes.
[attachment deleted by admin]
-
In the new library I am not getting NullReferenceException but it now has another problem. At the point where I was getting exception the call now returns "not in range" even though the discovered device is only some inches away. I am surmising that the Null Reference Exception was happening probably because Radio was going away and now "not in range" is occurring because of the the same i.e. because of Radio going away. Is my assumption correct? If my assumption is correct then in this case have you released handle to the hardware in your code in such a situation?
Thank you
Rameshwar
-
IsInRange uses service enumeration to detect that device is in range. If your device reuiqres pairing to enumerate service and not paired, if your device is not in connectable mode, if your device busy and can't reurn its services IsInRange returns False (device is not in range).