The problem is that there is a lot of other characters which get sent through from the device and these need to be filtered out.
Another challenge is that we need to prevent duplication of numbers. The same number should not be read twice within a specific time period (say 5 minutes).
I am currently experimenting with an app called Twedge by TEC-IT.
It has the ability to filter the data using javascript.
The current code I am using is as follows:
Expand|Select|Wrap|Line Numbers
- // This script is executed whenever a data packet is received.
- // Use it to send the received data to other applications, to store it in a database
- // or in a file. The actual data is accessed via the variable DATA.
- // In order to learn more about programming JavaScript please refer to any JavaScript
- // documentation.
- // This is the TWedge default behaviour:
- // All data received via the current connection is converted into keystrokes.
- // 0-characters (NUL) are replaced with spaces.
- SendKeyStrokes (DATA.replace (/[^0-9]/g, ""));
- SendKeyStrokes (",");
- SendKeyStrokes ("{ENTER}");