문제

I am looking forward to build a prototype, which should be running completely headless and without user interaction, system should be able to start a barcode reader, send it over the internet to a php as file.php?code=var ...

Which is the simplest way to do this?

I am thinking off:

  • windows-console app, some sort of ping...
  • linux-console app, some sort of wget or stuff like that

Does anyone have a better approach.

System should be completely autonomous, plug it in, scan barcode, send code, repeat...

도움이 되었습니까?

해결책

Your job can be divided into three main tasks:

  1. Get the Bar-Code value (not just a nice picture of it)
  2. Transfer the Code-Value to a remote PHP-Application
  3. process the data on the target. Out of scope.

There are lot of different possible ways to achieve this. But keep always in mind, that you don't have to re-invent the wheel:

  1. Bar-Code readers usually behave like an ordinary keyboard. A scanned code will be treated as an ordinary user input from the keyboard. A good Bar-code Reader can be configured to finalize its input with an enter-key (\r).
  2. As already mentioned: Use the programming language you have good in command or you're curious about. You mentioned that the target system will be a PHP-Script, so the transfer console application could also be realized with PHP .

    do while(true) { 
    // wait for bar-code reader input
      $code = readline();
    
    // transfer code to 
      transfer($code);
    }
    

See PHP-Manual Readline-functiond for more details.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top