rfcomm (part of net-wireless/bluez-utils) should flush stdout when a new (incoming and/or outgoing) connection has been made. With this patch, scripts can use rfcomm to connect via bluetooth and fork() the process in order to start using the connection (ie. by running pppd over it).
Created attachment 20256 [details, diff] Patch for the bluez-utils-2.3.ebuild ebuild to use my bluez-utils-2.3-rfcomm.patch patch Patch for the bluez-utils-2.3.ebuild ebuild to use my bluez-utils-2.3-rfcomm.patch patch - will be attached after this one.
Created attachment 20257 [details, diff] Patches rfcomm to flush stdout Patches rfcomm to flush stdout when a connection is made. This can be tested like this: rfcomm connect /dev/rfcomm0 00:11:22:33:44:55 2 | cat Without my patch, you will see the output when the connection is closed and rfcomm quits. With my patch, the output 'Connected /dev/rfcomm0 to 00:11:22:33:44:55 on channel 2' will be shown immediately upon connection, allowing other scripts to react on the connection.
PS: This is a complete, tested solution. At least on my box ;-)
sounds like a pretty harmless patch, i'll consider it for -r1. in the meantime, have you posted this patch to the bluez developers?
i've added this to bluez-utils-2.3-r1. i didn't version bump it because it probably doesn't affect many users to force them to re-emerge.
Sounds reasonable! Thanx for adding it to Gentoo - it's my first piece of code that was added to something Open Source that is so well known ;-)