meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
peerhood:solution [2009/03/26 13:47]
hevi created
peerhood:solution [2010/03/22 11:20]
julaakko
Line 24: Line 24:
   - Fixed in Maemo with listener, could be solved by creating a listener for WLAN state in Linux.   - Fixed in Maemo with listener, could be solved by creating a listener for WLAN state in Linux.
   - Increased the tolerance to 10, defined in the WLANPlugin.cc. Plugin stops when amount of errors is reached, when there are same amount of successful writes the counter for errorous writes is zeroed. This is just a temporary solution, the plugin doesn'​t crash when e.g changing network (tolerance can be increased, it should be defined in config..).   - Increased the tolerance to 10, defined in the WLANPlugin.cc. Plugin stops when amount of errors is reached, when there are same amount of successful writes the counter for errorous writes is zeroed. This is just a temporary solution, the plugin doesn'​t crash when e.g changing network (tolerance can be increased, it should be defined in config..).
 +
 +
 +===== Genral bugs in code =====
 +
 +=== HasData() -function ===
 +<del>
 +The function reaches end of non-void function in error situations although it should return a ''​boolean''​-value.</​del> ​
 +
 +FIXED - [[wiki:​user:​julaakko]]
 +
 +===== Slight problems with Bluetooth ====
 +
 +==== Problem description ==== 
 +
 +Briefly: after PeerHood daemon (alone, no services or applications using the daemon) has been running for ~7 hours or more it either crashes (segfault or in latest tests assertion error in ''​CBTConnection''​ line 40) or starts reporting -1 responses from surrounding bluetooth devices and also errors reported by ''​BTPlugin::​Inquirythread''​ : <​code>​Too many open files</​code>​ and
 +<​code>​Device or resource busy</​code>​
 +First could be result from ''​hci_inquiry''​ -function functionality,​ second could be from thread safety issue in BlueZ bluetooth library. For further information,​ see: [[peerhood:​peerhood_bluetooth_feature_and_testing|a possible feature found in Bluetooth library/​hardware functionality - incl. testing]].
 +
 +==== Problem solution ====
 +
 +Copied the inquiry-function from hci.h and modified it not to open new socket on every inquiry. Currently PeerHood uses a raw socket to bluetooth device to control it via ioctl commands, currently only inquiry and adapter reset are using this. New socket is created when the bluetooth plugin is loaded. This reduces the errors mentioned in the problem description,​ there still exists some faulty socket/​handle usages which at some point can cause "Too many open files" error. ​