@echo off
setlocal EnableExtensions EnableDelayedExpansion
cd /d "%~dp0.."
title JPLuz - Teste Gateway OCR v64
powershell -NoProfile -ExecutionPolicy Bypass -Command "$cfg=Get-Content -Raw '.\config.json'|ConvertFrom-Json; $t=$cfg.camera_gateway.video_token; if(-not $t){$t=$cfg.camera_gateway.token}; try {$r=Invoke-RestMethod ('http://127.0.0.1:'+($cfg.camera_gateway.port)+ '/api/plate/status?token='+[uri]::EscapeDataString($t)) -TimeoutSec 8; Write-Host 'GATEWAY OCR OK' -ForegroundColor Green; $r|ConvertTo-Json -Depth 5} catch {Write-Host ('GATEWAY OCR FALHOU: '+$_.Exception.Message) -ForegroundColor Red}"
pause
