add deviceCallback functionality and related hook.
changes