Refresh fuction and if bluetooth socket connect switch detect