How do I create a loop?

How to make application always receive a value when connecting to bluetooth.
Ex: always recieve the value S(stop) when connecting to a car