On Sun, 3 Jun 2012, Phil Dibowitz wrote: > +int CRemoteZ_USBNET::ReadFlash(uint32_t addr, const uint32_t len, uint8_t > *rd, > + unsigned int protocol, bool verify, lc_callback cb, > + void *cb_arg, uint32_t cb_stage) > +{ > + uint32_t tmp; > + return ReadRegion(addr, tmp, rd, cb, cb_arg, cb_stage); > +} > > > Why do you have this abstraction? Isn't ReadRegion() just ReadFlash?
I believe that I added the layer of abstraction because, in the GetIdentity case (below), I need to get the length of the region back from the call. The ReadFlash API doesn't support passing the length back because for the non-zwave remotes, the length is already known. In the ReadFlash case (where we're actually dumping a config), we don't need the length because we already know it so we can throw it away - the 'tmp' variable above. > @@ -684,7 +775,16 @@ int CRemoteZ_Base::GetIdentity(TRemoteIn > > make_serial(pl.p[0], ri); > > - ri.config_bytes_used = 0; > + if (IsUSBNet()) { > + // Get the User Config Region to find the config bytes used. > + if (err = ReadRegion(REGION_USER_CONFIG, ri.config_bytes_used, > + NULL, NULL, NULL, 0)) { > + return err; > + } > + } > + else { > + ri.config_bytes_used = 0; > + } > > > Nice :) > > This all looks good and I'm happy to merge it. Thanks for adding the specs > while you're at it. I'm just curious why you made ReadFlash just a call to > ReadRegion? The above case is where I needed to get the region length back. Scott ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ concordance-devel mailing list concordance-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/concordance-devel