add some flags to enable/disable each function

rewrite this commit information.
pass port and IP address parameters to program.
add -i serial port information.
change function name
move some definition macro to header