diff --git a/tef.py b/tef.py index 8167d04..75128b0 100644 --- a/tef.py +++ b/tef.py @@ -37,20 +37,50 @@ class TEF6686(BaseTEF668X): @_command_wrapper def AM_Set_Bandwidth(self, bandwidth: int = 40): return b"\x21\x0a\x01\x00\x00" + bandwidth.to_bytes(2, "big"), None, None - # todo: Set_RFAGC + @_command_wrapper + def FM_Set_RFAGC(self, start: int = 920, extension: bool = False): + return b"\x20\x0b\x01" + start.to_bytes(2, "big") + extension.to_bytes(2, "big"), None, None + @_command_wrapper + def AM_Set_RFAGC(self, start: int = 1000): + return b"\x21\x0b\x01" + start.to_bytes(2, "big"), None, None @_command_wrapper def AM_Set_Antenna(self, attenuation: int = 0): return b"\x21\x0c\x01" + attenuation.to_bytes(2, "big"), None, None @_command_wrapper + def AM_Set_CoChannelDet(self, mode: bool = True, restart: int = 2, sensitivity: int = 1000, count: int = 3): + return b"\x21\x0e\x01" + mode.to_bytes(2, "big") + restart.to_bytes(2, "big") + sensitivity.to_bytes(2, "big") + count.to_bytes(2, "big"), None, None + @_command_wrapper def FM_Set_MphSuppression(self, mode: bool = False): return b"\x20\x14\x01" + mode.to_bytes(2, "big"), None, None @_command_wrapper def FM_Set_ChannelEqualizer(self, mode: bool = False): return b"\x20\x16\x01" + mode.to_bytes(2, "big"), None, None @_command_wrapper + def FM_Set_NoiseBlanker(self, mode: bool = True, sensitivity: int = 1000): + return b"\x20\x17\x01" + mode.to_bytes(2, "big") + sensitivity.to_bytes(2, "big"), None, None + @_command_wrapper + def AM_Set_NoiseBlanker(self, mode: bool = True, sensitivity: int = 1000): + return b"\x21\x17\x01" + mode.to_bytes(2, "big") + sensitivity.to_bytes(2, "big"), None, None + @_command_wrapper + def AM_Set_NoiseBlanker_Audio(self, mode: bool = True, sensitivity: int = 1000): + return b"\x21\x18\x01" + mode.to_bytes(2, "big") + sensitivity.to_bytes(2, "big"), None, None + @_command_wrapper def FM_Set_Deemphasis(self, timeconstant: int = 500): return b"\x20\x1f\x01" + timeconstant.to_bytes(2, "big"), None, None @_command_wrapper + def FM_Set_LevelStep(self, step1: int = -20, step2: int = -30, step3: int = -40, step4: int = -50, step5: int = -60, step6: int = -60, step7: int = -60): + return b"\x20\x26\x01" + step1.to_bytes(2, "big", signed=True) + step2.to_bytes(2, "big", signed=True) \ + + step3.to_bytes(2, "big", signed=True) + step4.to_bytes(2, "big", signed=True) + step5.to_bytes(2, "big", signed=True) + \ + step6.to_bytes(2, "big", signed=True) + step7.to_bytes(2, "big", signed=True), None, None + @_command_wrapper + def AM_Set_LevelStep(self, step1: int = -10, step2: int = -20, step3: int = -30, step4: int = -40, step5: int = -50, step6: int = -60, step7: int = -60): + return b"\x21\x26\x01" + step1.to_bytes(2, "big", signed=True) + step2.to_bytes(2, "big", signed=True) \ + + step3.to_bytes(2, "big", signed=True) + step4.to_bytes(2, "big", signed=True) + step5.to_bytes(2, "big", signed=True) + \ + step6.to_bytes(2, "big", signed=True) + step7.to_bytes(2, "big", signed=True), None, None + @_command_wrapper + def FM_Set_LevelOffset(self, offset: int = 0): + return b"\x20\x27\x01" + offset.to_bytes(2, "big", signed=True), None, None + @_command_wrapper def AM_Set_LevelOffset(self, offset: int = 0): return b"\x21\x27\x01" + offset.to_bytes(2, "big", signed=True), None, None @_command_wrapper