Пример #1
0
        void __add_firmware_info(int firmware_type, String filename, InitPacketData init_packet_data, int sd_size=0, int bl_size=0)
        {
            /*TODO
            this.firmwares_data[firmware_type] = {
                FirmwareKeys.FIRMWARE_FILENAME: filename,
                FirmwareKeys.INIT_PACKET_DATA: init_packet_data.copy(),
                //# Copying init packet to avoid using the same for all firmware
            }
            */
            if (firmware_type == HexType.SD_BL)
            {
                this.firmwares_data[firmware_type][FirmwareKeys.SD_SIZE] = (object)sd_size;
                this.firmwares_data[firmware_type][FirmwareKeys.BL_SIZE] = (object)bl_size;
            }

            /*
            def __add_firmware_info(self, firmware_type, filename, init_packet_data, sd_size=None, bl_size=None):
                this.firmwares_data[firmware_type] = {
                FirmwareKeys.FIRMWARE_FILENAME: filename,
                FirmwareKeys.INIT_PACKET_DATA: init_packet_data.copy(),
                # Copying init packet to avoid using the same for all firmware
                }

            if firmware_type == HexType.SD_BL:
                this.firmwares_data[firmware_type][FirmwareKeys.SD_SIZE] = sd_size
                this.firmwares_data[firmware_type][FirmwareKeys.BL_SIZE] = bl_size
            */
        }
Пример #2
0
        public int sd_size; //BL + SD

        #endregion Fields

        #region Constructors

        /*
         * The firmware datamodel
         *
         * :param str bin_file: Firmware binary file
         * :param str dat_file: Firmware .dat file (init packet for Nordic DFU)
         * :param dict init_packet_data:  Initial packet data
         * :return:
         */
        public Firmware(String bin_file = null, String dat_file = null, InitPacketData init_packet_data = null)
        {
            this.dat_file = dat_file;
            this.bin_file = bin_file;

            //TODO if(init_packet_data != null)
            //TODO     this.init_packet_data = InitPacketData(**init_packet_data);
        }