diff --git a/src/flirpy/camera/boson.py b/src/flirpy/camera/boson.py index 7b0f7bf..5d1f2d9 100644 --- a/src/flirpy/camera/boson.py +++ b/src/flirpy/camera/boson.py @@ -993,6 +993,30 @@ def get_gain_mode(self): return res + def set_external_sync_mode(self, sync_mode): + """ + Set the external sync mode + + FLR_BOSON_EXT_SYNC_DISABLE_MODE = 0 + FLR_BOSON_EXT_SYNC_MASTER_MODE = 1 + FLR_BOSON_EXT_SYNC_SLAVE_MODE = 2 + FLR_BOSON_EXT_SYNC_END = 3 + """ + function_id = 0x50098 + command = struct.pack(">I", sync_mode) + self._send_packet(function_id, data=command) + + def get_external_sync_mode(self): + function_id = 0x50099 + + res = self._send_packet(function_id) + res = self._decode_packet(res, receive_size=4) + + if res is not None and len(res) == 4: + res = struct.unpack(">I", res)[0] + + return res + def _decode_packet(self, data, receive_size=0): """ Decodes a data packet from the camera. diff --git a/test/test_boson.py b/test/test_boson.py index 95d0661..7d2eb3d 100644 --- a/test/test_boson.py +++ b/test/test_boson.py @@ -111,3 +111,9 @@ def test_ffc_mode_auto(): camera.set_ffc_auto() mode = camera.get_ffc_mode() assert mode == flirpy.camera.boson.FLR_BOSON_AUTO_FFC + + +def test_get_external_sync_mode(): + with Boson() as camera: + ext_sync_mode = camera.get_external_sync_mode() + assert ext_sync_mode in [0, 1, 2, 3]