send_distance_command不具合修正2025/08/25 #33
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
不具合:
・非対応の逐次取得系コマンドを送信した後の、get_*関数の応答が0になる。
・MSコマンドのget関数の戻り値が-5(無応答)になっている。(wireShark上では正常応答が帰ってきている)
原因:
・逐次取得取得系コマンドの送信時に、構造体urgのis_sendingフラグをtrueにしない。
・取得系コマンドの応答が不正応答だった場合、ライブラリ内で、ignore_receive_data_with_qtというメソッドを呼んで、QTを送信した後にすべてのバッファを捨てる処理を行うが、is_sendingがtrueでないときはバッファを捨てない仕様になっていた。結果的に、そのあとGGコマンドの応答を見るときに、バッファの先頭にあるQTコマンドの応答を見ているので、戻り値が0になる。
・MSの応答が無応答になっていたのは、上記のずれが原因でHDとHEの無応答の結果をMSの応答の代わりに見ていたから。
・HEとHDが無応答なのは使用していた20LXのファームに問題がありそう。(3秒のタイムアウトを設けても応答がない)
対処:urgLibraryのsend_distance_command関数内でscan_times==1の時もis_sendingをtrueにする。