implemented state machine from scan to send inquirty packet