<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Porting libraries using wiring features.</title>
		<link>http://forums.leaflabs.com/topic.php?id=1367</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:08:29 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1367" rel="self" type="application/rss+xml" />

		<item>
			<title>feurig on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8390</link>
			<pubDate>Sat, 25 Feb 2012 17:07:00 +0000</pubDate>
			<dc:creator>feurig</dc:creator>
			<guid isPermaLink="false">8390@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Fair enough.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8376</link>
			<pubDate>Fri, 24 Feb 2012 19:45:13 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">8376@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;feurig&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;You should hang in the #wiring channel for a bit.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Why? &#60;/p&#62;
&#60;p&#62;I have no issues with active collaborators using channels.&#60;br /&#62;
Typically, when I am not an active collaborator to a project, but instead I am a user, then I prefer a project which has tactics and strategies which scale well, and are convenient for my time frame. Documentation, forums and wiki's can scale. Channels don't seem to. Documentation, forums and wiki's are asynchronous, which suites me very well.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>feurig on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8375</link>
			<pubDate>Fri, 24 Feb 2012 18:44:54 +0000</pubDate>
			<dc:creator>feurig</dc:creator>
			<guid isPermaLink="false">8375@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I think having arduino separate from wiring allows wiring to focus on a quality product. I think having them join teams would be a disaster in terms of over all quality in the code. &#60;/p&#62;
&#60;p&#62;I just would like to see the maple get a little further into the present.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>feurig on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8374</link>
			<pubDate>Fri, 24 Feb 2012 18:32:16 +0000</pubDate>
			<dc:creator>feurig</dc:creator>
			<guid isPermaLink="false">8374@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;You should hang in the #wiring channel for a bit.&#60;/p&#62;
&#60;p&#62;And as to the quality it is not a like like thing, again look at the bootloaders (Half of the bootloaders on my clients mega2560s have a fairly nasty known bug that is well over a year old, they die if you enable the wdt (until you reflash the entire chip)) Compare the code (which looks and acts like a hack) to that in wiring current.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8373</link>
			<pubDate>Fri, 24 Feb 2012 16:58:53 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">8373@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;feurig - I've been using Arduino for several years. I think I am still a 'god member' over there, and haven't posted since 2010. So I do think I understand the value of Arduino technology, community, and what it has achieved.&#60;/p&#62;
&#60;p&#62;Compatibility is valuable.&#60;/p&#62;
&#60;p&#62;IMHO, people who care about the technology underpinning a community should not silently accept something purely for the sake of compatibility. That mindset would have been a hurdle to electric street lights, national power grids, the transistor, PAL television, 3-pin power plugs, horses for ploughing, UNIX, C, Haskell, Erlang, Python, the steam engine, Java, Ruby, Golang, AVR, ARM, the Internet, the Dollar, the Gregorian calendar, the Euro, digital TV, steel, digital radio, etc (an extremely long list, not all of equal importance :-)&#60;/p&#62;
&#60;p&#62;I think something which seems complicated needs to be challenged. How will people within a community recognise that there is such a thing as 'taste', or that people should care about 'taste', or that there are technical tradeoffs to be balanced?  (I am involved in education, and I hear stories from employers who are very concerned at the ability and judgement of school children, undergraduates and post graduates. IMHO, trying to examine components is helpful to improve our critical faculties)&#60;/p&#62;
&#60;p&#62;IMHO discussion should not brushed aside for the sake of compatibility. I worry; how could a single individual feel empowered to contribute if their contribution might break compatibility?&#60;/p&#62;
&#60;p&#62;I think my view that Wiring's quality needs deeper analysis on the basis that it includes a complicated, monolithic String class is a reasonable and defensible observation. I agree, there is very little value in diverging for the sake of it.&#60;/p&#62;
&#60;p&#62;I think I can deal with my concerns using an ad hoc approach. If it were a very important issue, to many people, I think we could gather some stats on actual uses of String, to get a handle on whether diverging on that class would be a big issue. I genuinely don't know if it would be an issue. Most people discourage the use of managed memory, so it may be irrelevant. I suspect that there are a bunch of okay alternatives.&#60;/p&#62;
&#60;p&#62;I am not sure that comparing the discipline of the Wiring team with the Arduino community is a 'like for like' comparison. What is 'discipline'? Delivering on time to promise? Not delivering anything until code is high-quality? Delivering small incremental improvements regularly and frequently with no quality regressions? Not taking anything out once it has been delivered? Not including stuff which is complicated? Only including new stuff which has an understood need?&#60;/p&#62;
&#60;p&#62;I feel that an assessment of discipline also needs to consider the pressures involved. In my experience, it is easier to deliver software where demands are modest, versus in a high-pressure situation. If the quantity of forum activity is one measure of the pressure on a team, then the Arduino's forum has more people on line much of the day, and more topics and posts in a day than the Wiring forum has registered members, or posts in its published history.&#60;/p&#62;
&#60;p&#62;I am not suggesting that the Wiring team are not effective, only that the Arduino team has a lot of pressure to deal with.&#60;/p&#62;
&#60;p&#62;AFAIK, the Arduino team has not responded to the Wiring team on the questions of merging code bases &#60;a href=&#34;http://forum.wiring.co/index.php/topic,37.msg267.html&#34; rel=&#34;nofollow&#34;&#62;http://forum.wiring.co/index.php/topic,37.msg267.html&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>feurig on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8368</link>
			<pubDate>Fri, 24 Feb 2012 15:01:22 +0000</pubDate>
			<dc:creator>feurig</dc:creator>
			<guid isPermaLink="false">8368@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Rod,&#60;/p&#62;
