You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have been writing my own code (in swift) to interact with a fingerbot from an iPhone. Thanks very much to the developers here for this code, it has been a very helpful reference for my development.
While working on my handler for responses, I noticed what may be a couple of errors in _handle_command_or_response() in tuya_ble.py. The following code, starting at line 1130 handles DP responses which also have a time and or flag combined with the DPs.
Firstly, when a response has a flag field, a 16bit sequence number is extracted first. An acknowledgment packet is then created, with both the extracted sequence number and flags, however the code below writes the sequence number into the acknowledgment as 8 bits, not 16bits, which does not seem correct. This anomaly is present for both the FUN_RECEIVE_SIGN_DP and FUN_RECEIVE_SIGN_TIME_DP cases.
Secondly, once the sequence number and flag fields have been extracted, the DP extraction should begin from the next byte. However in the FUN_RECEIVE_SIGN_DP case, the DP extraction begins at byte 2 (which ought to be the flag byte), but logically it should begin at byte 3.
I have not seen any of these responses from my device, so I cannot check the correct behavior, but thought I should raise it here
Hi, I have been writing my own code (in swift) to interact with a fingerbot from an iPhone. Thanks very much to the developers here for this code, it has been a very helpful reference for my development.
While working on my handler for responses, I noticed what may be a couple of errors in
_handle_command_or_response()
intuya_ble.py
. The following code, starting at line 1130 handles DP responses which also have a time and or flag combined with the DPs.Firstly, when a response has a flag field, a 16bit sequence number is extracted first. An acknowledgment packet is then created, with both the extracted sequence number and flags, however the code below writes the sequence number into the acknowledgment as 8 bits, not 16bits, which does not seem correct. This anomaly is present for both the
FUN_RECEIVE_SIGN_DP
andFUN_RECEIVE_SIGN_TIME_DP
cases.Secondly, once the sequence number and flag fields have been extracted, the DP extraction should begin from the next byte. However in the
FUN_RECEIVE_SIGN_DP
case, the DP extraction begins at byte 2 (which ought to be the flag byte), but logically it should begin at byte 3.I have not seen any of these responses from my device, so I cannot check the correct behavior, but thought I should raise it here
Finally, one question: What type of devices give these responses and under what circumstances ? What is the purpose of the flags and timestamps ?
The text was updated successfully, but these errors were encountered: