Hi, first of all thanks for creating and maintaining this library. This was really helpful to find as we need to use TWN4 players in a project we are doing.
While investigating why BeepAsync had no effect on my TWN4 MultiTech reader (Simple Protocol firmware), I compared the PERIPH wrappers with the Simple Protocol specification (DocRev25/26) and found some mismatches:
The library sends API code 0x02 for all periphery functions, but the specification defines API PERIPH as 0x04 (commands 0400–0417).
The function numbers don't match the documented map either. For example BeepAsync sends function 12, but per the spec Beep is [0407][Volume][Frequency][OnTime][OffTime] (function 12 is actually SendWiegand). Same for the GPIO methods (spec: 0402 = GPIOSetBits, 0403 = GPIOClearBits, etc.).
Some methods (PlaySound*, PlayMelodyAsync, SetSerialModeAsync, SerialRead/WriteAsync) don't seem to exist in the Simple Protocol specification at all.
With a firmware built from the stock "TWN4_xCx520_PRS104_Multi_CDC_Simple_Protocol.bix" these commands return an error or do nothing. Changing the Beep frame to 0407... makes the buzzer work as expected.
Is the PERIPH implementation perhaps based on a different/custom firmware? If not, I'm happy to open a PR aligning it with the spec.
Thanks again for your work!
Hi, first of all thanks for creating and maintaining this library. This was really helpful to find as we need to use TWN4 players in a project we are doing.
While investigating why BeepAsync had no effect on my TWN4 MultiTech reader (Simple Protocol firmware), I compared the PERIPH wrappers with the Simple Protocol specification (DocRev25/26) and found some mismatches:
The library sends API code 0x02 for all periphery functions, but the specification defines API PERIPH as 0x04 (commands 0400–0417).
The function numbers don't match the documented map either. For example BeepAsync sends function 12, but per the spec Beep is [0407][Volume][Frequency][OnTime][OffTime] (function 12 is actually SendWiegand). Same for the GPIO methods (spec: 0402 = GPIOSetBits, 0403 = GPIOClearBits, etc.).
Some methods (PlaySound*, PlayMelodyAsync, SetSerialModeAsync, SerialRead/WriteAsync) don't seem to exist in the Simple Protocol specification at all.
With a firmware built from the stock "TWN4_xCx520_PRS104_Multi_CDC_Simple_Protocol.bix" these commands return an error or do nothing. Changing the Beep frame to 0407... makes the buzzer work as expected.
Is the PERIPH implementation perhaps based on a different/custom firmware? If not, I'm happy to open a PR aligning it with the spec.
Thanks again for your work!