Add function to send MagicPacket
Refact rw_test to fix some bugs and enhance logic