slave_loop(): Add function send_command() to clean the code.