2014-06-13 11:53:51 +01:00
|
|
|
Naming a module {#naming}
|
|
|
|
===============
|
|
|
|
|
2015-03-04 11:22:56 -08:00
|
|
|
UPM attempts to follow a clear naming pattern. Modules should be sensibly named
|
2014-11-04 23:41:46 +00:00
|
|
|
and then placed in ${libdir}/upm and headers in ${includedir}/upm, all modules
|
|
|
|
should be prefixed with libupm-<modulename>. The upm_module_init will
|
|
|
|
automatically name python UPM modules as pyupm_<modulename> and javascript
|
|
|
|
modules as jsupm_<modulename>. For example for src/grove/ the library built
|
|
|
|
will be libupm-grove.so, the python module pyupm_grove and the js module
|
|
|
|
jsupm_grove.
|
2014-06-13 11:53:51 +01:00
|
|
|
|
2014-11-04 23:41:46 +00:00
|
|
|
### Choosing a name for a new module
|
2014-06-13 11:53:51 +01:00
|
|
|
|
2014-11-04 23:41:46 +00:00
|
|
|
1. Pick a name, typically the chip name is the most sensible
|
|
|
|
2. Use it & stick to it
|
2014-06-13 11:53:51 +01:00
|
|
|
|
|
|
|
### Rules for name picking
|
|
|
|
|
2014-11-04 23:41:46 +00:00
|
|
|
1. Your lib must belong to the UPM namespace
|
|
|
|
2. Usually picking the name of the chip of your sensor/actuator makes sense.
|
|
|
|
Other times this does not. Try to pick a generic name so people with a similar
|
|
|
|
sensor can inherit your class if they only have minor changes.
|
|
|
|
3. Avoid brand names, often your module can be very generic with little effort
|
2015-03-17 13:39:01 -07:00
|
|
|
4. Use only lowercase characters in your file names and folder names.
|
2014-06-13 11:53:51 +01:00
|
|
|
|
|
|
|
### Doubt
|
|
|
|
|
2015-03-04 11:22:56 -08:00
|
|
|
If ever, give either of us a ping via email:
|
2015-10-16 15:42:34 -07:00
|
|
|
mihai.tudor.panu@intel.com or brendan.le.foll@intel.com
|
2015-03-04 11:22:56 -08:00
|
|
|
and we'll try suggest decent names for your module.
|