public void Login(string user, string pass) { if (psychic == null || telnet == null) { _status = "Error"; return; } try { psychic.Expect("login:"******"Password:"******"#"); // string appname = ""; switch (dev) { case CellDevice.LAGUNA: case CellDevice.LISBON: appname = "wlan_cu_ti1273_mcp33"; break; case CellDevice.LONDON: case CellDevice.LIVERPOOL: appname = "wlan_cu_ti1283_mcp33"; break; case CellDevice.NEVADA: FillQuery("ifconfig bcm0 up", @"if pidin | grep -s wpa_supplicant ; then slay wpa_supplicant; fi"); SendData(); FillQuery("out", "up", "mpc 0", "down", "country ALL", "band b", "up"); NSendData(); _status = "Logged"; return; //rest is for L-series default: throw new ArgumentException("Unsupported Device"); } psychic.SendLine(appname); psychic.Expect(appname); _status = "Logged"; } catch { _status = "Login Error"; } }
/// <summary> /// Function for opening a telnet session on the mobile device. /// </summary> /// <param name="user">An accepted username. Preferably root.</param> /// <param name="pass">Password for the username</param> public void Login(string user, string pass) { if (psychic == null || telnet == null) { _status = "Error"; return; } try { psychic.Expect("login:"******"Password:"******"#"); // string appname = ""; switch (dev) { case CellDevice.ti1273: appname = "wlan_cu_ti1273_mcp33"; break; case CellDevice.ti1283: appname = "wlan_cu_ti1283_mcp33"; break; case CellDevice.bcm: FillQuery("out", "up", "mpc 0", "down", "country ALL", "band b", "up"); NSendData(); _status = "Logged"; return; //rest is for ti12xx drivers case CellDevice.other: FillQuery("fw_pltenable::1", "change_cc::GB"); ESendData(); return; //rest is for ti12xx default: throw new ArgumentException("Unsupported Device"); } psychic.SendLine(appname); psychic.Expect(appname); _status = "Logged"; } catch { _status = "Login Error"; } }