Thomas Fischl <fischl@fundf.net>
Tim Ansell <mithro@mithis.com>
Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
+ Wilfried Holzke <libftdi@holzke.net>
}
/**
+ Frees allocated memory in eeprom.
+
+ \param eeprom Pointer to ftdi_eeprom
+*/
+void ftdi_eeprom_free(struct ftdi_eeprom *eeprom)
+{
+ if (eeprom->manufacturer != 0) {
+ free(eeprom->manufacturer);
+ eeprom->manufacturer = 0;
+ }
+ if (eeprom->product != 0) {
+ free(eeprom->product);
+ eeprom->product = 0;
+ }
+ if (eeprom->serial != 0) {
+ free(eeprom->serial);
+ eeprom->serial = 0;
+ }
+}
+
+/**
Build binary output from ftdi_eeprom structure.
Output is suitable for ftdi_write_eeprom().
/* init and build eeprom from ftdi_eeprom structure */
void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom);
+ void ftdi_eeprom_free(struct ftdi_eeprom *eeprom);
int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
int ftdi_eeprom_decode(struct ftdi_eeprom *eeprom, unsigned char *output, int size);