Added auto peripheripheral detection.