I am getting unexpected behavior when using the latest version of the antfs.c sample code. I think this is a separate issue from what I reported here
When the ANT-FS download is interrupted momentarily during a download, I expect it to recover from the point where it left off. However, it throws up a "Download Rejected" error that stops the download.
I'm using the ANT_s212_nrf52810_nrf52832_6.1.1 soft device (I said the version number incorrectly in the video). I'm using the nRF5_SDK_16.0.0_98a08e2 SDK.
This video shows how the bug manifests itself. This can be replicated using the ant-fs client sample code on an nRF52832 Dev Kit and running the ANT-FS PC hosts to download the data. I induce an interruption in the download by holding my finger over the antenna on the dev kit momentarily.
The bug appears to be in this section of the code in antfs.c
else { // This is a request to resume a partially completed transfer. if (m_saved_crc_offset > m_link_burst_index.data) { // We can not check the received CRC seed as the requested offset is before // our last save point. // Set CRC checking as invalid. m_saved_crc_offset = ANTFS_MAX_FILE_SIZE;//This line seems to be incorrect } else { m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_VERIFY_CRC; } }
The line that I commented as seeming to be incorrect is the one that forces the "Download Rejected" error to show up in the ANT-FS PC host via the following code in antfs.c on the client.
if (m_saved_crc_offset == ANTFS_MAX_FILE_SIZE) { // CRC checking was set as invalid. An invalid download was requested, so reject it. response = RESPONSE_INVALID_OPERATION; } } if ((response != 0) || (m_file_size.data == 0)) { // Send the response right away if the download request was rejected or there is no data to // send. download_request_response_transmit(response); } else
If I comment out the line that I marked as incorrect, then the download starts over when the ANT-FS signal is momentarily interrupted. This is better than stopping the download with an error, but not as good as continuing where it left off.
I have not been able to determine what the correct code should to get the download to continue from where it left off.