Amit,
The way we have handled this in the past is to “touch” a file (named the same as the thread), when we receive an AR/AE response. We then have an alert that checks for a ‘file status change’ and execs the hci command to shutdown the thread when the ‘file status change’ is true.
Hope this helps.
Jim Cobane
PHNS, Inc.