#!/bin/bash

function ts() { date +"%H:%M:%S %N" | awk '{printf("%s.%03d\n",$1,$2/10^6);}'; }

(while true; do 
	echo "----- hciconfig $(ts) -----"
	hciconfig
	echo " - - - - - - - - - -"
	afb-client-demo -d unix:/run/user/$UID/apis/ws/Bluetooth-Manager power true
	echo "---------------------"
	sleep 0.2
done) | sed "s/^/XXXXX /"


