Concurrent device access causes interference between programs
Created by: Lekensteyn
When I tried to run scan-registers.sh
while solar was running, it tagges wrong messages as a response to another (solar periodically reads the battery register 07).
Part of the solution:
- Use the following hints to match responses and requests:
- the device index, type and register.
- in case type=ERROR_MSG (8F), compare the device index and the Sub ID plus register of the error message to the request.
- Let messages be asynchronous (in a dedicated I/O thread?), on submission it will be queued. A queue item could have the attributes time of submission (for expirity), a callback function and the actual message.