If a connection is lost, you will need to tell the ELM327 to ‘close’ the current connection, with a Protocol Close command (AT PC). This will ensure that the ELM327 starts from the beginning when the next request is made. This is particularly important for the ISO 9141 and ISO 14230 protocols, as they need to send a special initiation sequence.
Thanks for the API.
It might be a good idea to add the AT PC command.