Example #1
0
function request_access_level()
{
    global $dest;
    $command = shell_exec("command-group-function {$dest} 5 65287 1=0087 3=04");
    echo "Sending request to device {$dest} to report PGN 65287: {$command}\n";
    $analyzed = shell_exec("echo '{$command}' | analyzer 2>/dev/null");
    echo "Sending request to device {$dest} to report PGN 65287: {$analyzed}\n";
    $response = n2k_request_response($command, 'Request Access Level');
    echo "Response: " . print_r($response);
    show_command_response($response);
    if (array_key_exists(65287, $response) && is_array($response[65287])) {
        echo "Airmar data received\n";
        $response = $response['65287'];
        print_r($response);
    }
}
Example #2
0
function request_speed_calibration()
{
    global $dest;
    $command = shell_exec("request-group-function {$dest} 5 126208 1=0087 3=04 4=29");
    echo "Sending request to device {$dest} to report PGN 126208 PID 41: {$command}\n";
    $analyzed = shell_exec("echo '{$command}' | analyzer 2>/dev/null");
    echo "Sending request to device {$dest} to report PGN 126208 PID 41: {$analyzed}\n";
    $response = n2k_request_response($command, 'Request Speed Calibration');
    show_command_response($response);
    Sleep(2);
    $response = n2k_request_response(null, 'request-access-level');
    show_airmar_data($response);
}