Looking for a library/proxy to experiment with Bluetooth

I’d like to start experimenting with Bluetooth devices. Does anyone know of a good library or command-line tool that would help me do that? Preferably Linux, but for experimentations, any platform will do.

The first experiment I have in mind is using my computer as a proxy for a hands-free set:

  • the computer pretends to be a hands-free set and gets paired to a phone;
  • the computer also gets paired to a real hands-free set;
  • some script/code decides whether to forward requests from the phone to the real hands-free set, for instance based on the time of day.