public static void EnableFlightMode() { Tapi tapi = new Tapi(); tapi.Initialize(); Line thisLine = GetCellLine(tapi); if (thisLine == null) return; CellTSP.lineSetEquipmentState(thisLine.hLine, (int)LINEEQUIPSTATE.MINIMUM); thisLine.Dispose(); tapi.Shutdown(); }
public static void DisableFlightMode() { Tapi tapi = new Tapi(); tapi.Initialize(); Line thisLine = GetCellLine(tapi); if (thisLine == null) return; CellTSP.lineSetEquipmentState(thisLine.hLine, (int)LINEEQUIPSTATE.FULL); CellTSP.lineRegister(thisLine.hLine, (int)LINEREGMODE.AUTOMATIC, "", 0); thisLine.Dispose(); tapi.Shutdown(); }
//# __________ PROTOCOL :: INTERNET CONNECTION TESTING __________ #// public static bool IsDeviceInFlightMode() { int result = 0; LINERADIOSUPPORT cellstate = LINERADIOSUPPORT.UNKNOWN; Tapi tapi = new Tapi(); tapi.Initialize(); Line thisLine = GetCellLine(tapi); if (thisLine == null) return false; if (CellTSP.lineGetEquipmentState(thisLine.hLine, out result, out cellstate) != 0) MessageBox.Show("Tapi failed."); thisLine.Dispose(); tapi.Shutdown(); return result == (int)LINEEQUIPSTATE.MINIMUM; }