fix detect order bug

open all the port first to let the port ready for receiving

Change-Id: I01536e754981e02362dcc5590bceecda021a1788
update port name more clean

Change-Id: I6e6570e1939c43db0447c350680aa5c47f0157ed
fix result overflow

Change-Id: I7712c23d6eceb23c295e3e99efdf38fe3ee85b34

Conflicts:

	diag_lib/dg_loop/src/dg_loop_api.c