- my $rec = $irspy->record($conn);
- $irspy->log("irspy_test", $conn->option("host"), " connected");
- ### At this point we should note the successful connection in $rec
- return 0;
+sub maybe_connected {
+ my($conn, $task, $__UNUSED_udata, $event, $ok) = @_;
+
+ $conn->log("irspy_test", ($ok ? "" : "not "), "connected");
+ my $rec = $conn->record();
+ $rec->append_entry("irspy:status", "<irspy:probe ok='$ok'>" .
+ isodate(time()) . "</irspy:probe>");
+ return $ok ? ZOOM::IRSpy::Status::TEST_GOOD :
+ ZOOM::IRSpy::Status::TEST_BAD;