Index: leahi_dialin/fp/modules/fp_test_configs.py =================================================================== diff -u -r5c7add17cecb0528db91b9c805c95f9372dc341b -rbc2a677d7121d6a4ed4513d3c103552838dc8056 --- leahi_dialin/fp/modules/fp_test_configs.py (.../fp_test_configs.py) (revision 5c7add17cecb0528db91b9c805c95f9372dc341b) +++ leahi_dialin/fp/modules/fp_test_configs.py (.../fp_test_configs.py) (revision bc2a677d7121d6a4ed4513d3c103552838dc8056) @@ -16,6 +16,8 @@ from logging import Logger +from leahi_dialin.common.constants import NO_RESET +from leahi_dialin.common.global_vars import GlobalVariables from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.common.test_config_defs import DDFPTestConfigOptions from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels @@ -60,6 +62,27 @@ return self.fp_test_configs[DDFPTestConfigOptions(config).name] + @publish(['msg_id_fp_send_test_config', 'fp_test_configs', 'fp_test_configs_response_timestamp']) + def _handler_fp_test_config_sync(self, message, timestamp=0.0): + """ + Handles published test configuration status messages. + + @param message: published FP test configurations message + @return: None + """ + payload = message['message'] + index = MsgFieldPositions.START_POS_FIELD_1 + + for config in DDFPTestConfigOptions.__members__: + config_value, index = bytearray_to_integer(payload, index, False) + if 'NUM_OF_TEST_CONFIGS' not in config: + self.fp_test_configs[config] = config_value + if DDFPTestConfigOptions.TEST_CONFIG_ENABLE_BETA_1_9_HW.name in config: + GlobalVariables().HW_BETA_1_9 = config_value == 1 + + self.fp_test_configs_response_timestamp = timestamp + + def cmd_set_test_config(self, config: int, reset: int = NO_RESET): """ Constructs and sends the FP test config @@ -146,24 +169,6 @@ self.logger.debug("Timeout!!!!") return False - @publish(['msg_id_fp_send_test_config', 'fp_test_configs', 'fp_test_configs_response_timestamp']) - def _handler_fp_test_config_sync(self, message, timestamp=0.0): - """ - Handles published test configuration status messages. - - @param message: published FP test configurations message - @return: None - """ - payload = message['message'] - index = MsgFieldPositions.START_POS_FIELD_1 - - for config in DDFPTestConfigOptions.__members__: - if 'NUM_OF_TEST_CONFIGS' not in config: - config_value, index = bytearray_to_integer(payload, index, False) - self.fp_test_configs[config] = config_value - - self.fp_test_configs_response_timestamp = timestamp - def _reset_test_configs_record(self): """ Resets the test configuration dictionary @@ -173,4 +178,4 @@ for config in DDFPTestConfigOptions.__members__: # Loop through the list of the test configuration and set the values to 0xFFFFFFFF if 'NUM_OF_TEST_CONFIGS' not in config: - self.fp_test_configs[config] = 0xFFFFFFFF \ No newline at end of file + self.fp_test_configs[config] = 0xFFFFFFFF