As the project works on the Jetson now, it is time to start with the documentation.
But we still need to change SourceJson so that it waits to get an exclusive file access to the json file instead of using a 1 msec delay in OnNewFileDetected.
WaitForFileCompletion is added just before calling OnNewFileDetected to make sure the transfer is complete.
JSON simulator
To test this use the JSON simulator at C:\Xenomatix5GAlert_JSON.
This will copy JSON files from C:\XAI\output_json to C:\XAI\output_json2. We need to configure the 5G Alert project to monitor C:\XAI\output_json2.
Set the delay between 2 consecutive files as third parameter of copy_files().
To test the correct working we remove the delay in SourceJSON::OnNewFileDetected and we have WaitForFileCompletion return true right away.
This results in JSON errors, as expected:

Now we test again with the restored WaitForFileCompletion.
Now we only see warnings when the file is still locked

.. so it is working correctly.
Finally we remove this warning as it is not very useful.