> On 02/20/2014 10:59 PM, Robin Gilks wrote: >> Greetings all >> >> I've just started to migrate from the public domain Dallas tools (that >> go >> way back to the DOS days as well as Linux) to OWFS and I'm a bit >> confused >> about the C API interface. >> >> I take it that the buffer in OW_put for example is an ASCII string but >> does it have to be null terminated and if so is the terminator included >> in >> the length? If the terminator is not included in the buffer length then >> I >> assume that it doesn't need one!! >> >> Cheers >> [corrected top posting...] > It uses the same value that would be returned by strlen(), which excludes > the null termination. >
Does the buffer need to be long enough for the terminating null? i.e. can just a few characters be poked into the char array such that the OW software put its own terminator onto the end of a copy of the buffer before parsing it for example. This brings up a lot more questions actually: * what about leading spaces * is a leading '-' honoured * is a leading zero taken to mean octal input * is '0x' prefix interpreted as hex * is '$' prefix interpreted as hex (Motorola standard!) I think the expression 'bag of worms' might apply here!! This question originally came about due to problems talking to a load of DS2413 devices. I've just done some more tests which have left me even more concerned :( Running on my main PC (Gentoo stable box with a few unstable packages!!) with version 2.7p21, everything works fine. On the later version 2.8p13 on my openwrt router, the DS2413 outputs just don't work in a repeatable fashion. Is there a known regression in this version? All the reading from temperature sensors and voltage readings from a bunch of battery monitors are OK and the hardware works fine with my old Dallas public domain derived software. One thing I note with the s/w running on the router, when I turn up the debug level I don't get to see what data is being passed to PIO.A or PIO.B - is this correct, does the debug have useful information like this missing or am I driving the debug incorrectly.. I'm off to try loading 2.7p21 onto the router, if I can get it to cross compile OK... Cheers -- Robin Gilks ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk _______________________________________________ Owfs-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/owfs-developers