&#60;p&#62;I need to get a little time to look at the code it will be nice if I ever get back to resource starved micros. For of my work avr-libc and newlib's implimentations work well enough. The C++ &#34;clunky at best&#34; io is pretty much what kept me from learning it 18 years ago. It still sucks (more so in this environment). I wish the wiring/arduino folk had abandoned it but they didn't. So we are stuck working on compatibility.&#60;/p&#62;
&#60;p&#62;gbulmer,&#60;br /&#62;
Most of us would probably take a different approach than the Arduino Community but it has an established code base supporting an amazing amount of peripherals. Because of this code base an amazing amount of prototyping can be done very quickly as long as the libraries are compatible. (Here watch while I pull a wireless data-logger out of my hat). When the maple deviates or gets significantly out of sync with the Wiring/Arduino libraries we loose a lot. IMHO The wiring team is definitely the more disciplined of the two (zb look at the bootloaders) and subsequently they tend to lead the way. I hope that the merger of the two code bases moves more quickly so that I don't wind up porting and then reporting later :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>siy on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8306</link>
			<pubDate>Wed, 22 Feb 2012 00:50:52 +0000</pubDate>
			<dc:creator>siy</dc:creator>
			<guid isPermaLink="false">8306@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@Rod, that would be great, I always preferred printf over C++ish overloading of shift operator. Perhaps your code might be a good candidate for the algorithms category of library repo discussed in other thread.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rod on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8303</link>
			<pubDate>Tue, 21 Feb 2012 20:40:16 +0000</pubDate>
			<dc:creator>Rod</dc:creator>
			<guid isPermaLink="false">8303@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I can donate a 200 line printf that does &#34;udxXcs%'  plus field widths in sprintf and printf mode and runs on the Maple Mini STM32 as a starting point if anyone would like.&#60;/p&#62;
&#60;p&#62;Its basically stripped down to do everything in 32 bit ints for simplicity. Started from tiny printf by  Kustaa Nyholm &#60;a href=&#34;http://www.sparetimelabs.com/tinyprintf/index.html&#34; rel=&#34;nofollow&#34;&#62;http://www.sparetimelabs.com/tinyprintf/index.html&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8300</link>
			<pubDate>Tue, 21 Feb 2012 18:31:13 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">8300@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;feurig - I'd assumed you'd done planning and analysis, but I thought it might be helpful to give some detail of my thinking.&#60;/p&#62;
&#60;p&#62;I hope that that Wiring's String class is dropped.&#60;br /&#62;
I do &#60;strong&#62;&#60;em&#62;not&#60;/em&#62;&#60;/strong&#62; like types inheriting from printable.&#60;br /&#62;
It's fine for  types to have a mechanism to convert themselves to strings (of some form). I prefer types having a standard way to yield a C-string value (or a very simple string), like Java toString(), and handing that to whatever output functions exist.&#60;/p&#62;
&#60;p&#62;LeafLabs have announced that they are working towards Wiring compatibility.&#60;br /&#62;
I now feel I need to look harder at the Wiring library. That String class causes me to feel less confident that Wiring is a good target. If String is the only weakness, then I'll be delighted.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>feurig on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8297</link>
			<pubDate>Tue, 21 Feb 2012 15:05:20 +0000</pubDate>
			<dc:creator>feurig</dc:creator>
			<guid isPermaLink="false">8297@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks for looking at this. You pretty much came to the same conclusions I did in relation to the String usage in WireFree. &#60;/p&#62;
&#60;p&#62;If I were to replace the string I would ditch the c++ style printing altogether. It is just dumb. I would rather create a printing function that snprintf's into a static buffer and sends it.&#60;/p&#62;
&#60;p&#62; &#60;code&#62;gs.printf(&#38;quot;%s %s&#38;quot;,cmd_tbl[cmd].cmd_str),this-&#38;gt;security_key);&#60;/code&#62; &#60;/p&#62;
&#60;p&#62;String from arduino 1.0 does work without too much trouble. String from wiring had a few more dependencies so I didn't push too far in that direction. I will try the casting and then we should be good. &#60;/p&#62;
&#60;p&#62;The serial handling in gs.cpp is clearly an &#34;I need it now&#34; hack and should be replaced with a macro or a pointer.&#60;/p&#62;
&#60;p&#62;But the greater and greater disparity between the arduino 18 libraries and the current Wiring platform begged the question a bit. &#60;/p&#62;
&#60;p&#62;It had occurred to me where the hardware isn't the issue (like with the new print/stream/string changes in wiring) that It would be an interesting effort to merge most of the wiring libraries with libmaple so that there are less porting issues in general.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8289</link>
			<pubDate>Mon, 20 Feb 2012 18:50:36 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">8289@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;feurig - I must admit, I tend to be conservative, and avoid complexity. &#60;/p&#62;
&#60;p&#62;I am not super keen on that String implementation for this application. It isn't C++ &#60;code&#62;string&#60;/code&#62; or &#60;code&#62;basic_string&#60;/code&#62;, and seems much more sophisticated and complex than necessary. I am not keen on deriving from 'printable' class in a simple environment which lacks a robust file abstraction, and its use in many places in that code seems to be purely to get something printable. I'd try to avoid that.&#60;/p&#62;
&#60;p&#62;WARNING - IIRC, malloc/realloc might not be set up properly on Maple, but I'd need to go check.&#60;/p&#62;
&#60;p&#62;Scanning the Wirefree code, it will be work to remove String. So, if String does work, it may be best left in place in order to make progress.&#60;/p&#62;
&#60;p&#62;Looking at WireFree's source (*.cpp), there are 35 uses of 'String'.&#60;br /&#62;
1 is a comment&#60;br /&#62;
4 are printable messages containing the word String.&#60;br /&#62;
13 are definitions of functions which take a String as an argument.&#60;/p&#62;
&#60;p&#62;Of the remainder a lot of the uses of String are just to make something printable (8+). &#60;/p&#62;
&#60;p&#62;In some places it concatenate several strings so that println can be called once, which would be unnecessary if String returned a &#60;code&#62;const&#60;/code&#62; pointer to its buffer (like C++ string c_str).&#60;/p&#62;
&#60;p&#62;So all the machinery of that String implementation is being used to create a String, concatenate a value, print it, then destroy the String, and garbage collect the free'd space when it goes out of scope, just to avoid saying, e.g.&#60;br /&#62;
&#60;code&#62;Serial1.println(cmd_tbl[cmd].cmd_str); Serial1.println(this-&#38;gt;security_key);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;A lot of the other uses of String are equivalent to &#60;code&#62;strncmp()&#60;/code&#62;. Others are concatenating a character onto the buffer.&#60;br /&#62;
So an adequate replacement for String might be very light-weight.&#60;/p&#62;
&#60;p&#62;I'm not a big fan of converting things like 16bit IP port numbers into strings, IP addresses into strings, etc. I tend to try to encapsulate the semantics into a class (e.g. a URL might be a string or an IP address) rather than squish stuff into a type (like a String) which can later be used to reconstitute the semantics. But that is probably not worth any effort.&#60;/p&#62;
&#60;p&#62;Possible approach:&#60;br /&#62;
Test String, and if it works, try to get Wirefree working with String.&#60;/p&#62;
&#60;p&#62;Then add a (const char *) cast to String, so that String isn't needed just to print an array of char, and then ditch that print code.&#60;/p&#62;
&#60;p&#62;Maybe build a wrapper which would unify Serial1 &#38;amp; Serial, so that the most of Wirefree doesn't care which MCU it is being compiled for.&#60;/p&#62;
&#60;p&#62;If I could find the time and energy, I might replace that big, smart String, and build a small, light-weight string that is free-standing, and independent of the ability to print, but that seems like a lot of work for little benefit.&#60;/p&#62;
&#60;p&#62;Just a comment: the only links found by Search on the Wiring site for WString are to bugs in a &#60;strong&#62;destructor&#60;/strong&#62; which took about three weeks to fix. I downloaded the code, and can't find any unit tests for String, which saddens me. &#60;/p&#62;
&#60;p&#62;Summary:&#60;br /&#62;
Test that String works. If it does, then get Wirefree working using it.&#60;/p&#62;
&#60;p&#62;If you folks have the energy, consider unifying the output class (Serial &#38;amp; Serial1) so that Wirefree doesn't conditionally compile for two different boards. That appears to be a real improvement. Once that is done, replace the uses of String where its only behaviour is to print text.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>feurig on "Porting libraries using wiring features."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1367#post-8287</link>
			<pubDate>Mon, 20 Feb 2012 15:30:39 +0000</pubDate>
			<dc:creator>feurig</dc:creator>
			<guid isPermaLink="false">8287@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ok so dumb question moving forward.&#60;br /&#62;
If we are porting a library that uses stoffregons WString classes which is already in wiring do we make it work by hacking the print library to support it or do we wedge it and wait?&#60;/p&#62;
&#60;p&#62;I am trying to port the WireFree library for the gainspan wifi modules.&#60;br /&#62;
&#60;a href=&#34;https://github.com/diysandbox/Wirefree&#34; rel=&#34;nofollow&#34;&#62;https://github.com/diysandbox/Wirefree&#60;/a&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
