fix for back-to-back issue
This commit is contained in:
+26
-16
@@ -14,7 +14,12 @@ $mc = Meshcore::getInstance();
|
||||
|
||||
$x = $mc->appStart("get remote tele");
|
||||
|
||||
$repeaters = ['Simpsonville 3810gvr1', 'Simpsonville im37r1'];
|
||||
|
||||
$contacts = $mc->getContacts();
|
||||
|
||||
echo "Found " . count($contacts) . " contacts\n";
|
||||
/*
|
||||
$idx = 1;
|
||||
foreach($contacts as $contact) {
|
||||
echo "(" . $idx++ . ") {$contact['contact_name']} [" . substr($contact['pub_key'], 0, 6) . "]\n";
|
||||
@@ -22,25 +27,30 @@ foreach($contacts as $contact) {
|
||||
|
||||
$choice = readline("\nPlease select contact to attempt remote login: ");
|
||||
$contact = $contacts[$choice - 1];
|
||||
*/
|
||||
|
||||
echo "Using {$contact['contact_name']}\n";
|
||||
foreach($contacts as $contact) {
|
||||
if( !in_array($contact['contact_name'], $repeaters) ) continue;
|
||||
|
||||
/*
|
||||
if( !$mc->connected($contact['pub_key']) ) {
|
||||
$password = readline("Password: ");
|
||||
echo "Using {$contact['contact_name']}\n";
|
||||
|
||||
$mc->login($contact['pub_key'], $password);
|
||||
$req = base64_decode($contact['pub_key']) . chr(CoreProtocol::BINREQ_TELEMETRY);
|
||||
|
||||
$result = $mc->sendBinaryRequest($req);
|
||||
|
||||
if( !isset($result->tag) ) {
|
||||
var_dump($result);
|
||||
echo "sendBinaryRequest sent nothing??\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
echo "Tag: {$result->tag}\n";
|
||||
|
||||
$msg = $mc->pollForMessage($result->tag);
|
||||
|
||||
echo json_encode($msg->lpp) . "\n";
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
*/
|
||||
|
||||
$req = base64_decode($contact['pub_key']) . chr(CoreProtocol::BINREQ_TELEMETRY);
|
||||
|
||||
$result = $mc->sendBinaryRequest($req);
|
||||
|
||||
echo "Tag: {$result->tag}\n";
|
||||
|
||||
$msg = $mc->pollForMessage($result->tag);
|
||||
|
||||
print_r($msg);
|
||||
|
||||
echo "Complete\n";
|
||||
|
||||
Reference in New Issue
Block a user