I'm looking for a prog/script/package that will find a client, not an AP when within range?

I would like it to also return an error code so I can trigger a script in response.

I've done the list progs on BT route, but that only names the packages installed, not their function.

Any help would be appreciated.

Thanks