upm/Documentation/moduleNaming.html

2 lines
4.4 KiB
HTML
Raw Normal View History

<!doctype html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><link href="https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700|Roboto:100,300,400,500,700,900" rel="stylesheet"><link rel="shortcut icon" type="image/png" href="/assets/images/favicon.png"/><link rel="stylesheet" href="/assets/css/style.css"><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/dracula.min.css"> <script src="/assets/js/library/jquery-2.2.4.min.js"></script> <script src="/assets/js/library/handlebars.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script> <script type="text/javascript">hljs.initHighlightingOnLoad();</script> <script type="text/javascript"> $(function(){ var current = location.pathname; $('.nav li a').each(function(){ var $this = $(this); /* if the current path is like this link, make it active */ if($this.attr('href').indexOf(current) !== -1){ $this.addClass('active'); } }) }); </script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-17890616-13', 'auto'); ga('send', 'pageview'); </script><body><header><nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><div class="container"><div class="row"><div class="col-xs-12 col-sm-5"> <a class="navbar-logo pull-left" href="/"> <img src="/assets/images/logo.png" class="logo-img"> </a><div class="navbar-header pull-right" style="display: inline-block;"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button></div></div><div class="col-sm-7 col-xs-12 menu-inner"><div id="navbar" class="navbar-collapse collapse"><ul class="nav navbar-nav navbar-right nav-list"><li> <a href="/findSensor.html"><span class="icon find-sensor" ></span> <span class="">Find</span></a><li> <a href="/addSensor.html"><span class="icon add-sensor" ></span> <span class="">Join</span></a><li> <a href="/Documentation/docindex.html"><span class="icon documentation" ></span> <span class="">Documentation</span></a><li> <a href="https://github.com/intel-iot-devkit/upm" target="_blank"><span class="icon github github-mobile"></span> <span class="github-desktop">Github</span></a></ul></div></div></div></div></nav></header><main><div class="main-container inner-pages"><div class="container"><div class="row"><div class="col-sm-8 col-xs-12 "><div class="page-heading"> Naming your module</div></div></div></div><div class="section-wrapper installingMraa"><div class="container"><div class="row "><div class=" col-sm-12"><div class="description"> UPM attempts to follow a clear naming pattern. Modules should be sensibly named and then placed in ${libdir}/upm and headers in ${includedir}/upm, all modules should be prefixed with libupm-. The upm_module_init will automatically name python UPM modules as pyupm_ and javascript modules as jsupm_. For example for src/grove/ the library built will be libupm-grove.so, the python module pyupm_grove and the js module jsupm_grove.</div><div class="title">Choosing a name for a new module</div><div class="description"> Pick a name and stick with it. Usually, the chip name makes the most sense. If not, try to pick a generic name so people with a similar sensor can inherit your class if they only have minor changes.<div>• All modules should be prefixed with libupm-.</div><div>• Avoid brand names.</div><div>• Your lib must belong to the UPM namespace.</div></div><div class="title">Questions?</div><div class="descript