added function : check network if disconnected then block until online
added logic: when power connected, judge is charging!