Return-Path: From: Florian Echtler To: bmidgley@users.sourceforge.net, bluez-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1260567505-1115319494=:10038" Subject: [Bluez-devel] some btsco hacks Sender: bluez-devel-admin@lists.sourceforge.net Errors-To: bluez-devel-admin@lists.sourceforge.net Reply-To: bluez-devel@lists.sourceforge.net List-Unsubscribe: , List-Id: BlueZ development List-Post: List-Help: List-Subscribe: , List-Archive: Date: Thu, 5 May 2005 20:58:14 +0200 (CEST) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1260567505-1115319494=:10038 Content-Type: TEXT/PLAIN; charset=US-ASCII -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello everyone, I finally got time to investigate the issues with my headset. Sometimes after SCO connection establishment, the microphone produces only noise, and a reconnect is necessary to fix this. The attached patch is against btsco.c v1.22 from CVS, and does two things: 1. installs a handler for SIGUSR2 which automatically disconnects the SCO channel when connected and reconnects it after a short delay 2. allows the command string in .btscorc to contain '%d', which will be replaced with the current SCO connection status (0 or 1) upon command execution. 1. may be not really useful to most people - as mentioned, my headset is obviously somewhat buggy and needs a kind of reset sometimes, which this patch provides (actually, I wrote a shell script which samples 1 second of audio data from the headset, runs it through gzip to determine whether it's noise and sends SIGUSR2 accordingly - talk about evil hacks ;) 2. was included because I want certain actions to happen only when the connection is established, and not when it's shutting down. Brad: if you think this could be useful otherwise, then feel free to include the patch into CVS. Yours, Florian - -- Preserve wildlife - pickle a squirrel today! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCemzI7CzyshGvatgRArpWAJ4g4j5sgUjj3ulgVwxORICyjYdyHgCg5qpr gE4T1Cniprq057+KD2i79kE= =jha8 -----END PGP SIGNATURE----- --0-1260567505-1115319494=:10038 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=diff Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Dis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MSkpIHx8IChmb3JjZV9zY28gPT0gMCkpICYmIChzY29fbW9kZSA9PSBD T05ORUNURUQpKSB7DQotCQkJaWYodmVyYm9zZSkgew0KLQkJCQlwcmludGYo ImRyaXZlciBpcyBub3QgaW4gdXNlXG4iKTsNCi0JCQkJZmZsdXNoKHN0ZG91 dCk7DQotCQkJfQ0KLQkJCS8qIGNsb3NlIGJ0X3NjbyBhdWRpbyBoYW5kbGUg Ki8NCi0JCQlidF9zY29fc2V0X2ZkKGhhbmRsZSwgLTEpOw0KLQkJCS8qIGRp c2Nvbm5lY3QgU0NPIHN0cmVhbSAqLw0KLQkJCWNsb3NlKHNkKTsNCi0JCQlp Zih2ZXJib3NlKSB7DQotCQkJCXByaW50ZigiZGlzY29ubmVjdGVkIFNDTyBj aGFubmVsXG4iKTsNCi0JCQkJZmZsdXNoKHN0ZG91dCk7DQotCQkJfQ0KLQkJ CQ0KLQkJCXNjb19tb2RlID0gTk9UX0NPTk5FQ1RFRDsNCi0JCQkNCiAJCX0N CiAJCQ0KIAkJaWYgKHJpbmcpIHsNCg== --0-1260567505-1115319494=:10038-- ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel