{"id":19,"date":"2009-04-01T23:31:16","date_gmt":"2009-04-01T22:31:16","guid":{"rendered":"http:\/\/paguilar.org\/?p=19"},"modified":"2009-04-01T23:31:16","modified_gmt":"2009-04-01T22:31:16","slug":"writing-command-line-interfaces-for-embedded-devices","status":"publish","type":"post","link":"https:\/\/paguilar.org\/?p=19","title":{"rendered":"Writing Command Line Interfaces for Embedded Devices"},"content":{"rendered":"<p>Several times while developing applications for embedded devices I have had the need to test part or all of their functionality in an efficient and very quick way. A GUI is tedious and slow, but a Command Line Interface (CLI) can be perfectly suited for this task. <\/p>\n<p>I had these situations when I developed software for a modem\/router, a management system for an optical network and more recently for a HD digital receiver. In the latest case for example, I needed a fast way for scanning channels and zapping. Doing these operations using the GUI is slow because each time I had to go all along the menus and select the right parameters (in the case of a manual scanning) or moving along the channels list to a specific channel (in the  zapping case).<br \/>\nEven more, sometimes these applications need a Command Line Interface (CLI) available for the final user. This was the case of the management application for the optical network. It needed a Cisco-like shell in which only specific commands can be given to it and no access to the real shell (like bash or busybox) is allowed.<\/p>\n<p>I wrote some while ago a prototype project that tries to address these kind of situations. I noticed that a lot of time was spent in parsing and validating the input from the CLI and this only distracted me from the real purpose of the application. Thus, I decided that this software handled automatically all the parsing and validation, allowing me to concentrate in the real functionality of the system.<\/p>\n<p>I ended having a software in which I only had to specify in a configuration file the modes (eg. user or privileged), commands (eg. scan or zap) and arguments\/parameters (eg. channel frequency in the case of the zap command), and the source files in which I only get the input already parsed and validated and execute the desired function like scanning manually a given satellite.<\/p>\n<p><a href=\"https:\/\/paguilar.org\/?page_id=17\">This article<\/a> describes, hopefully, with a clear and in-depth approach, the design and implementation I followed for writing this project.<\/p>\n<p>The project is called <a href=\"http:\/\/sourceforge.net\/projects\/tarasca\">Tarasca Project<\/a>, it&#8217;s a bit out dated, but I will make a new release soon with some bug fixes and new tested platforms!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Several times while developing applications for embedded devices I have had the need to test part or all of their functionality in an efficient and very quick way. A GUI is tedious and slow, but a Command Line Interface (CLI) can be perfectly suited for this task. I had these situations when I developed software\u2026 <span class=\"read-more\"><a href=\"https:\/\/paguilar.org\/?p=19\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[20,29,38],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-command-line-interface","category-compiling","tag-command-line-interfaces","tag-prototyping","tag-testing"],"_links":{"self":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":0,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"wp:attachment":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}