- return explode("\n", $data['body']);
- }
-
- /**
- * reconnect LTE
- *
- * @return array
- */
- public function reconnectLte () {
- $path = 'data/modules.json';
- $fields = array('csrf_token' => $this->token, 'lte_reconn' => '1');
- $fields = $this->encrypt($fields);
- $cookie = 'challengev='.$this->challenge.'; '.$this->session;
- $data = $this->sentRequest($path, $fields, $cookie, 2);
- $json = json_decode($data['body'], true);
-
- return $json;
- }
-
- /**
- * reset the router to Factory Default
- * not tested
- *
- * @return array
- */
- public function resetToFactoryDefault () {
- $path = 'data/resetAllSetting.json';
- $fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash, 'reset_all' => 'true');
- $cookie = 'challengev='.$this->challenge.'; '.$this->session;
- $data = $this->sentRequest($path, $fields, $cookie);
- $json = json_decode($data['body'], true);
-
- return $json;
- }
-
-
- /**
- * check if firmware is actual
- *
- * @return array
- */
- public function checkFirmware () {
- $path = 'data/checkfirmware.json';
- $fields = array('checkfirmware' => 'true');
- $cookie = 'challengev='.$this->challenge.'; '.$this->session;
- $data = $this->sentRequest($path, $fields, $cookie);
-
- if (empty($data['body'])) {
- throw new Exception('unable to get checkfirmware data');
+ $path = 'data/Reboot.json';
+ $fields = array('csrf_token' => $this->token, 'reboot_device' => 'true');
+ $data = $this->sentEncryptedRequest($path, $fields, true);
+ $data = $this->getValues($data['body']);
+
+ if ($data['status'] == 'ok') {
+ // reset challenge and session
+ $this->challenge = '';
+ $this->cookie = '';
+ $this->token = '';
+ $this->derivedk = '';
+
+ // throw an exception because router is unavailable for other tasks
+ // like $this->logout() or $this->checkLogin
+ throw new RebootException('Router Reboot');