Compare commits
541 Commits
v0.7.1
...
json-testi
Author | SHA1 | Date | |
---|---|---|---|
c66bcc656a | |||
d52c2df7c6 | |||
02d8a16d4b | |||
4bb652cb4b | |||
59dfed087e | |||
e7f4529711 | |||
9e09f899cf | |||
ae77966204 | |||
b0a842229a | |||
0f3f0e02ae | |||
287d716401 | |||
db89d872b4 | |||
c46fb64cac | |||
1f97840fee | |||
7bee29ba62 | |||
24b6cbcc85 | |||
ab4eeea61e | |||
98811b0fb7 | |||
f92c0c120e | |||
01036f7dae | |||
5e7a8b41a3 | |||
f59f3131bb | |||
539fbe7c75 | |||
5a1f27a92d | |||
f4da94a06e | |||
e190bb9d60 | |||
bac9e3bbc0 | |||
1647d8bc08 | |||
6bfb07e46a | |||
c25fa47e2f | |||
7cd290901d | |||
aaf733f41b | |||
ac4a10e248 | |||
8a4e06d856 | |||
9482d6bb74 | |||
0cb93331ee | |||
f01c89b95a | |||
4344151405 | |||
74cb3504f3 | |||
ac031ba9a8 | |||
65726087bc | |||
dc03eec56f | |||
c1903b8c39 | |||
0cb7d3f9b4 | |||
874eacf12e | |||
3e6fb61a20 | |||
8e7ac713c4 | |||
54c1b0ce4b | |||
53456d9138 | |||
7ec1765766 | |||
bb122bfac4 | |||
0f8e578c62 | |||
dcee721cb3 | |||
b11ec1638e | |||
fb6ae47b6d | |||
be718d79af | |||
87ffc81b65 | |||
afd9dd07e4 | |||
ce9742b355 | |||
c402fbb5e8 | |||
b757ccc617 | |||
c5c57b523b | |||
bb4ce17d44 | |||
d4396c2ce3 | |||
780b5df024 | |||
60379fca37 | |||
b90c5a7710 | |||
28f964cb48 | |||
b68eb5f6a6 | |||
50bb4ae1be | |||
da18bac925 | |||
2b70bea44f | |||
c64d04d084 | |||
8186d093ec | |||
b2eb392a07 | |||
274fd9b608 | |||
27eec52e29 | |||
ee0aaa89eb | |||
886deabfbb | |||
e740349355 | |||
34f2799c53 | |||
a03d8eb52f | |||
07f3029f10 | |||
a56b83fa37 | |||
b4bc15201b | |||
c70f378f72 | |||
106b6c7062 | |||
6c3b161702 | |||
c484056cf0 | |||
2931a9c24d | |||
aeefc758ee | |||
21a1860ec2 | |||
c78da687d4 | |||
6c383dbd42 | |||
7688e5f230 | |||
1db6bd826a | |||
e7ca8cf18b | |||
cdb735c34e | |||
90e4b5d385 | |||
6a37edcdac | |||
563519ae4f | |||
7b812284c5 | |||
0082f54902 | |||
b32e4911ab | |||
fe9254c004 | |||
e3a8b2fc13 | |||
21ecbd90eb | |||
0bd68e4e2b | |||
b2aa2515b0 | |||
5cc4e2120a | |||
fe4e97f5dc | |||
6e4faefe15 | |||
460e9de94f | |||
1f5f466691 | |||
12c59a6aca | |||
19c58ebba2 | |||
d9fd1af272 | |||
78eb975435 | |||
a0ea3d5f3d | |||
f77863dfb5 | |||
7e5f6e9856 | |||
d004aa68b7 | |||
3aef2ea70e | |||
39df7fd10f | |||
b8738b32ca | |||
cdb697fd7b | |||
27dc4a5742 | |||
e2fe04927f | |||
a655235c70 | |||
96b219d2fb | |||
52879b0b04 | |||
048f1ac08e | |||
76a12af15f | |||
e6ed49427a | |||
c57a0d2c30 | |||
8d43c431f2 | |||
336251740d | |||
356f0348ed | |||
dc7c012c24 | |||
96eb834e9b | |||
b239866e99 | |||
6a4f06d51b | |||
e765dcf57b | |||
a594036778 | |||
c014ffddcd | |||
aeaf84ccc6 | |||
7d789ec208 | |||
3d0461b40a | |||
5aed632782 | |||
3c5a5b87c8 | |||
22a6c52795 | |||
b8fa948f7d | |||
f61b615704 | |||
8dcd22794b | |||
33f3c882b8 | |||
5943dad78c | |||
2f051a202c | |||
a760f2952a | |||
9549529faf | |||
65969462d1 | |||
13eea53090 | |||
fa8ab6194d | |||
8048e8734f | |||
8262a4203b | |||
01f9dd2f41 | |||
ccb9fa2a4f | |||
05435eed4f | |||
54a84af1c3 | |||
27c6ac1d31 | |||
8779700d82 | |||
f9b5d7c52c | |||
a10e798682 | |||
8cd91624ee | |||
68e42a22d6 | |||
fdef953859 | |||
3f334ed1f3 | |||
1a0bdf00cf | |||
54cd191d43 | |||
9fa4dad1ab | |||
080c121e07 | |||
545e288967 | |||
aecdac255d | |||
5c837f22cb | |||
12c81adeba | |||
8342b4c079 | |||
e83b8ef114 | |||
fabf4287d6 | |||
4ea01180a1 | |||
ab171573f9 | |||
d965b92af1 | |||
cc0174910b | |||
c4a506f5a3 | |||
58cdfadf4e | |||
b3a5275183 | |||
b314f56c00 | |||
d4b536b593 | |||
2bdde21a2f | |||
6ceebc9a17 | |||
65fc70a31a | |||
51a181a14f | |||
cfb4105dd8 | |||
b7faba556f | |||
95801b395d | |||
1f18369fbe | |||
f8663c90f3 | |||
1d6d660769 | |||
b57710cd78 | |||
6d41566e93 | |||
7a60cd5abe | |||
b9988469ba | |||
4fff3a500d | |||
a53ab5cb80 | |||
bd8104f6ee | |||
dbac88d225 | |||
70bcdfefa4 | |||
762c28f000 | |||
283fce619e | |||
7a5c8a6cb3 | |||
4342b880b9 | |||
ddddbd024d | |||
67e0ceb48d | |||
2298846fef | |||
567476b89a | |||
d345006c03 | |||
7f0e03b0e3 | |||
08a46ee8e6 | |||
fb88fda5cb | |||
90d856d128 | |||
d2e0327c30 | |||
2e97aa9979 | |||
cdb75e8c13 | |||
dac31a0347 | |||
0749f130e1 | |||
1bbb9386b7 | |||
f914159e21 | |||
849711c47d | |||
0a91eb0b46 | |||
806b00c2b7 | |||
e8151640a1 | |||
123e611f45 | |||
8d5278b9d4 | |||
ab96e8f3a3 | |||
d3b864362d | |||
6769d976a0 | |||
bd47b9ed45 | |||
6ea65a16a4 | |||
0849fbc674 | |||
e25be536a1 | |||
a70629e3b2 | |||
fed0478dc9 | |||
fcb4d9d36d | |||
5eb8af6d70 | |||
3c93eba4af | |||
78953b110f | |||
53124e9704 | |||
cde747439f | |||
dfc7a710d4 | |||
130cb822e4 | |||
c057fa6708 | |||
c6ad8cb5ee | |||
024b43dfa3 | |||
6667646d32 | |||
e1e9067744 | |||
c4656bf8ba | |||
232089f400 | |||
09144e712b | |||
2d94c2ed90 | |||
91652a2da5 | |||
929244b27a | |||
9a4f0cae0c | |||
402de082d3 | |||
ad275e1d41 | |||
d4559878df | |||
971cb4ab51 | |||
a2698fd560 | |||
11e14a891f | |||
803f9a9838 | |||
7bc9ef0150 | |||
72e8629d72 | |||
cdc33ceb9f | |||
54771e63c1 | |||
fde727b601 | |||
68091dcf43 | |||
1630ebfca4 | |||
1aa748e3d6 | |||
b3991979ad | |||
3eb3a0b825 | |||
9be920dbcd | |||
601d25cebc | |||
c900743f8d | |||
2b4e43281f | |||
630d12d963 | |||
8da9f28157 | |||
aab0c5afe2 | |||
0589f445f0 | |||
d33e7e532e | |||
c63692b5fd | |||
2f31aede0e | |||
33471436bf | |||
ee27485218 | |||
6bc22dcee2 | |||
ae9b8fb13e | |||
1dd5cbb445 | |||
a3a1fdc81b | |||
1f954a8cbf | |||
8f6442e9c7 | |||
f2ad2c5679 | |||
d03de942c5 | |||
13e2e7aeb8 | |||
b42ef7b17d | |||
92349997e4 | |||
3605e63840 | |||
8f7ff29b1f | |||
4e48481a07 | |||
246115fcf5 | |||
e092aab5ed | |||
ddc9e067d2 | |||
2b05efa4ba | |||
9105305543 | |||
e3c5042a5a | |||
510df0fb15 | |||
ebda525f85 | |||
64b4f040dc | |||
40a695a87f | |||
82f6983f8e | |||
2bc8159230 | |||
2d1ce18838 | |||
7b9fbd8738 | |||
f623414c04 | |||
c09ab37a59 | |||
585f2eb331 | |||
e21e05a039 | |||
8820fd159a | |||
99abe95a97 | |||
bfe64789b6 | |||
654c3be71e | |||
370d43d1b3 | |||
1483ab6a88 | |||
092f84437f | |||
d9850cf0f6 | |||
df0a23f702 | |||
6be7012987 | |||
58dfa9d95a | |||
7e0862cecc | |||
3cec185d91 | |||
ec36a8f519 | |||
1a7fbe37b1 | |||
1ae4119925 | |||
f101db2af1 | |||
b5a33f6ee3 | |||
94cd7f185f | |||
dd3e5290b2 | |||
dc48698d86 | |||
497a7dbd55 | |||
8ac8be9e0a | |||
df5b3805c5 | |||
758fa32b75 | |||
770e43c627 | |||
78904ef2b8 | |||
07d0168a96 | |||
6ce4b2dcca | |||
bf425014ab | |||
8624a07b77 | |||
cbf94414e2 | |||
758234f887 | |||
643d262fef | |||
0c0ad04cf9 | |||
7e64848146 | |||
64b142ecf3 | |||
7fe6f856a1 | |||
255d6139ee | |||
94de822499 | |||
bb1155700d | |||
c6610bdf46 | |||
edd8df4c50 | |||
131947dc74 | |||
2f78d9f62b | |||
62718daf0b | |||
f0fa6f7b68 | |||
4b149313e6 | |||
0086626173 | |||
e7c80217c2 | |||
c3a5b8dd3c | |||
dd9050e0aa | |||
eb7a3ceac7 | |||
73719a6659 | |||
c66247b3d3 | |||
5df0fe8836 | |||
b8061943aa | |||
22c7310428 | |||
c9ed65f22d | |||
3047049402 | |||
dff782a477 | |||
29b11063ee | |||
6f2c65b0d5 | |||
80fb4ed6da | |||
177f77f1f2 | |||
a57f1c9691 | |||
87b10e33d0 | |||
025844fe24 | |||
e4d470ad2c | |||
e08b97ff85 | |||
06547dcd07 | |||
5a763ea5f5 | |||
324af8fc92 | |||
2ccdc3e673 | |||
239ab49d6b | |||
5d4fc3cbf5 | |||
14ede63192 | |||
b2a291ca78 | |||
b60ecdd559 | |||
353788a645 | |||
1e51285a06 | |||
8bdb917c40 | |||
2970d21ddd | |||
b24d83aa95 | |||
ac5e54cfb6 | |||
ed6d61d12e | |||
62f2296642 | |||
b65908ea24 | |||
81e4eb07bf | |||
ea4b1b6aa7 | |||
4d39f1ee84 | |||
b1918f61de | |||
a9883bd1f2 | |||
67848a7a5c | |||
876a6ef9b1 | |||
982065a7b7 | |||
c759932ee6 | |||
6875a20eca | |||
ddab71e896 | |||
e9b0deaf75 | |||
db05211516 | |||
f4315db035 | |||
84f402abd9 | |||
3753a1be5c | |||
6a6a572069 | |||
6d437c8007 | |||
5088ee99e6 | |||
6ccab10bbf | |||
a08b8bbcb0 | |||
f9a36314fb | |||
1caf805d2b | |||
0f7bb5573c | |||
2a63e97533 | |||
50ec3a018f | |||
1b9b142b2e | |||
f2211b9578 | |||
bded0a07d9 | |||
b266f87450 | |||
af417d3ae1 | |||
e211f82f6c | |||
3c51f638f1 | |||
d548fc62ab | |||
373a79fb91 | |||
cfdc8cff1d | |||
980d10d1a4 | |||
25f4cb0be1 | |||
e0e93281fb | |||
f35701b9c6 | |||
67d01a9393 | |||
af61f51e48 | |||
878d89eee5 | |||
3ab74be66b | |||
e58c651b67 | |||
e2bec11c23 | |||
bec533d8bd | |||
b781405a95 | |||
571f9c9498 | |||
0e52ea619b | |||
a19678948b | |||
fe06de86b4 | |||
f9878b3fe6 | |||
fe318a78d2 | |||
ba403de6e7 | |||
2b6dd5f3fd | |||
09b1bb9a60 | |||
8c4b5333d5 | |||
b01b52dfb8 | |||
b608232cb9 | |||
668aa320b9 | |||
c0bff584d5 | |||
d1fccde249 | |||
d6dd6402b9 | |||
dcb4e83251 | |||
2a7ca8e51d | |||
70368ecb7e | |||
f1bcd7bfb4 | |||
21297e80d4 | |||
1b74f5335d | |||
372b83fbed | |||
4a8ddc10ad | |||
d456066277 | |||
a040f51cda | |||
46460e20d9 | |||
196654e7c6 | |||
d1aa4b62f2 | |||
3cb80093e0 | |||
64e81def0f | |||
8e9e0976bb | |||
c1f9d15f67 | |||
d866b25f85 | |||
2583d0852d | |||
2de319c254 | |||
77fbf49f93 | |||
372d3e980f | |||
dd014c718f | |||
5304192813 | |||
8d524b8744 | |||
deff852839 | |||
2d2ee8d1f0 | |||
9a83bb7530 | |||
2b642ab7a4 | |||
bde7259ee8 | |||
dc93fb11ff | |||
19d1af6a48 | |||
e689dc175c | |||
06ecae7212 | |||
4faa71d239 | |||
5265bada9c | |||
84067826eb | |||
98e3621c93 | |||
d79799bab9 | |||
49e04593d8 | |||
bda66a3d06 | |||
84a77730be | |||
b08fc8d48d | |||
e64f192fb7 | |||
40fe6654eb | |||
e740335701 | |||
b257d91702 | |||
e7394217b1 | |||
baec9966f0 | |||
0fb56356fb | |||
e0ef6eea64 | |||
743730550c | |||
9ab9e2c403 | |||
8da6095c35 | |||
1849e22154 | |||
dec9b2096e | |||
e1df8b5bf6 |
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Dockerfile
|
||||||
|
docker-compose.yaml
|
||||||
|
build
|
5
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
build/
|
build*/
|
||||||
|
|
||||||
# Object files
|
# Object files
|
||||||
*.o
|
*.o
|
||||||
@ -11,3 +11,6 @@ build/
|
|||||||
# Temp files
|
# Temp files
|
||||||
*.swp
|
*.swp
|
||||||
*~
|
*~
|
||||||
|
|
||||||
|
# Node modules
|
||||||
|
**/node_modules
|
||||||
|
6
.gitmodules
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[submodule "doxy/doxygen2jsdoc"]
|
||||||
|
path = doxy/doxygen2jsdoc
|
||||||
|
url = https://github.com/intel-iot-devkit/doxygen2jsdoc
|
||||||
|
[submodule "doxy/doxyport"]
|
||||||
|
path = doxy/doxyport
|
||||||
|
url = https://github.com/intel-iot-devkit/doxyport
|
126
.travis.yml
@ -1,46 +1,82 @@
|
|||||||
|
dist: trusty
|
||||||
|
sudo: required
|
||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
env:
|
|
||||||
global:
|
services:
|
||||||
- MRAA_ROOT=/tmp/mraa
|
- docker
|
||||||
- MRAA_BUILD=$MRAA_ROOT/build
|
|
||||||
- MRAA_INSTALL=$MRAA_ROOT/install
|
before_install:
|
||||||
- UPM_ROOT=$TRAVIS_BUILD_DIR
|
- sudo rm /usr/local/bin/docker-compose
|
||||||
- UPM_BUILD=$UPM_ROOT/build
|
- curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > docker-compose
|
||||||
- UPM_INSTALL=$UPM_ROOT/install
|
- chmod +x docker-compose
|
||||||
- JAVA_HOME=/usr/lib/jvm/java-8-oracle
|
- sudo mv docker-compose /usr/local/bin
|
||||||
matrix:
|
|
||||||
- NODE010=true
|
jobs:
|
||||||
- NODE012=true
|
fast_finish: true
|
||||||
- NODE4=true
|
allow_failures:
|
||||||
- NODE5=true
|
- env: TARGET=sonar-scan
|
||||||
compiler:
|
- env: TARGET=ipk
|
||||||
- clang
|
include:
|
||||||
- gcc
|
- &run-with-clang
|
||||||
install:
|
stage: Clang 3.8
|
||||||
- sudo add-apt-repository --yes ppa:fenics-packages/fenics-exp/swig
|
env: TARGET=python
|
||||||
- sudo apt-get update -qq
|
before_script: docker-compose pull ${TARGET}
|
||||||
- sudo apt-get install -y -qq swig3.0 git
|
script:
|
||||||
- sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
|
- export CC=clang-3.8 CXX=clang++-3.8
|
||||||
- sudo update-java-alternatives -s java-8-oracle
|
- docker-compose run ${TARGET}
|
||||||
before_script:
|
- <<: *run-with-clang
|
||||||
# Turn off JAVA SWIG for clang++, use 4.8 for all g++ builds
|
env: TARGET=node4
|
||||||
- if [ "$CC" == "gcc" ]; then export BUILDJAVA=ON; export CC=gcc-4.8; export CXX=g++-4.8; else export BUILDJAVA=OFF; fi
|
- <<: *run-with-clang
|
||||||
- if [ "${NODE012}" ]; then nvm install 0.12; fi
|
env: TARGET=node5
|
||||||
- if [ "${NODE4}" ]; then nvm install 4.1; fi
|
- <<: *run-with-clang
|
||||||
- if [ "${NODE5}" ]; then nvm install 5; fi
|
env: TARGET=node6
|
||||||
# Handle 0.10 NODE_ROOT_DIR differently than other versions
|
- <<: *run-with-clang
|
||||||
- if [ -z ${NODE010} ]; then export NODE_ROOT_DIR="/home/travis/.nvm/versions/node/`nvm version`"; else export NODE_ROOT_DIR=/home/travis/.nvm/v0.10.36; fi
|
env: TARGET=java
|
||||||
script:
|
- &run-with-gcc-5
|
||||||
- echo "CC=$CC BUILDJAVA=$BUILDJAVA NODE010=$NODE010 NODE012=$NODE012 NODE4=$NODE4 NODE5=$NODE5 NODE_ROOT_DIR=$NODE_ROOT_DIR"
|
stage: Gcc 5
|
||||||
- git clone https://github.com/intel-iot-devkit/mraa.git $MRAA_ROOT
|
env: TARGET=python
|
||||||
- mkdir -p $MRAA_BUILD && cd $_ && cmake -DBUILDSWIGJAVA=$BUILDJAVA -DBUILDSWIGNODE=OFF -DBUILDSWIGPYTHON=OFF -DFIRMATA=ON -DENABLEEXAMPLES=OFF -DCMAKE_INSTALL_PREFIX:PATH=$MRAA_INSTALL $MRAA_ROOT && make install
|
before_script: docker-compose pull ${TARGET}
|
||||||
- cd $UPM_ROOT && mkdir $UPM_BUILD && cd $_ && PKG_CONFIG_PATH=$MRAA_INSTALL/lib/pkgconfig cmake -DNODE_ROOT_DIR:PATH="${NODE_ROOT_DIR}" -DBUILDSWIGJAVA=$BUILDJAVA -DBUILDEXAMPLES=ON -DBUILDJAVAEXAMPLES=$BUILDJAVA -DCMAKE_INSTALL_PREFIX:PATH=$UPM_INSTALL .. && make install
|
script:
|
||||||
addons:
|
- export CC=gcc-5 CXX=g++-5
|
||||||
apt:
|
- docker-compose run ${TARGET}
|
||||||
sources:
|
- <<: *run-with-gcc-5
|
||||||
- ubuntu-toolchain-r-test
|
env: TARGET=node4
|
||||||
- george-edison55-precise-backports
|
- <<: *run-with-gcc-5
|
||||||
packages:
|
env: TARGET=node5
|
||||||
- cmake
|
- <<: *run-with-gcc-5
|
||||||
- cmake-data
|
env: TARGET=node6
|
||||||
- g++-4.8
|
- <<: *run-with-gcc-5
|
||||||
|
env: TARGET=java
|
||||||
|
- &run-with-gcc-6
|
||||||
|
stage: Gcc 6
|
||||||
|
env: TARGET=python
|
||||||
|
before_script: docker-compose pull ${TARGET}
|
||||||
|
script:
|
||||||
|
- export CC=gcc-6 CXX=g++-6
|
||||||
|
- docker-compose run ${TARGET}
|
||||||
|
- <<: *run-with-gcc-6
|
||||||
|
env: TARGET=node4
|
||||||
|
- <<: *run-with-gcc-6
|
||||||
|
env: TARGET=node5
|
||||||
|
- <<: *run-with-gcc-6
|
||||||
|
env: TARGET=node6
|
||||||
|
- <<: *run-with-gcc-6
|
||||||
|
env: TARGET=java
|
||||||
|
- &run-additional-jobs
|
||||||
|
stage: Additional Jobs
|
||||||
|
env: TARGET=doc
|
||||||
|
before_script: docker-compose pull ${TARGET}
|
||||||
|
script:
|
||||||
|
- export CC=clang-3.8 CXX=clang++-3.8
|
||||||
|
- docker-compose run ${TARGET}
|
||||||
|
- <<: *run-additional-jobs
|
||||||
|
env: TARGET=android
|
||||||
|
- <<: *run-additional-jobs
|
||||||
|
env: TARGET=sonar-scan
|
||||||
|
- <<: *run-additional-jobs
|
||||||
|
env: TARGET=ipk
|
||||||
|
- <<: *run-additional-jobs
|
||||||
|
env: TARGET=rpm
|
||||||
|
- <<: *run-additional-jobs
|
||||||
|
env: TARGET=npm
|
||||||
|
421
CMakeLists.txt
@ -1,20 +1,211 @@
|
|||||||
cmake_minimum_required (VERSION 2.8.11)
|
cmake_minimum_required (VERSION 2.8.11)
|
||||||
project (upm)
|
project (upm)
|
||||||
|
|
||||||
|
# Before going any further, define build options
|
||||||
|
option (BUILDDOC "Build all doc" OFF)
|
||||||
|
option (BUILDCPP "Build CPP sensor libraries" ON)
|
||||||
|
option (BUILDFTI "Build Funtion Table Interface (FTI) in C sensor libraries" OFF)
|
||||||
|
option (BUILDSWIGPYTHON "Build swig python modules" ON)
|
||||||
|
option (BUILDSWIGNODE "Build swig node modules" ON)
|
||||||
|
option (BUILDSWIGJAVA "Build swig java modules" OFF)
|
||||||
|
option (BUILDEXAMPLES "Build C/C++/JAVA examples" OFF)
|
||||||
|
option (IPK "Generate IPK using CPack" OFF)
|
||||||
|
option (RPM "Generate RPM using CPack" OFF)
|
||||||
|
option (NPM "Generate NPM/GYP tarballs" OFF)
|
||||||
|
option (BUILDTESTS "Generate check-ups for upm" OFF)
|
||||||
|
option (WERROR "Make all warnings into errors." ON)
|
||||||
|
|
||||||
|
# Warn if building in source root
|
||||||
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||||
message("WARNING: building into sources dir can be risky, prefer other directory")
|
message (WARNING "Building into sources dir can be risky, prefer other directory")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
|
||||||
|
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
|
# Check if provided compiler supports target flag
|
||||||
|
# usage:
|
||||||
|
# compiler_flag_supported(C/CXX is_supported flag)
|
||||||
|
#
|
||||||
|
# The result of output_variable is set to the sanitized flag name if supported
|
||||||
|
# or cleared if the flag is not supported.
|
||||||
|
function (compiler_flag_supported compiler output_variable flag)
|
||||||
|
# Currently only C and CXX compile flags, clear and return if not supported
|
||||||
|
if (NOT ${compiler} MATCHES "C|CXX")
|
||||||
|
message (WARNING "Unknown compiler: ${compiler}")
|
||||||
|
set ("${output_variable}" "" PARENT_SCOPE)
|
||||||
|
return ()
|
||||||
|
endif (NOT ${compiler} MATCHES "C|CXX")
|
||||||
|
|
||||||
|
string (REPLACE "-" "_" SANITIZED_FLAG_NAME "${flag}")
|
||||||
|
string (REPLACE "/" "_" SANITIZED_FLAG_NAME "${SANITIZED_FLAG_NAME}")
|
||||||
|
string (REPLACE "=" "_" SANITIZED_FLAG_NAME "${SANITIZED_FLAG_NAME}")
|
||||||
|
string (REPLACE " " "_" SANITIZED_FLAG_NAME "${SANITIZED_FLAG_NAME}")
|
||||||
|
|
||||||
|
# Disable messages from CHECK_C/XX_COMPILER_FLAGS macros
|
||||||
|
set (CMAKE_REQUIRED_QUIET_SAVED ${CMAKE_REQUIRED_QUIET})
|
||||||
|
set (CMAKE_REQUIRED_QUIET ON)
|
||||||
|
|
||||||
|
# C or CXX?
|
||||||
|
if (${compiler} STREQUAL C)
|
||||||
|
CHECK_C_COMPILER_FLAG("${flag}" HAS_${SANITIZED_FLAG_NAME})
|
||||||
|
elseif (${compiler} STREQUAL CXX)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("${flag}" HAS_${SANITIZED_FLAG_NAME})
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Restore previous CMAKE_REQUIRED_QUIET state
|
||||||
|
set (CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVED})
|
||||||
|
|
||||||
|
# Does the compiler support this flag?
|
||||||
|
if (HAS_${SANITIZED_FLAG_NAME})
|
||||||
|
set ("${output_variable}" "${SANITIZED_FLAG_NAME}" PARENT_SCOPE)
|
||||||
|
else ()
|
||||||
|
set ("${output_variable}" "" PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
include (CheckCCompilerFlag)
|
||||||
|
include (CheckCXXCompilerFlag)
|
||||||
|
# Add scoped compile flag/s using add_compile_options.
|
||||||
|
# This function checks to see if each flag is supported
|
||||||
|
# by the compiler before setting the compile option.
|
||||||
|
function (upm_add_compile_flags compiler)
|
||||||
|
set (_TMP_COMPILER_FLAGS "")
|
||||||
|
# Iterate the flags, check if supported
|
||||||
|
foreach (flag ${ARGN})
|
||||||
|
# Check if this compile flag is supported
|
||||||
|
compiler_flag_supported(${compiler} is_supported ${flag})
|
||||||
|
|
||||||
|
# Add if supported, warn and skip if not supported
|
||||||
|
if (is_supported)
|
||||||
|
set (_TMP_COMPILER_FLAGS "${_TMP_COMPILER_FLAGS} ${flag}")
|
||||||
|
else ()
|
||||||
|
message (WARNING "${compiler} compiler does not support flag \"${flag}\"")
|
||||||
|
endif ()
|
||||||
|
endforeach (flag ${ARGN})
|
||||||
|
|
||||||
|
# Set the variable in the parent scope
|
||||||
|
set (CMAKE_${compiler}_FLAGS "${CMAKE_${compiler}_FLAGS} ${_TMP_COMPILER_FLAGS}" PARENT_SCOPE)
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
# Compiler flags common to both C and CXX
|
||||||
|
# Enable -Wall
|
||||||
|
# GCC-6 added -Wmisleading-indentation to -Wall, skip these for now
|
||||||
|
set (C_CXX_WARNING_FLAGS -Wall -Wno-misleading-indentation -Wno-strict-aliasing)
|
||||||
|
|
||||||
|
# Warnings as errors?
|
||||||
|
if (WERROR)
|
||||||
|
list (APPEND C_CXX_WARNING_FLAGS -Werror)
|
||||||
|
message (STATUS "Warnings as errors enabled (-Werror), disable with -DWERROR=off")
|
||||||
|
endif (WERROR)
|
||||||
|
|
||||||
|
# Set C compiler warning flags at top-level scope and emit a warning about
|
||||||
|
# unsupported flags
|
||||||
|
upm_add_compile_flags(C ${C_CXX_WARNING_FLAGS}
|
||||||
|
-Winit-self
|
||||||
|
-Wimplicit
|
||||||
|
-Wmissing-parameter-type)
|
||||||
|
|
||||||
|
# Set CXX compiler warning flags at top-level scope and emit a warning about
|
||||||
|
# unsupported flags
|
||||||
|
upm_add_compile_flags(CXX ${C_CXX_WARNING_FLAGS}
|
||||||
|
-Wnon-virtual-dtor
|
||||||
|
-Woverloaded-virtual
|
||||||
|
-Wreorder)
|
||||||
|
|
||||||
|
# Allow exception error handling for Android C++
|
||||||
|
if (ANDROID)
|
||||||
|
upm_add_compile_flags(CXX -fexceptions)
|
||||||
|
endif (ANDROID)
|
||||||
|
|
||||||
find_package (Threads REQUIRED)
|
find_package (Threads REQUIRED)
|
||||||
find_package (PkgConfig REQUIRED)
|
find_package (PkgConfig REQUIRED)
|
||||||
|
|
||||||
# Force a libmraa search and minimum required version every time a config is generated
|
# Force a libmraa search and minimum required version every time a config is generated
|
||||||
unset(MRAA_FOUND CACHE)
|
unset(MRAA_FOUND CACHE)
|
||||||
pkg_check_modules (MRAA REQUIRED mraa>=1.0.0)
|
set(MRAA_MINIMUM 1.7.0)
|
||||||
message (INFO " found mraa version: ${MRAA_VERSION}")
|
pkg_check_modules (MRAA REQUIRED mraa>=${MRAA_MINIMUM})
|
||||||
|
# Also, get full path to the mraa library
|
||||||
|
find_library(MRAA_LIBRARY NAMES mraa HINTS ${MRAA_LIBDIR})
|
||||||
|
|
||||||
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
|
# Test MRAA for various compile options
|
||||||
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
include (CheckLibraryExists)
|
||||||
|
check_library_exists (${MRAA_LIBRARIES} mraa_iio_init "${MRAA_LIBDIR}" MRAA_IIO_FOUND)
|
||||||
|
check_library_exists (${MRAA_LIBRARIES} mraa_firmata_init "${MRAA_LIBDIR}" MRAA_FIRMATA_FOUND)
|
||||||
|
check_library_exists (${MRAA_LIBRARIES} mraa_uart_ow_init "${MRAA_LIBDIR}" MRAA_OW_FOUND)
|
||||||
|
|
||||||
|
# Check for BACNET
|
||||||
|
pkg_check_modules (BACNET libbacnet)
|
||||||
|
|
||||||
|
# Check for MODBUS
|
||||||
|
pkg_check_modules (MODBUS libmodbus>=3.1.2)
|
||||||
|
|
||||||
|
# Check for OPENZWAVE
|
||||||
|
pkg_check_modules (OPENZWAVE libopenzwave)
|
||||||
|
|
||||||
|
# Find JPEG
|
||||||
|
find_package (JPEG)
|
||||||
|
|
||||||
|
# Find nodejs
|
||||||
|
if (BUILDSWIGNODE)
|
||||||
|
find_package (Node REQUIRED)
|
||||||
|
if (BUILDTESTS)
|
||||||
|
find_package (Npm REQUIRED)
|
||||||
|
if(NPM_EXECUTABLE)
|
||||||
|
message(STATUS "NPM Executable found at: ${NPM_EXECUTABLE}")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Please install NPM first, you can't run tests without it")
|
||||||
|
endif()
|
||||||
|
endif (BUILDTESTS)
|
||||||
|
endif (BUILDSWIGNODE)
|
||||||
|
|
||||||
|
# Find JAVA/JNI
|
||||||
|
if (BUILDSWIGJAVA)
|
||||||
|
find_package (Java REQUIRED)
|
||||||
|
find_package (JNI REQUIRED)
|
||||||
|
pkg_check_modules (MRAAJAVA REQUIRED mraajava>=${MRAA_MINIMUM})
|
||||||
|
# Also, get full path to the mraajava library
|
||||||
|
find_library(MRAAJAVA_LIBRARY NAMES mraajava HINTS ${MRAA_LIBDIR})
|
||||||
|
endif (BUILDSWIGJAVA)
|
||||||
|
|
||||||
|
# Find swig if any wrapper is enabled
|
||||||
|
if (BUILDSWIGPYTHON OR BUILDSWIGNODE OR BUILDSWIGJAVA)
|
||||||
|
find_package (SWIG 3.0.5 REQUIRED)
|
||||||
|
include (${SWIG_USE_FILE})
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Python is required for swig generated python and for UPM tests.
|
||||||
|
# The UPM build can generated modules for both python2 AND python3
|
||||||
|
# with the corresponding PYTHONLIBS. Currently, BUILDTESTS has a
|
||||||
|
# hard dependency on the PYTHON2INTERP.
|
||||||
|
# OpenCV python detect will attempt to find python2/3
|
||||||
|
if (BUILDSWIGPYTHON OR BUILDTESTS)
|
||||||
|
include (cmake/modules/OpenCVDetectPython.cmake)
|
||||||
|
|
||||||
|
# Fail if building tests but no python interpreter was found
|
||||||
|
if (BUILDTESTS AND NOT PYTHON2INTERP_FOUND)
|
||||||
|
message(FATAL_ERROR "BUILDTESTS=ON requires the python2 interpreter")
|
||||||
|
endif (BUILDTESTS AND NOT PYTHON2INTERP_FOUND)
|
||||||
|
|
||||||
|
# Fail if no LIBS were found
|
||||||
|
if (NOT PYTHON2LIBS_FOUND AND NOT PYTHON3LIBS_FOUND)
|
||||||
|
message(FATAL_ERROR "At least one python lib is required")
|
||||||
|
endif (NOT PYTHON2LIBS_FOUND AND NOT PYTHON3LIBS_FOUND)
|
||||||
|
endif (BUILDSWIGPYTHON OR BUILDTESTS)
|
||||||
|
|
||||||
|
# Which versions of python were found?
|
||||||
|
if (PYTHON2LIBS_FOUND AND BUILDSWIGPYTHON)
|
||||||
|
message(STATUS "Building python2 modules with python-${PYTHON2LIBS_VERSION_STRING}")
|
||||||
|
endif (PYTHON2LIBS_FOUND AND BUILDSWIGPYTHON)
|
||||||
|
if (PYTHON3LIBS_FOUND AND BUILDSWIGPYTHON)
|
||||||
|
message(STATUS "Building python3 modules with python-${PYTHON3LIBS_VERSION_STRING}")
|
||||||
|
endif (PYTHON3LIBS_FOUND AND BUILDSWIGPYTHON)
|
||||||
|
|
||||||
|
# Python2 is currently required for python documentation
|
||||||
|
if (BUILDSWIGPYTHON AND BUILDDOC AND NOT PYTHON2INTERP_FOUND)
|
||||||
|
message(FATAL_ERROR "Failed to find python2 interpreter which is required "
|
||||||
|
"to build python documentation.")
|
||||||
|
endif (BUILDSWIGPYTHON AND BUILDDOC AND NOT PYTHON2INTERP_FOUND)
|
||||||
|
|
||||||
# Set CMAKE_INSTALL_LIBDIR if not defined
|
# Set CMAKE_INSTALL_LIBDIR if not defined
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
@ -23,12 +214,14 @@ set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for
|
|||||||
# Make a version file containing the current version from git.
|
# Make a version file containing the current version from git.
|
||||||
include (GetGitRevisionDescription)
|
include (GetGitRevisionDescription)
|
||||||
git_describe (VERSION "--tags")
|
git_describe (VERSION "--tags")
|
||||||
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
|
# If git_describe fails, use a dirty version
|
||||||
message (WARNING " - Install git to compile a production UPM!")
|
if (${VERSION} MATCHES -NOTFOUND)
|
||||||
set (VERSION "v0.7.1-dirty")
|
set (VERSION "v1.3.0")
|
||||||
|
message (WARNING "Failed to retrieve UPM version with 'git describe' (using "
|
||||||
|
"${VERSION}). Check that git is installed and this is a valid git repo.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
message (INFO " - UPM Version ${VERSION}")
|
message (STATUS "UPM Version ${VERSION}")
|
||||||
|
|
||||||
# Parse the version information into pieces.
|
# Parse the version information into pieces.
|
||||||
string (REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
|
string (REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
|
||||||
@ -46,91 +239,98 @@ set (upm_VERSION_MINOR ${VERSION_MINOR})
|
|||||||
set (upm_VERSION_PATCH ${VERSION_PATCH})
|
set (upm_VERSION_PATCH ${VERSION_PATCH})
|
||||||
set (upm_VERSION_STRING ${upm_VERSION_MAJOR}.${upm_VERSION_MINOR}.${upm_VERSION_PATCH})
|
set (upm_VERSION_STRING ${upm_VERSION_MAJOR}.${upm_VERSION_MINOR}.${upm_VERSION_PATCH})
|
||||||
|
|
||||||
set (CMAKE_SWIG_FLAGS "")
|
|
||||||
|
|
||||||
option (BUILDDOC "Build all doc." OFF)
|
|
||||||
option (BUILDSWIG "Build swig modules." ON)
|
|
||||||
option (BUILDSWIGPYTHON "Build swig python modules." ON)
|
|
||||||
option (BUILDPYTHON3 "Use python3 for building/installing/testing" OFF)
|
|
||||||
option (BUILDSWIGNODE "Build swig node modules." ON)
|
|
||||||
option (BUILDEXAMPLES "Build C++ example binaries" OFF)
|
|
||||||
option (BUILDJAVAEXAMPLES "Build java example jars" OFF)
|
|
||||||
option (BUILDSWIGJAVA "Build swig java modules" OFF)
|
|
||||||
option (IPK "Generate IPK using CPack" OFF)
|
|
||||||
option (RPM "Generate RPM using CPack" OFF)
|
|
||||||
option (BUILDTESTS "Generate check-ups for upm" ON)
|
|
||||||
option (ENABLECXX11 "Enable C++11 standards support" ON)
|
|
||||||
|
|
||||||
# Find swig
|
|
||||||
if (BUILDSWIG)
|
|
||||||
if (BUILDSWIGNODE)
|
|
||||||
find_package (SWIG 3.0.5 REQUIRED)
|
|
||||||
else ()
|
|
||||||
find_package (SWIG REQUIRED)
|
|
||||||
endif ()
|
|
||||||
if (SWIG_FOUND)
|
|
||||||
include (${SWIG_USE_FILE})
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Detect arch
|
# Detect arch
|
||||||
include (TargetArch)
|
include (TargetArch)
|
||||||
target_architecture (DETECTED_ARCH)
|
target_architecture (DETECTED_ARCH)
|
||||||
message( INFO " - Target arch is ${DETECTED_ARCH}")
|
message (STATUS "Target arch is ${DETECTED_ARCH}")
|
||||||
|
|
||||||
#-march=native for ARM when not defined/forced
|
# enable c++11 standards support unconditionally
|
||||||
if (DETECTED_ARCH MATCHES "arm.*" AND NOT CMAKE_CXX_FLAGS MATCHES "-march")
|
include(CheckCXXCompilerFlag)
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
|
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||||
endif()
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
||||||
# enable c++11 standards support
|
if (COMPILER_SUPPORTS_CXX11)
|
||||||
if (ENABLECXX11)
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
include(CheckCXXCompilerFlag)
|
elseif (COMPILER_SUPPORTS_CXX0X)
|
||||||
if (CMAKE_VERSION VERSION_LESS "3.1")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
|
||||||
if (COMPILER_SUPPORTS_CXX11)
|
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
||||||
elseif (COMPILER_SUPPORTS_CXX0X)
|
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
||||||
else()
|
|
||||||
message(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please update your C++ compiler.")
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
# 3.1+ uses this generic method to enable c++11
|
message(FATAL_ERROR "A C++11 compliant compiler is required to build UPM.")
|
||||||
set (CMAKE_CXX_STANDARD 11)
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(WARNING "Some modules require C++11 support, and may not build without it.")
|
# 3.1+ uses this generic method to enable c++11
|
||||||
|
set (CMAKE_CXX_STANDARD 11)
|
||||||
|
set (CXX_STANDARD_REQUIRED ON)
|
||||||
|
set (CXX_EXTENSIONS OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(CheckCCompilerFlag)
|
||||||
|
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||||
|
CHECK_C_COMPILER_FLAG("-std=c11" COMPILER_SUPPORTS_C11)
|
||||||
|
if (COMPILER_SUPPORTS_C11)
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "A C11 compliant C compiler is required to build UPM.")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# 3.1+ uses this generic method to enable c11
|
||||||
|
set (CMAKE_C_STANDARD 11)
|
||||||
|
set (C_STANDARD_REQUIRED ON)
|
||||||
|
set (C_EXTENSIONS OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# The doc target depends on each sensor target
|
||||||
|
#
|
||||||
|
# doc
|
||||||
|
# ├──> libupm_sensor0
|
||||||
|
# ├──> libupm_sensor1
|
||||||
|
# ├──> libupm_sensor2
|
||||||
|
# └──> libupm_sensor_n
|
||||||
|
#
|
||||||
|
# The pydoc target builds documentation with sphinx via inspection by loading
|
||||||
|
# each python module. Those modules must include the CXX documentation via
|
||||||
|
# a monolithic swig file generated by doxy2swig
|
||||||
|
#
|
||||||
|
# pydoc
|
||||||
|
# └──> _pyupm_sensor0_python2
|
||||||
|
# ├──────> libupm_sensor0
|
||||||
|
# └──────> doxy2swig
|
||||||
|
#
|
||||||
|
# The doxy2swig target is dependent upon the doc target IF BUILDDOC=ON,
|
||||||
|
# otherwise doxy2swig uses an empty file. Doxy2swig also depends on each
|
||||||
|
# sensor target
|
||||||
|
#
|
||||||
|
# doxy2swig
|
||||||
|
# ├──> BUILDDOC=ON───> doc
|
||||||
|
# └──> libupm_sensor0
|
||||||
|
#
|
||||||
|
# The jsdoc target builds js documentation via yuidoc and only requires
|
||||||
|
# the doc target
|
||||||
|
#
|
||||||
|
# jsdoc ─> doc
|
||||||
|
#
|
||||||
if (BUILDDOC)
|
if (BUILDDOC)
|
||||||
# Add a target to generate API documentation with Doxygen
|
# Add a target to generate API documentation with Doxygen
|
||||||
find_package (Doxygen)
|
find_package (Doxygen REQUIRED)
|
||||||
if (DOXYGEN_FOUND)
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
||||||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
if (BUILDSWIGJAVA)
|
||||||
if (BUILDSWIGJAVA)
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/Doxyfile.java.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-java @ONLY)
|
||||||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/Doxyfile.java.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-java @ONLY)
|
endif()
|
||||||
endif()
|
file(GLOB PNG_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/docs docs/icons/*.png)
|
||||||
file(GLOB PNG_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/docs docs/icons/*.png)
|
foreach(PNG_FILE ${PNG_FILES})
|
||||||
foreach(PNG_FILE ${PNG_FILES})
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/${PNG_FILE} ${CMAKE_CURRENT_BINARY_DIR}/html/docs/${PNG_FILE} COPYONLY)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/${PNG_FILE} ${CMAKE_CURRENT_BINARY_DIR}/html/docs/${PNG_FILE} COPYONLY)
|
endforeach()
|
||||||
endforeach()
|
add_custom_target (doc
|
||||||
add_custom_target (doc
|
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
COMMAND tar -czf html/xml.tar.gz -C xml .
|
||||||
COMMAND tar -czf html/xml.tar.gz -C xml .
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
COMMENT "Generating API documentation with Doxygen" VERBATIM
|
||||||
COMMENT "Generating API documentation with Doxygen" VERBATIM
|
)
|
||||||
)
|
|
||||||
endif (DOXYGEN_FOUND)
|
|
||||||
# Check if Sphinx is installed and add target to generate API documentation
|
# Check if Sphinx is installed and add target to generate API documentation
|
||||||
find_package (Sphinx)
|
# Currently, the per-module documentation for python is generated from the
|
||||||
if(SPHINX_FOUND AND BUILDSWIG AND BUILDSWIGPYTHON)
|
# python2 modules.
|
||||||
# Python required for Sphinx build
|
if(BUILDSWIGPYTHON)
|
||||||
find_package (PythonLibs ${PYTHONBUILD_VERSION} REQUIRED)
|
find_package (Sphinx REQUIRED)
|
||||||
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
|
|
||||||
list (GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
|
|
||||||
list (GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
|
|
||||||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/pydoc/conf.py @ONLY)
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/pydoc/conf.py @ONLY)
|
||||||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/index.rst ${CMAKE_CURRENT_BINARY_DIR}/pydoc/index.rst COPYONLY)
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/index.rst ${CMAKE_CURRENT_BINARY_DIR}/pydoc/index.rst COPYONLY)
|
||||||
add_custom_target (pydoc ALL
|
add_custom_target (pydoc ALL
|
||||||
@ -146,29 +346,23 @@ if (BUILDDOC)
|
|||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMENT "Generating API documentation with Sphinx" VERBATIM
|
COMMENT "Generating API documentation with Sphinx" VERBATIM
|
||||||
)
|
)
|
||||||
endif ()
|
endif(BUILDSWIGPYTHON)
|
||||||
|
|
||||||
# Check if Yuidoc is installed and add target for API documentation
|
# Check if Yuidoc is installed and add target for API documentation
|
||||||
find_package(Yuidoc)
|
if(BUILDSWIGNODE)
|
||||||
if(YUIDOC_FOUND AND BUILDSWIGNODE)
|
find_package(Yuidoc REQUIRED)
|
||||||
# Node required for Yuidoc documentation
|
|
||||||
find_package(Node)
|
|
||||||
file(GLOB_RECURSE JSDOC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/doxy/node doxy/node/*)
|
|
||||||
foreach(JSDOC_FILE ${JSDOC_FILES})
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxy/node/${JSDOC_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${JSDOC_FILE} COPYONLY)
|
|
||||||
endforeach()
|
|
||||||
add_custom_target(jsdoc ALL
|
add_custom_target(jsdoc ALL
|
||||||
COMMAND ${NODEJS_EXECUTABLE} docgen -m upm -i xml -t ${CMAKE_CURRENT_SOURCE_DIR}/src -g ../../
|
COMMAND ${CMAKE_SOURCE_DIR}/doxy/doxygen2jsdoc/docgen.js -m upm -i xml -o jsdoc -t ${CMAKE_CURRENT_SOURCE_DIR}/src -g ../../
|
||||||
COMMAND ${YUIDOC_EXECUTABLE} -C --no-sort --helpers generators/yuidoc/helper.js --themedir generators/yuidoc/tmpl -o html/node jsdoc/yuidoc/upm
|
COMMAND ${YUIDOC_EXECUTABLE} -C --no-sort --helpers ${CMAKE_SOURCE_DIR}/doxy/node/generators/yuidoc/helper.js --themedir ${CMAKE_SOURCE_DIR}/doxy/node/generators/yuidoc/tmpl -o html/node jsdoc/yuidoc/upm
|
||||||
COMMAND ${NODEJS_EXECUTABLE} tolower -i html/node
|
COMMAND ${CMAKE_SOURCE_DIR}/doxy/doxygen2jsdoc/tolower.js -i html/node
|
||||||
DEPENDS doc
|
DEPENDS doc
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMENT "Generating API documentation with Yuidoc" VERBATIM
|
COMMENT "Generating API documentation with Yuidoc" VERBATIM
|
||||||
)
|
)
|
||||||
endif()
|
endif(BUILDSWIGNODE)
|
||||||
endif()
|
endif (BUILDDOC)
|
||||||
|
|
||||||
if (IPK)
|
if (IPK)
|
||||||
|
|
||||||
# Get target package arch from Yocto ADT sysroot if set or host OS, mapping to Ubuntu name if necessary
|
# Get target package arch from Yocto ADT sysroot if set or host OS, mapping to Ubuntu name if necessary
|
||||||
if (DEFINED ENV{OECORE_TARGET_SYSROOT})
|
if (DEFINED ENV{OECORE_TARGET_SYSROOT})
|
||||||
GET_FILENAME_COMPONENT (DETECTED_SYSROOT $ENV{OECORE_TARGET_SYSROOT} NAME)
|
GET_FILENAME_COMPONENT (DETECTED_SYSROOT $ENV{OECORE_TARGET_SYSROOT} NAME)
|
||||||
@ -181,7 +375,7 @@ if (IPK)
|
|||||||
set (TARGET_ARCH ${DETECTED_ARCH})
|
set (TARGET_ARCH ${DETECTED_ARCH})
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
message (INFO " - Package arch is ${TARGET_ARCH}")
|
message (STATUS "Package arch is ${TARGET_ARCH}")
|
||||||
|
|
||||||
set(CPACK_GENERATOR "DEB")
|
set(CPACK_GENERATOR "DEB")
|
||||||
set(OPKG_ARCH ${TARGET_ARCH})
|
set(OPKG_ARCH ${TARGET_ARCH})
|
||||||
@ -206,8 +400,7 @@ if (IPK)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (RPM)
|
if (RPM)
|
||||||
message (INFO " - RPM packaging enabled for ${DETECTED_ARCH}")
|
message (STATUS "RPM packaging enabled for ${DETECTED_ARCH}")
|
||||||
set(CPACK_PACKAGE_VERSION ${VERSION})
|
|
||||||
set(CPACK_GENERATOR "RPM")
|
set(CPACK_GENERATOR "RPM")
|
||||||
set(CPACK_PACKAGE_NAME "upm")
|
set(CPACK_PACKAGE_NAME "upm")
|
||||||
set(upm_PACKAGE_ON_TAG ".")
|
set(upm_PACKAGE_ON_TAG ".")
|
||||||
@ -231,26 +424,24 @@ if (RPM)
|
|||||||
include(CPack)
|
include(CPack)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILDEXAMPLES)
|
# UPM common headers
|
||||||
add_subdirectory (examples/c++)
|
set (UPM_COMMON_HEADER_DIRS ${CMAKE_HOME_DIRECTORY}/include)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BUILDJAVAEXAMPLES)
|
# Generate a build-only C++ header to add functionality to SWIG'ed modules
|
||||||
add_subdirectory (examples/java)
|
configure_file (${PROJECT_SOURCE_DIR}/cmake/modules/version.hpp.in ${PROJECT_BINARY_DIR}/src/version.hpp @ONLY)
|
||||||
endif()
|
|
||||||
|
|
||||||
if (BUILDSWIGPYTHON OR BUILDTESTS)
|
|
||||||
if (BUILDPYTHON3)
|
|
||||||
set (PYTHONBUILD_VERSION 3)
|
|
||||||
else ()
|
|
||||||
set (PYTHONBUILD_VERSION 2.7)
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
|
# UPM source
|
||||||
add_subdirectory (src)
|
add_subdirectory (src)
|
||||||
|
|
||||||
|
# UPM examples
|
||||||
|
add_subdirectory (examples)
|
||||||
|
|
||||||
|
# Python interp is previously found if BUILDTESTS=ON
|
||||||
if (BUILDTESTS)
|
if (BUILDTESTS)
|
||||||
find_package (PythonInterp ${PYTHONBUILD_VERSION} REQUIRED)
|
|
||||||
enable_testing ()
|
enable_testing ()
|
||||||
add_subdirectory (tests)
|
add_subdirectory (tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Install C headers
|
||||||
|
install(DIRECTORY include/ DESTINATION include/upm
|
||||||
|
FILES_MATCHING PATTERN "*.h")
|
||||||
|
3
LICENSE
@ -1,4 +1,5 @@
|
|||||||
Copyright © 2014-2015 Intel Corporation
|
The MIT License (MIT)
|
||||||
|
Copyright © 2014-2016 Intel Corporation
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
57
README.md
@ -30,36 +30,28 @@ sensors and actuators and provide feedback on interface design.
|
|||||||
A sensor/actuator is expected to work as such (here is the MMA7660 accelerometer API):
|
A sensor/actuator is expected to work as such (here is the MMA7660 accelerometer API):
|
||||||
```C++
|
```C++
|
||||||
// Instantiate an MMA7660 on I2C bus 0
|
// Instantiate an MMA7660 on I2C bus 0
|
||||||
upm::MMA7660 *accel = new upm::MMA7660(MMA7660_I2C_BUS,
|
upm::MMA7660 *accel = new upm::MMA7660(MMA7660_DEFAULT_I2C_BUS,
|
||||||
MMA7660_DEFAULT_I2C_ADDR);
|
MMA7660_DEFAULT_I2C_ADDR);
|
||||||
|
|
||||||
// place device in standby mode so we can write registers
|
// place device in standby mode so we can write registers
|
||||||
accel->setModeStandby();
|
accel->setModeStandby();
|
||||||
|
|
||||||
// enable 64 samples per second
|
// enable 64 samples per second
|
||||||
accel->setSampleRate(upm::MMA7660::AUTOSLEEP_64);
|
accel->setSampleRate(MMA7660_AUTOSLEEP_64);
|
||||||
|
|
||||||
// place device into active mode
|
// place device into active mode
|
||||||
accel->setModeActive();
|
accel->setModeActive();
|
||||||
|
|
||||||
while (shouldRun)
|
while (shouldRun)
|
||||||
{
|
{
|
||||||
int x, y, z;
|
|
||||||
|
|
||||||
accel->getRawValues(&x, &y, &z);
|
|
||||||
cout << "Raw values: x = " << x
|
|
||||||
<< " y = " << y
|
|
||||||
<< " z = " << z
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
float ax, ay, az;
|
float ax, ay, az;
|
||||||
|
|
||||||
accel->getAcceleration(&ax, &ay, &az);
|
accel->getAcceleration(&ax, &ay, &az);
|
||||||
cout << "Acceleration: x = " << ax
|
cout << "Acceleration: x = " << ax
|
||||||
<< "g y = " << ay
|
<< "g y = " << ay
|
||||||
<< "g z = " << az
|
<< "g z = " << az
|
||||||
<< "g" << endl;
|
<< "g" << endl;
|
||||||
|
|
||||||
usleep(500000);
|
usleep(500000);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -73,7 +65,7 @@ Multi-sensor samples for the starter and specialized kits can be found in the
|
|||||||
|
|
||||||
Supported [sensor list](http://iotdk.intel.com/docs/master/upm/modules.html) from API documentation.
|
Supported [sensor list](http://iotdk.intel.com/docs/master/upm/modules.html) from API documentation.
|
||||||
|
|
||||||
You can also refer to the [Intel® IoT Developer Zone](https://software.intel.com/iot/sensors).
|
You can also refer to the [Intel® IoT Developer Zone](https://software.intel.com/iot/hardware/sensors).
|
||||||
|
|
||||||
### IDE Integration
|
### IDE Integration
|
||||||
|
|
||||||
@ -82,30 +74,46 @@ please refer to the Intel Developer Zone IDE page.
|
|||||||
|
|
||||||
<a href="https://software.intel.com/iot/software/ide"><img src="docs/icons/allides.png"/></a>
|
<a href="https://software.intel.com/iot/software/ide"><img src="docs/icons/allides.png"/></a>
|
||||||
|
|
||||||
|
### Installing UPM
|
||||||
|
|
||||||
|
Find notes on how to install UPM on various OS'es on this [page](docs/installing.md).
|
||||||
|
|
||||||
### Building UPM
|
### Building UPM
|
||||||
|
|
||||||
See building documentation [here](docs/building.md).
|
See building documentation [here](docs/building.md).
|
||||||
|
|
||||||
|
[](https://travis-ci.org/intel-iot-devkit/upm)
|
||||||
|
|
||||||
### Making your own UPM module
|
### Making your own UPM module
|
||||||
|
|
||||||
Porting [link](docs/porting.md) has more information on making new UPM modules.
|
A quick way to add a new sensor driver is to port existing code from another
|
||||||
|
platform (e.g. Arduino) and swap the IO calls to the MRAA API. This of course
|
||||||
|
assumes either ownership of the original code or licensing that allows
|
||||||
|
unrestricted redistribution.
|
||||||
|
|
||||||
There is also an example available gfor max31855 [sensor](docs/max31855.md).
|
The [porting](docs/porting.md) section has more information on this process,
|
||||||
|
and there is an example available based on the max31855 [sensor](docs/max31855.md).
|
||||||
|
|
||||||
Guide on creating Java [bindings](docs/creating_java_bindings.md).
|
Read more on creating Java [bindings](docs/creating_java_bindings.md) for your
|
||||||
|
new driver.
|
||||||
|
|
||||||
### Naming conventions and rules for new UPM contributions
|
### Guidelines and rules for new UPM contributions
|
||||||
|
|
||||||
Before you begin development, take a look at our naming [conventions](docs/naming.md).
|
Before you begin development, take a look at our naming [conventions](docs/naming.md).
|
||||||
|
The name you pick for a newly added sensor needs to be unique in the UPM library.
|
||||||
|
|
||||||
Also, please read the guidelines for contributions [to UPM](docs/contributions.md).
|
Then, please go over this short set of rules for new [contributions](docs/contributions.md).
|
||||||
|
|
||||||
Don't forget to check the documentation [section](docs/documentation.md).
|
|
||||||
|
|
||||||
Make sure you add yourself as an author on every new code file submitted.
|
Make sure you add yourself as an author on every new code file submitted.
|
||||||
If you are providing a fix with significant changes, feel free to add yourself
|
If you are providing a fix with significant changes, feel free to add yourself
|
||||||
as a contributor. Signing-off your commits is mandatory.
|
as a contributor. Signing-off your commits is mandatory.
|
||||||
|
|
||||||
|
Documenting your code is also a big part of the task. We have a strict set of
|
||||||
|
tags used to classify our sensors and their capabilities. You can find out more
|
||||||
|
about this in our [section](docs/documentation.md) on documenting a sensor API.
|
||||||
|
Finally, if you really want to ensure consistency with the rest of the library,
|
||||||
|
and the intel-iot-devkit repositories in general, take a look at our extensive
|
||||||
|
[author guide](docs/guidelines.md).
|
||||||
|
|
||||||
API Documentation
|
API Documentation
|
||||||
==============
|
==============
|
||||||
|
|
||||||
@ -120,7 +128,8 @@ our API in a way that will break backwards compatibility. If you find yourself
|
|||||||
unable to compile code that was working fine before a library update, make sure
|
unable to compile code that was working fine before a library update, make sure
|
||||||
you check the [API changes](docs/apichanges.md) section first.
|
you check the [API changes](docs/apichanges.md) section first.
|
||||||
|
|
||||||
**NOTE** - Our **C++ header files** changed extension from *.h* to *.hpp*!
|
**NOTE** - Several important API changes are currently underway for some of our
|
||||||
|
widely used libraries including `libupm-grove` and `libupm-i2clcd`!
|
||||||
|
|
||||||
### Changelog
|
### Changelog
|
||||||
Version changelog [here](docs/changelog.md).
|
Version changelog [here](docs/changelog.md).
|
||||||
|
@ -95,7 +95,7 @@ IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
|
|||||||
# $ dpkg --print-architecture
|
# $ dpkg --print-architecture
|
||||||
FIND_PROGRAM(DPKG_CMD dpkg)
|
FIND_PROGRAM(DPKG_CMD dpkg)
|
||||||
IF(NOT DPKG_CMD)
|
IF(NOT DPKG_CMD)
|
||||||
MESSAGE(STATUS "Can not find dpkg in your path, default to i386.")
|
MESSAGE(WARNING "Can not find dpkg in your path, default to i386.")
|
||||||
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
|
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
|
||||||
ENDIF(NOT DPKG_CMD)
|
ENDIF(NOT DPKG_CMD)
|
||||||
EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
|
EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
|
||||||
|
@ -23,13 +23,16 @@ if (UV_ROOT_DIR)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Now look for node. Flag an error if not found
|
# Now look for node. Flag an error if not found
|
||||||
find_path (NODE_ROOT_DIR "include/node/node.h" "include/src/node.h"
|
find_path (NODE_ROOT_DIR "include/node/node.h" "include/src/node.h" "src/node.h"
|
||||||
PATHS /usr/include/nodejs /usr/local/include/nodejs /usr/local/include)
|
PATHS /usr/include/nodejs /usr/local/include/nodejs /usr/local/include)
|
||||||
if (NODE_ROOT_DIR)
|
if (NODE_ROOT_DIR)
|
||||||
add_include_dir(${NODE_ROOT_DIR}/include/src)
|
add_include_dir(${NODE_ROOT_DIR}/include/src)
|
||||||
|
add_include_dir(${NODE_ROOT_DIR}/src)
|
||||||
add_include_dir(${NODE_ROOT_DIR}/include/node)
|
add_include_dir(${NODE_ROOT_DIR}/include/node)
|
||||||
add_include_dir(${NODE_ROOT_DIR}/include/deps/v8/include)
|
add_include_dir(${NODE_ROOT_DIR}/include/deps/v8/include)
|
||||||
|
add_include_dir(${NODE_ROOT_DIR}/deps/v8/include)
|
||||||
add_include_dir(${NODE_ROOT_DIR}/include/deps/uv/include)
|
add_include_dir(${NODE_ROOT_DIR}/include/deps/uv/include)
|
||||||
|
add_include_dir(${NODE_ROOT_DIR}/deps/uv/include)
|
||||||
else()
|
else()
|
||||||
unset(NODEJS_INCLUDE_DIRS)
|
unset(NODEJS_INCLUDE_DIRS)
|
||||||
message(ERROR " - node.h not found")
|
message(ERROR " - node.h not found")
|
||||||
@ -89,8 +92,8 @@ if (NODEJS_EXECUTABLE)
|
|||||||
endif ()
|
endif ()
|
||||||
string (REGEX REPLACE "\n" "" NODE_VERSION_STRING ${NODE_VERSION_STRING})
|
string (REGEX REPLACE "\n" "" NODE_VERSION_STRING ${NODE_VERSION_STRING})
|
||||||
string (REGEX REPLACE "\n" "" V8_VERSION_STRING ${V8_VERSION_STRING})
|
string (REGEX REPLACE "\n" "" V8_VERSION_STRING ${V8_VERSION_STRING})
|
||||||
message ("INFO - Node version is " ${NODE_VERSION_STRING})
|
message (STATUS "Node version is ${NODE_VERSION_STRING}")
|
||||||
message ("INFO - Node using v8 " ${V8_VERSION_STRING})
|
message (STATUS "Node using v8 ${V8_VERSION_STRING}")
|
||||||
mark_as_advanced (NODEJS_EXECUTABLE)
|
mark_as_advanced (NODEJS_EXECUTABLE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
13
cmake/modules/FindNpm.cmake
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Finding and pointing a variable to the npm executable if found
|
||||||
|
# Only works on Linux systems as of now
|
||||||
|
|
||||||
|
find_program(NPM_EXECUTABLE NAMES npm
|
||||||
|
HINTS
|
||||||
|
/usr
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NPM_EXECUTABLE)
|
||||||
|
message(STATUS "NPM Executable found at ${NPM_EXECUTABLE}")
|
||||||
|
else()
|
||||||
|
message(ERROR "Unable to find NPM installation, please install NPM")
|
||||||
|
endif()
|
@ -23,7 +23,7 @@ if (SPHINX_EXECUTABLE)
|
|||||||
OUTPUT_VARIABLE SPHINX_VERSION)
|
OUTPUT_VARIABLE SPHINX_VERSION)
|
||||||
if(SPHINX_VERSION)
|
if(SPHINX_VERSION)
|
||||||
string(REGEX MATCH "([0-9]\\.[0-9]\\.[0-9])" SPHINX_VERSION_STR ${SPHINX_VERSION})
|
string(REGEX MATCH "([0-9]\\.[0-9]\\.[0-9])" SPHINX_VERSION_STR ${SPHINX_VERSION})
|
||||||
message ("INFO - Sphinx version is " ${SPHINX_VERSION_STR})
|
message (STATUS "Sphinx version is ${SPHINX_VERSION_STR}")
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -14,9 +14,11 @@ find_package_handle_standard_args (Yuidoc DEFAULT_MSG
|
|||||||
# Get Yuidoc version
|
# Get Yuidoc version
|
||||||
if (YUIDOC_EXECUTABLE)
|
if (YUIDOC_EXECUTABLE)
|
||||||
execute_process(COMMAND ${YUIDOC_EXECUTABLE} --version
|
execute_process(COMMAND ${YUIDOC_EXECUTABLE} --version
|
||||||
ERROR_VARIABLE YUIDOC_VERSION)
|
ERROR_VARIABLE YUIDOC_VERSION
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
ERROR_STRIP_TRAILING_WHITESPACE)
|
||||||
if(YUIDOC_VERSION)
|
if(YUIDOC_VERSION)
|
||||||
message ("INFO - Yuidoc version is " ${YUIDOC_VERSION})
|
message (STATUS "Yuidoc version is ${YUIDOC_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
160
cmake/modules/OpenCVDetectPython.cmake
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
# Find specified Python version
|
||||||
|
# Arguments:
|
||||||
|
# preferred_version (value): Version to check for first
|
||||||
|
# min_version (value): Minimum supported version
|
||||||
|
# library_env (value): Name of Python library ENV variable to check
|
||||||
|
# include_dir_env (value): Name of Python include directory ENV variable to check
|
||||||
|
# found (variable): Set if interpreter found
|
||||||
|
# executable (variable): Output of executable found
|
||||||
|
# version_string (variable): Output of found version
|
||||||
|
# version_major (variable): Output of found major version
|
||||||
|
# version_minor (variable): Output of found minor version
|
||||||
|
# libs_found (variable): Set if libs found
|
||||||
|
# libs_version_string (variable): Output of found libs version
|
||||||
|
# libraries (variable): Output of found Python libraries
|
||||||
|
# library (variable): Output of found Python library
|
||||||
|
# debug_libraries (variable): Output of found Python debug libraries
|
||||||
|
# debug_library (variable): Output of found Python debug library
|
||||||
|
# include_path (variable): Output of found Python include path
|
||||||
|
# include_dir (variable): Output of found Python include dir
|
||||||
|
# include_dir2 (variable): Output of found Python include dir2
|
||||||
|
# packages_path (variable): Output of found Python packages path
|
||||||
|
function(find_python preferred_version min_version library_env include_dir_env
|
||||||
|
found executable version_string version_major version_minor
|
||||||
|
libs_found libs_version_string libraries library debug_libraries
|
||||||
|
debug_library include_path include_dir include_dir2 packages_path)
|
||||||
|
if(NOT ${found})
|
||||||
|
if(${executable})
|
||||||
|
set(PYTHON_EXECUTABLE "${${executable}}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(PythonInterp "${preferred_version}")
|
||||||
|
if(NOT PYTHONINTERP_FOUND)
|
||||||
|
find_package(PythonInterp "${min_version}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PYTHONINTERP_FOUND)
|
||||||
|
# Copy outputs
|
||||||
|
set(_found ${PYTHONINTERP_FOUND})
|
||||||
|
set(_executable ${PYTHON_EXECUTABLE})
|
||||||
|
set(_version_string ${PYTHON_VERSION_STRING})
|
||||||
|
set(_version_major ${PYTHON_VERSION_MAJOR})
|
||||||
|
set(_version_minor ${PYTHON_VERSION_MINOR})
|
||||||
|
set(_version_patch ${PYTHON_VERSION_PATCH})
|
||||||
|
|
||||||
|
# Clear find_host_package side effects
|
||||||
|
unset(PYTHONINTERP_FOUND)
|
||||||
|
unset(PYTHON_EXECUTABLE CACHE)
|
||||||
|
unset(PYTHON_VERSION_STRING)
|
||||||
|
unset(PYTHON_VERSION_MAJOR)
|
||||||
|
unset(PYTHON_VERSION_MINOR)
|
||||||
|
unset(PYTHON_VERSION_PATCH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(_found)
|
||||||
|
set(_version_major_minor "${_version_major}.${_version_minor}")
|
||||||
|
|
||||||
|
if(NOT ANDROID AND NOT APPLE_FRAMEWORK)
|
||||||
|
# not using _version_string here, because it might not conform to the CMake version format
|
||||||
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
# builder version can differ from target, matching base version (e.g. 2.7)
|
||||||
|
find_package(PythonLibs "${_version_major_minor}")
|
||||||
|
else()
|
||||||
|
find_package(PythonLibs "${_version_major_minor}.${_version_patch}" EXACT)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PYTHONLIBS_FOUND)
|
||||||
|
# Copy outputs
|
||||||
|
set(_libs_found ${PYTHONLIBS_FOUND})
|
||||||
|
set(_libraries ${PYTHON_LIBRARIES})
|
||||||
|
set(_include_path ${PYTHON_INCLUDE_PATH})
|
||||||
|
set(_include_dirs ${PYTHON_INCLUDE_DIRS})
|
||||||
|
set(_debug_libraries ${PYTHON_DEBUG_LIBRARIES})
|
||||||
|
set(_libs_version_string ${PYTHONLIBS_VERSION_STRING})
|
||||||
|
set(_debug_library ${PYTHON_DEBUG_LIBRARY})
|
||||||
|
set(_library ${PYTHON_LIBRARY})
|
||||||
|
set(_library_debug ${PYTHON_LIBRARY_DEBUG})
|
||||||
|
set(_library_release ${PYTHON_LIBRARY_RELEASE})
|
||||||
|
set(_include_dir ${PYTHON_INCLUDE_DIR})
|
||||||
|
set(_include_dir2 ${PYTHON_INCLUDE_DIR2})
|
||||||
|
|
||||||
|
# Clear find_package side effects
|
||||||
|
unset(PYTHONLIBS_FOUND)
|
||||||
|
unset(PYTHON_LIBRARIES)
|
||||||
|
unset(PYTHON_INCLUDE_PATH)
|
||||||
|
unset(PYTHON_INCLUDE_DIRS)
|
||||||
|
unset(PYTHON_DEBUG_LIBRARIES)
|
||||||
|
unset(PYTHONLIBS_VERSION_STRING)
|
||||||
|
unset(PYTHON_DEBUG_LIBRARY CACHE)
|
||||||
|
unset(PYTHON_LIBRARY)
|
||||||
|
unset(PYTHON_LIBRARY_DEBUG)
|
||||||
|
unset(PYTHON_LIBRARY_RELEASE)
|
||||||
|
unset(PYTHON_LIBRARY CACHE)
|
||||||
|
unset(PYTHON_LIBRARY_DEBUG CACHE)
|
||||||
|
unset(PYTHON_LIBRARY_RELEASE CACHE)
|
||||||
|
unset(PYTHON_INCLUDE_DIR CACHE)
|
||||||
|
unset(PYTHON_INCLUDE_DIR2 CACHE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND ${_executable} -c "from distutils.sysconfig import *; print(get_python_lib())"
|
||||||
|
RESULT_VARIABLE _cvpy_process
|
||||||
|
OUTPUT_VARIABLE _std_packages_path
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if("${_std_packages_path}" MATCHES "site-packages")
|
||||||
|
set(_packages_path "python${_version_major_minor}/site-packages")
|
||||||
|
else() #debian based assumed, install to the dist-packages.
|
||||||
|
set(_packages_path "python${_version_major_minor}/dist-packages")
|
||||||
|
endif()
|
||||||
|
if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${${packages_path}}")
|
||||||
|
set(_packages_path "lib${LIB_SUFFIX}/${_packages_path}")
|
||||||
|
else()
|
||||||
|
set(_packages_path "lib/${_packages_path}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Export return values
|
||||||
|
set(${found} "${_found}" CACHE INTERNAL "")
|
||||||
|
set(${executable} "${_executable}" CACHE FILEPATH "Path to Python interpretor")
|
||||||
|
set(${version_string} "${_version_string}" CACHE INTERNAL "")
|
||||||
|
set(${version_major} "${_version_major}" CACHE INTERNAL "")
|
||||||
|
set(${version_minor} "${_version_minor}" CACHE INTERNAL "")
|
||||||
|
set(${libs_found} "${_libs_found}" CACHE INTERNAL "")
|
||||||
|
set(${libs_version_string} "${_libs_version_string}" CACHE INTERNAL "")
|
||||||
|
set(${libraries} "${_libraries}" CACHE INTERNAL "Python libraries")
|
||||||
|
set(${library} "${_library}" CACHE FILEPATH "Path to Python library")
|
||||||
|
set(${debug_libraries} "${_debug_libraries}" CACHE INTERNAL "")
|
||||||
|
set(${debug_library} "${_debug_library}" CACHE FILEPATH "Path to Python debug")
|
||||||
|
set(${include_path} "${_include_path}" CACHE INTERNAL "")
|
||||||
|
set(${include_dir} "${_include_dir}" CACHE PATH "Python include dir")
|
||||||
|
set(${include_dir2} "${_include_dir2}" CACHE PATH "Python include dir 2")
|
||||||
|
set(${packages_path} "${_packages_path}" CACHE PATH "Where to install the python packages.")
|
||||||
|
endif()
|
||||||
|
endfunction(find_python)
|
||||||
|
|
||||||
|
set(MIN_VER_PYTHON2 2.7)
|
||||||
|
set(MIN_VER_PYTHON3 3.2)
|
||||||
|
|
||||||
|
find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
|
||||||
|
PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING
|
||||||
|
PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND
|
||||||
|
PYTHON2LIBS_VERSION_STRING PYTHON2_LIBRARIES PYTHON2_LIBRARY
|
||||||
|
PYTHON2_DEBUG_LIBRARIES PYTHON2_LIBRARY_DEBUG PYTHON2_INCLUDE_PATH
|
||||||
|
PYTHON2_INCLUDE_DIR PYTHON2_INCLUDE_DIR2 PYTHON2_PACKAGES_PATH)
|
||||||
|
|
||||||
|
find_python(3 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
|
||||||
|
PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING
|
||||||
|
PYTHON3_VERSION_MAJOR PYTHON3_VERSION_MINOR PYTHON3LIBS_FOUND
|
||||||
|
PYTHON3LIBS_VERSION_STRING PYTHON3_LIBRARIES PYTHON3_LIBRARY
|
||||||
|
PYTHON3_DEBUG_LIBRARIES PYTHON3_LIBRARY_DEBUG PYTHON3_INCLUDE_PATH
|
||||||
|
PYTHON3_INCLUDE_DIR PYTHON3_INCLUDE_DIR2 PYTHON3_PACKAGES_PATH)
|
||||||
|
|
||||||
|
if(PYTHON_DEFAULT_EXECUTABLE)
|
||||||
|
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
|
||||||
|
elseif(PYTHON2INTERP_FOUND) # Use Python 2 as default Python interpreter
|
||||||
|
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
|
||||||
|
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}")
|
||||||
|
elseif(PYTHON3INTERP_FOUND) # Use Python 2 as fallback Python interpreter (if there is no Python 2)
|
||||||
|
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
|
||||||
|
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON3_EXECUTABLE}")
|
||||||
|
endif()
|
@ -1,4 +0,0 @@
|
|||||||
#include "version.h"
|
|
||||||
|
|
||||||
const char* gVERSION = "@VERSION@";
|
|
||||||
const char* gVERSION_SHORT = "@VERSION_SHORT@";
|
|
6
cmake/modules/version.hpp.in
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include <string>
|
||||||
|
|
||||||
|
inline std::string getVersion()
|
||||||
|
{
|
||||||
|
return "@upm_VERSION_STRING@";
|
||||||
|
}
|
112
docker-compose.yaml
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
version: '2.1'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
base:
|
||||||
|
image: dnoliver/upm-base
|
||||||
|
environment:
|
||||||
|
- http_proxy
|
||||||
|
- https_proxy
|
||||||
|
- no_proxy
|
||||||
|
- BUILDDOC=${BUILDDOC:-OFF}
|
||||||
|
- BUILDCPP=${BUILDCPP:-ON}
|
||||||
|
- BUILDFTI=${BUILDFTI:-ON}
|
||||||
|
- BUILDSWIGPYTHON=${BUILDSWIGPYTHON:-OFF}
|
||||||
|
- BUILDSWIGJAVA=${BUILDSWIGJAVA:-OFF}
|
||||||
|
- BUILDSWIGNODE=${BUILDSWIGNODE:-OFF}
|
||||||
|
- BUILDEXAMPLES=${BUILDEXAMPLES:-ON}
|
||||||
|
- IPK=${IPK:-OFF}
|
||||||
|
- RPM=${RPM:-OFF}
|
||||||
|
- NPM=${NPM:-OFF}
|
||||||
|
- BUILDTESTS=${BUILDTESTS:-ON}
|
||||||
|
- CC=${CC:-clang-3.8}
|
||||||
|
- CXX=${CXX:-clang++-3.8}
|
||||||
|
- NODE_VERSION=${NODE_VERSION:-v4.4.7}
|
||||||
|
- WERROR=${WERROR:-ON}
|
||||||
|
volumes:
|
||||||
|
- .:${UPM_SRC_DIR:-/usr/src/app}
|
||||||
|
|
||||||
|
doc:
|
||||||
|
extends: base
|
||||||
|
image: dnoliver/upm-all
|
||||||
|
environment:
|
||||||
|
- BUILDSWIGPYTHON=ON
|
||||||
|
- BUILDSWIGJAVA=ON
|
||||||
|
- BUILDSWIGNODE=ON
|
||||||
|
- BUILDDOC=ON
|
||||||
|
command: bash -c "./scripts/run-cmake.sh && ./scripts/build-doc.sh"
|
||||||
|
|
||||||
|
ipk:
|
||||||
|
extends: base
|
||||||
|
environment:
|
||||||
|
- IPK=ON
|
||||||
|
- BUILDDOC=OFF
|
||||||
|
command: bash -c "./scripts/run-cmake.sh && make -Cbuild -j8 package"
|
||||||
|
|
||||||
|
rpm:
|
||||||
|
extends: doc
|
||||||
|
environment:
|
||||||
|
- RPM=ON
|
||||||
|
- BUILDDOC=OFF
|
||||||
|
command: bash -c "./scripts/run-cmake.sh && make -Cbuild -j8 package"
|
||||||
|
|
||||||
|
npm:
|
||||||
|
extends: doc
|
||||||
|
environment:
|
||||||
|
- NPM=ON
|
||||||
|
- BUILDDOC=OFF
|
||||||
|
command: bash -c "./scripts/run-cmake.sh && make -Cbuild -j8 npmpkg"
|
||||||
|
|
||||||
|
sonar-scan:
|
||||||
|
extends: base
|
||||||
|
image: dnoliver/upm-all
|
||||||
|
environment:
|
||||||
|
- BUILDSWIGPYTHON=ON
|
||||||
|
- BUILDSWIGNODE=ON
|
||||||
|
- BUILDSWIGJAVA=ON
|
||||||
|
- BUILDSWIGEXAMPLES=ON
|
||||||
|
- SONAR_TOKEN
|
||||||
|
- SONAR_ORG
|
||||||
|
- SONAR_PROJ_KEY
|
||||||
|
- TRAVIS_BRANCH
|
||||||
|
- TRAVIS_PULL_REQUEST
|
||||||
|
- TRAVIS_REPO_SLUG
|
||||||
|
- TRAVIS_PULL_REQUEST_SLUG
|
||||||
|
- GITHUB_TOKEN
|
||||||
|
command: bash -c "./scripts/run-cmake.sh && cd build && ../scripts/sonar-scan.sh"
|
||||||
|
|
||||||
|
python:
|
||||||
|
extends: base
|
||||||
|
image: dnoliver/upm-python
|
||||||
|
environment:
|
||||||
|
- BUILDSWIGPYTHON=ON
|
||||||
|
command: bash -c "./scripts/run-cmake.sh && cd build && make -j8 && make -j8 install && ldconfig && ctest --output-on-failure"
|
||||||
|
|
||||||
|
java:
|
||||||
|
extends: base
|
||||||
|
image: dnoliver/upm-java
|
||||||
|
environment:
|
||||||
|
- BUILDSWIGJAVA=ON
|
||||||
|
command: bash -c "./scripts/run-cmake.sh && cd build && make -j8 && make -j8 install && ldconfig && ctest --output-on-failure"
|
||||||
|
|
||||||
|
android:
|
||||||
|
extends: java
|
||||||
|
image: dnoliver/upm-android
|
||||||
|
environment:
|
||||||
|
- BUILDTESTS=OFF
|
||||||
|
command: bash -c "./scripts/build-android.sh"
|
||||||
|
|
||||||
|
node4:
|
||||||
|
extends: base
|
||||||
|
image: dnoliver/upm-node4
|
||||||
|
environment:
|
||||||
|
- BUILDSWIGNODE=ON
|
||||||
|
command: bash -c "./scripts/run-cmake.sh && cd build && make -j8 && make -j8 install && ldconfig && ctest --output-on-failure -E examplenames_js"
|
||||||
|
|
||||||
|
node5:
|
||||||
|
extends: node4
|
||||||
|
image: dnoliver/upm-node5
|
||||||
|
|
||||||
|
node6:
|
||||||
|
extends: node4
|
||||||
|
image: dnoliver/upm-node6
|
@ -4,12 +4,239 @@ API Changes {#apichanges}
|
|||||||
Here's a list of other API changes made to the library that break source/binary
|
Here's a list of other API changes made to the library that break source/binary
|
||||||
compatibility between releases:
|
compatibility between releases:
|
||||||
|
|
||||||
|
# v1.3.0
|
||||||
|
|
||||||
|
* **The lsm303 driver has been renamed** There are a variety of
|
||||||
|
LSM303 devices out there with various incompatibilities and differing
|
||||||
|
capabilities. The current lsm303 driver in UPM only supports the
|
||||||
|
LSM303DLH variant, so it has been renamed to lsm303dlh to avoid
|
||||||
|
confusion and to make it clear which variant is actually supported.
|
||||||
|
|
||||||
|
All examples and source files have been renamed, including header
|
||||||
|
files. In addition, the class name, LSM303, has been renamed to
|
||||||
|
LSM303DLH. No other functionality or behavior has been changed.
|
||||||
|
|
||||||
|
# v1.2.0
|
||||||
|
|
||||||
|
* **Note for all drivers ported to C** As a general note concerning
|
||||||
|
all of the drivers that have been ported to C: **external constants
|
||||||
|
have likely been renamed**. Previously in C++, most of these constants
|
||||||
|
were defined as enums in the *upm::classname* namespace.
|
||||||
|
|
||||||
|
For drivers written in C, all of these constants are no longer in
|
||||||
|
a class (or UPM) namespace, and instead have the driver name
|
||||||
|
prefixed to the original value.
|
||||||
|
|
||||||
|
The driver name is prefixed to these constants to avoid name
|
||||||
|
collisions when using multiple drivers in a given application, and
|
||||||
|
to make it clear which constants belong to which driver.
|
||||||
|
|
||||||
|
For drivers that used *#define* for constants, only the prefix has
|
||||||
|
been added if not already present. In some cases, names that were
|
||||||
|
not very descriptive were changed, for example *ADDR* renamed to
|
||||||
|
*BMPX8X_DEFAULT_I2C_ADDR*.
|
||||||
|
|
||||||
|
So for example, a constant that might once have been referred to
|
||||||
|
in a C++ example as *upm::MMA7660::AUTOSLEEP_64*, would now be
|
||||||
|
referenced as *MMA7660_AUTOSLEEP_64*.
|
||||||
|
|
||||||
|
This holds true for most, if not all drivers that have been ported
|
||||||
|
to C. Not all of these changes are listed in this file due to the
|
||||||
|
sheer number of them.
|
||||||
|
|
||||||
|
If you run into problems with constants that were working
|
||||||
|
previously, and now cannot be found, this is likely the reason.
|
||||||
|
Check the driver documentation and the source code to see what the
|
||||||
|
new name is.
|
||||||
|
|
||||||
|
In C, constants are now usually implemented in a separate header
|
||||||
|
file named *drivername_defs.h* or *drivername_regs.h*, for easier
|
||||||
|
integration into the SWIG languages, and shared use between C++ and
|
||||||
|
C implementations.
|
||||||
|
|
||||||
|
* **bmpx8x** This driver has been rewritten from scratch in C, with a
|
||||||
|
C++ wrapper.
|
||||||
|
|
||||||
|
All exported symbols have been renamed for consistency and to
|
||||||
|
avoid symbol collisions by having a *BMPX8X_* prefix. As an example,
|
||||||
|
*ADDR* has been renamed to *BMPX8X_DEFAULT_I2C_ADDR*. Most C
|
||||||
|
ported drivers follow this rule.
|
||||||
|
|
||||||
|
The *getPressureRaw()* and *getTemperatureRaw()* functions have
|
||||||
|
been removed. This functionality was only needed internally to
|
||||||
|
the driver.
|
||||||
|
|
||||||
|
The constructor no longer accepts a mode argument. Only the I2C
|
||||||
|
bus and I2C address are accepted. By default, the device will be
|
||||||
|
configured for it's maximum resolution *BMPX8X_OSS_ULTRAHIGHRES*,
|
||||||
|
the previous default. You can use the new method
|
||||||
|
*setOversampling()* to change the mode to something else if
|
||||||
|
desired.
|
||||||
|
|
||||||
|
The methods related to calibration, like *computeB5()* are no
|
||||||
|
longer exposed.
|
||||||
|
|
||||||
|
New methods, *init()* and *reset()* have been added. *reset()*
|
||||||
|
resets the device to a freshly powered up state. *init()* can be
|
||||||
|
used to re-initialize the device after a reset (reload calibration
|
||||||
|
data) and set a default oversampling mode.
|
||||||
|
|
||||||
|
A new method, *update()* has been added. This method will update
|
||||||
|
all internal state from the device, and **must** be called before
|
||||||
|
querying the pressure, temperature, sea level and altitude values.
|
||||||
|
|
||||||
|
The *getSeaLevelPressure()* method has been split into two
|
||||||
|
overloaded methods. One which **requires** an argument in meters
|
||||||
|
(previously, a default was provided), and another which does not
|
||||||
|
accept arguments at all and computes the sea level pressure based
|
||||||
|
on current altitude.
|
||||||
|
|
||||||
|
The *i2cReadReg_16()*, *i2CWriteReg()* and *i2cReadReg_8()* have
|
||||||
|
been replaced with *readReg()*, *readRegs()*, and *writeReg()*, in
|
||||||
|
line with other I2C/SPI drivers of this type. They are marked
|
||||||
|
protected (in C++) now as well. Please see the updated
|
||||||
|
documentation and examples for this driver.
|
||||||
|
|
||||||
|
* **mma7660** This driver has been rewritten in C. Some exported
|
||||||
|
symbols have been changed, for example, *MMA7660_I2C_BUS* was renamed
|
||||||
|
to *MMA7660_DEFAULT_I2C_BUS*.
|
||||||
|
|
||||||
|
See updated documentation and examples for other changes.
|
||||||
|
|
||||||
|
* **bmx055, bmi055, bmc150, bma250e, bmg160, bmm150** This driver has
|
||||||
|
been split up. The *bma250e*, *bmg160*, *bmm150* drivers have been
|
||||||
|
rewritten in C (with C++ wrappers) and now reside in their own
|
||||||
|
libraries. The versions of these drivers that used to be present in
|
||||||
|
*bmx055* have been removed, and *bmx055* now uses the new libraries
|
||||||
|
for it's functionality. The other two composite devices, *bmi055*,
|
||||||
|
and *bmc150* are still contained within the *bmx055* library, and
|
||||||
|
also use the new libraries for their functionality.
|
||||||
|
|
||||||
|
In addition, for all of these drivers some private methods are no
|
||||||
|
longer exposed (such as the compensation routines).
|
||||||
|
|
||||||
|
The C++ driver methods that once returned pointers to a floating
|
||||||
|
point array now return *std::vectors* of the appropriate type.
|
||||||
|
The SWIG language examples for these drivers have been modified to
|
||||||
|
use these methods instead of the C pointer based SWIG methods
|
||||||
|
previously used.
|
||||||
|
|
||||||
|
* **sainsmartks** This driver has been renamed to *lcdks* (LCD Keypad
|
||||||
|
Shield) and moved into it's own library. It uses the *lcm1602*
|
||||||
|
library to do most of it's work. In addition, an additional argument
|
||||||
|
was added to the constructor to optionally allow specifying a GPIO
|
||||||
|
pin to be used to control the backlight. This driver supports the
|
||||||
|
SainsmartKS and DFRobot LCD Keypad Shields. Similar devices from
|
||||||
|
other manufacturers should also work with this driver.
|
||||||
|
|
||||||
|
* **lcm1602/jhd1313m1** These drivers had been rewritten in C, with
|
||||||
|
C++ wrappers and placed into their own libraries in the previous
|
||||||
|
version of UPM, however, the original C++ implementation was kept in
|
||||||
|
the lcd/i2clcd library for compatibility reasons with existing code.
|
||||||
|
To avoid collisions with the header files, the new *lcm1602* and
|
||||||
|
*jhd1313m1* drivers had their C++ headers renamed to use a **.hxx**
|
||||||
|
suffix.
|
||||||
|
|
||||||
|
In this version of UPM, the *lcm1602* and *jhd1313m1* drivers have
|
||||||
|
been removed from the lcd/i2clcd library. In addition, the header
|
||||||
|
files for the new implementation have been renamed from their
|
||||||
|
**.hxx** suffix to the normal **.hpp** suffix.
|
||||||
|
|
||||||
|
A change was also made to the new *lcm1602* and *jhd1313m1* C++
|
||||||
|
drivers. The *createChar()* function now accepts a byte vector
|
||||||
|
*std::vector<uint8_t>* rather than the *char ** pointer that was
|
||||||
|
used previously. This should make it easier to use with the SWIG
|
||||||
|
language bindings (Python, JavaScript, and especially Java).
|
||||||
|
|
||||||
|
* **bmp280/bme280** Some private methods are no longer exposed (such
|
||||||
|
as the calibration and compensation routines). In addition,
|
||||||
|
the *getHumidity()* method no longer accepts an argument representing
|
||||||
|
pressure at sea level. A separate method is provided to set this now.
|
||||||
|
|
||||||
|
* **bno055** This module no longer uses std::strings to pass around
|
||||||
|
binary data (*read/writeCalibrationData()*). Rather, now *std::vectors* of
|
||||||
|
the appropriate type are used. In addition, methods that previously
|
||||||
|
returned certain data in the form of an array, like *getEulerAngles()*,
|
||||||
|
now return a *std::vector* instead. This simplifies the Python,
|
||||||
|
JavaScript, and Java bindings considerably, and leads to more
|
||||||
|
"natural" looking Python/JavaScript/Java code. For JavaScript, Java,
|
||||||
|
and Python, the examples have been modified to use these methods
|
||||||
|
rather than the methods that return data in argument pointers or
|
||||||
|
arrays.
|
||||||
|
|
||||||
|
* **lpd8806** The constructor for this driver was updated to allow specifying
|
||||||
|
a SPI bus number. This is now the first parameter, the number of LEDs on the
|
||||||
|
strip is now the last (3rd) parameter instead.
|
||||||
|
|
||||||
|
* **max31723** The constructor for this driver was updated to allow specifying
|
||||||
|
a SPI bus number. This is now the first parameter, CS pin second.
|
||||||
|
|
||||||
|
* **tcs3414cs** The constructor for this can now accept an I2C bus and
|
||||||
|
address.
|
||||||
|
|
||||||
|
# v1.1.0 and prior
|
||||||
|
|
||||||
|
* **i2clcd/jhd1313m1/lcm1602** LCD devices supported by the i2clcd module are
|
||||||
|
being separated into individual libraries. The APIs will be preserved, but
|
||||||
|
we recommend changing your code to use the new libraries as they become
|
||||||
|
available. Once this transition is complete, the i2clcd module will be
|
||||||
|
deprecated. So far, the following libraries have been made available
|
||||||
|
separately: jhd1313m1, lcm1602.
|
||||||
|
|
||||||
|
* **nunchuck** This driver no longer supports the init() function.
|
||||||
|
All initialization is now done in the C nunchuck_init() function,
|
||||||
|
or the C++ constructor. In addition, the *NUNCHUCK_I2C_ADDR*
|
||||||
|
define is no longer exposed, as it is not possible to use any other
|
||||||
|
I2C address than *0x52*. The readBytes() and writeByte() functions
|
||||||
|
are also no longer exposed, since aside from what the driver does
|
||||||
|
to initialize and read data, there are no other options available.
|
||||||
|
|
||||||
|
* **enc03r** This driver no longer supports the value() function. In
|
||||||
|
addition, an update() function has been added. This function must be
|
||||||
|
called prior to calling angularVelocity(). angularVelocity() no
|
||||||
|
longer accepts an argument. Additional functions have been added,
|
||||||
|
however they do not affect compatibility with previous versions.
|
||||||
|
|
||||||
|
* **ds18b20** The C++ interface init() function has been deprecated.
|
||||||
|
It is still present, but currently does nothing. It will be removed
|
||||||
|
in a future release.
|
||||||
|
|
||||||
|
* **grove<name>** Starting with UPM 1.0 the Grove libraries have been renamed
|
||||||
|
from *upm-grove<name>* to simply *upm-<name>*. Class names also match this new
|
||||||
|
format, with old classes marked as deprecated throughout the documentation.
|
||||||
|
List of affected libraries: grovecollision, groveehr, groveeldriver,
|
||||||
|
groveelectromagnet, groveemg, grovegprs, grovegsr, grovelinefinder, grovemd,
|
||||||
|
grovemoisture, groveo2, grovescam, grovespeaker, groveultrasonic, grovevdiv,
|
||||||
|
grovewater, grovewfs.
|
||||||
|
|
||||||
|
* **grove** As of UPM 1.0 the Grove classes for sensors in the starter kit are
|
||||||
|
being separated into individual libraries. The old classes will be deprecated
|
||||||
|
over time and eventually removed. Corresponding libraries have the grove
|
||||||
|
prefix removed. Affected classes are GroveButton, GroveLed, GroveLight,
|
||||||
|
GroveRelay, GroveRotary, GroveSlide and GroveTemp.
|
||||||
|
|
||||||
|
* The **ublox6** driver has been replaced with a generic implementation called
|
||||||
|
nmea_gps as of UPM 1.0. This driver should handle all generic serial GPS
|
||||||
|
devices that output NMEA data going forward. This new driver has been tested
|
||||||
|
with ublox6, DFRobot VK2828U7 (ublox7) and ublox LEA-6H GPS devices.
|
||||||
|
|
||||||
|
* **grove** Binary compatibility was broken for the GroveTemp class as of UPM
|
||||||
|
v0.7.3. C++ code using this class has to be recompiled.
|
||||||
|
|
||||||
|
* There were frequent misspellings of the word *Celsius* in the UPM
|
||||||
|
code. In some cases, these were in method names, which will cause
|
||||||
|
some API compatibility issues. These have all been corrected for UPM
|
||||||
|
versions after v.0.7.2.
|
||||||
|
|
||||||
* Our **C++ header files** changed their extension from *.h* to *.hpp* in
|
* Our **C++ header files** changed their extension from *.h* to *.hpp* in
|
||||||
version 0.7.0, Intel provided examples and code samples also reflect this
|
version 0.7.0, Intel provided examples and code samples also reflect this
|
||||||
change but you will need to modify your `#include` directives in existing code
|
change but you will need to modify your `#include` directives in existing
|
||||||
|
code.
|
||||||
|
|
||||||
* **my9221**, **groveledbar** and **grovecircularled** are now all part of the
|
* **my9221**, **groveledbar** and **grovecircularled** are now all part of the
|
||||||
same library (my9221) and new functionality was added going to v.0.5.1
|
same library (my9221) and new functionality was added going to v.0.5.1.
|
||||||
* **stepmotor** driver API was changed significantly from v.0.4.1 to v.0.5.0
|
|
||||||
|
* **stepmotor** driver API was changed significantly from v.0.4.1 to v.0.5.0.
|
||||||
|
|
||||||
* **eboled** library was greatly improved in version 0.4.0 and the `draw()`
|
* **eboled** library was greatly improved in version 0.4.0 and the `draw()`
|
||||||
function was removed in favor of a more complete GFX library implementation
|
function was removed in favor of a more complete GFX library implementation.
|
||||||
|
|
||||||
|
129
docs/building.md
@ -5,10 +5,21 @@ UPM uses cmake in order to make compilation relatively painless. Cmake runs
|
|||||||
build out of tree so the recommended way is to clone from git and make a build/
|
build out of tree so the recommended way is to clone from git and make a build/
|
||||||
directory.
|
directory.
|
||||||
|
|
||||||
|
**Dependencies**
|
||||||
|
* basic: libmraa, cmake, swig, pkgconfig, pthreads, librt
|
||||||
|
* bindings: python-dev, nodejs-dev, openjdk
|
||||||
|
* documentation: doxygen, graphviz, sphinx, yuidoc
|
||||||
|
* sensor specific: bacnet-mstp, modbus, openzwave, jpeg
|
||||||
|
|
||||||
This project depends on libmraa, so that needs to be installed first. Append
|
This project depends on libmraa, so that needs to be installed first. Append
|
||||||
the install location of mraa pkgconfig to the following environment variable:
|
the install location of mraa pkgconfig to the following environment variable:
|
||||||
|
|
||||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:.../mraa/build/lib/pkgconfig
|
~~~~~~~~~~~~~
|
||||||
|
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:.../mraa/build/lib/pkgconfig
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
If you are building the Java or Node.js bindings make sure you set the
|
||||||
|
`JAVA_HOME` and `NODE_PATH` environment variables respectively.
|
||||||
|
|
||||||
UPM will attempt to build all directories inside src/ and they must contain
|
UPM will attempt to build all directories inside src/ and they must contain
|
||||||
individual CMakeLists.txt files.
|
individual CMakeLists.txt files.
|
||||||
@ -45,6 +56,10 @@ Cross-compiling on a different system:
|
|||||||
-DCMAKE_CXX_FLAGS:STRING=-m32 -march=i586
|
-DCMAKE_CXX_FLAGS:STRING=-m32 -march=i586
|
||||||
-DCMAKE_C_FLAGS:STRING=-m32 -march=i586
|
-DCMAKE_C_FLAGS:STRING=-m32 -march=i586
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
Enabling Java module building
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
-DBUILDSWIGJAVA=ON
|
||||||
|
~~~~~~~~~~~~~
|
||||||
Building with an older version of swig (swig 2.0+) requires the disabling of javascript:
|
Building with an older version of swig (swig 2.0+) requires the disabling of javascript:
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DBUILDSWIGNODE=OFF
|
-DBUILDSWIGNODE=OFF
|
||||||
@ -57,20 +72,20 @@ Setting the python library to use:
|
|||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.so.1.0
|
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.so.1.0
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
Building doxygen doc
|
Building documentation
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DBUILDDOC=ON
|
-DBUILDDOC=ON
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
Build C++ example binaries
|
Build C/C++/JAVA examples
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
-DBUILDEXAMPLES=ON
|
-DBUILDEXAMPLES=ON
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you intend to turn on all the options and build everything at once (C++,
|
If you intend to turn on all the options and build everything at once
|
||||||
Node, Python and Documentation) you will have to edit the src/doxy2swig.py file
|
(C++, Java, Node, Python and Documentation) you will have to edit the
|
||||||
and change the line endings from Windows style to Linux format. This has to be
|
src/doxy2swig.py file and change the line endings from Windows style to Linux
|
||||||
repeated every time to sync with the master branch since our Github repository
|
format. This has to be repeated every time to sync with the master branch since
|
||||||
stores files using CR LF line breaks.
|
our Github repository stores files using CR LF line breaks.
|
||||||
|
|
||||||
You can also generate the include and lib directories containing all the sensor
|
You can also generate the include and lib directories containing all the sensor
|
||||||
headers and library files respectively with *make install*. Further, you may
|
headers and library files respectively with *make install*. Further, you may
|
||||||
@ -111,3 +126,101 @@ autotools on linux.
|
|||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
pkg-config --cflags --libs upm-i2clcd
|
pkg-config --cflags --libs upm-i2clcd
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
||||||
|
## Building with Docker
|
||||||
|
|
||||||
|
You can use `docker` and `docker-compose` to generate a complete build environment
|
||||||
|
for upm without having to install any other tool.
|
||||||
|
|
||||||
|
Requirements:
|
||||||
|
* [docker](https://www.docker.com/get-docker) >= 1.12.6
|
||||||
|
* [docker-compose](https://docs.docker.com/compose/install/) >= 1.9.0
|
||||||
|
|
||||||
|
**NOTE:** docker-compose is an optional requirement. It actually make running complex
|
||||||
|
docker build and run command easier. But you can just use docker to build and run.
|
||||||
|
|
||||||
|
### Using Docker Images to build Upm
|
||||||
|
|
||||||
|
**tl;dr:** Just use this commands to build upm:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Build upm documentation
|
||||||
|
$ docker-compose run doc
|
||||||
|
# Build upm python2 and python3 packages and run python tests
|
||||||
|
$ docker-compose run python
|
||||||
|
# Build upm java package and run java tests
|
||||||
|
$ docker-compose run java
|
||||||
|
# Build upm node4 package and run node tests
|
||||||
|
$ docker-compose run node4
|
||||||
|
# Build upm node5 package and run node tests
|
||||||
|
$ docker-compose run node5
|
||||||
|
# Build upm node6 package and run node tests
|
||||||
|
$ docker-compose run node6
|
||||||
|
# Build upm for android things package
|
||||||
|
$ docker-compose run android
|
||||||
|
```
|
||||||
|
|
||||||
|
**docker-compose** will take a look at the `docker-compose.yaml` file in the repository
|
||||||
|
root directory, and run an specific command to build upm for the requested target.
|
||||||
|
Once the build is completed, you will have a `build/` folder in the repository root with all
|
||||||
|
the compiled code. This `build/` folder is created by using a docker volume. The `build\`
|
||||||
|
folder contents is reused each time you execute `docker-compose run [TARGET]`.
|
||||||
|
To know more about volumes in Docker, visit the [Docker Volume Documentation](https://docs.docker.com/engine/tutorials/dockervolumes/).
|
||||||
|
|
||||||
|
You can also start an interactive session inside the docker container if you need to run some
|
||||||
|
custom build commands:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Start an interactive bash shell inside the container
|
||||||
|
$ docker-compose run python bash
|
||||||
|
# From now, all the commands are executed inside the container
|
||||||
|
$ cd build && cmake -DBUILDSWIGPYTHON=ON .. && make clean all
|
||||||
|
```
|
||||||
|
|
||||||
|
If you don't want to use docker-compose, you can also use `docker run` to build upm.
|
||||||
|
For example, to build upm for python, you can do:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# From the repository root folder
|
||||||
|
$ docker run \
|
||||||
|
--volume=$(pwd):/usr/src/app \
|
||||||
|
--env BUILDSWIGPYTHON=ON \
|
||||||
|
--env BUILDSWIGJAVA=OFF \
|
||||||
|
--env BUILDSWIGNODE=OFF \
|
||||||
|
dnoliver/upm-python \
|
||||||
|
bash -c "./scripts/run-cmake.sh && make -Cbuild"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Proxy considerations
|
||||||
|
|
||||||
|
If, for some reason, you are behind a proxy, find below a list of common problems related
|
||||||
|
to proxy settings:
|
||||||
|
|
||||||
|
**docker cannot pull images from docker.io**
|
||||||
|
|
||||||
|
Visit [this link](https://docs.docker.com/engine/admin/systemd/#httphttps-proxy)
|
||||||
|
to configure docker daemon behind a proxy.
|
||||||
|
|
||||||
|
**docker run fails to access the internet**
|
||||||
|
|
||||||
|
docker-compose will automatically take `http_proxy`, `https_proxy`, and `no_proxy`
|
||||||
|
environment variables and use it as build arguments. Be sure to properly configure
|
||||||
|
this variables before building.
|
||||||
|
|
||||||
|
docker, unlinke docker-compose, do not take the proxy settings from the environment
|
||||||
|
automatically. You need to send them as environment arguments:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# From the repository root folder
|
||||||
|
$ docker run \
|
||||||
|
--volume=$(pwd):/usr/src/app \
|
||||||
|
--env BUILDSWIG=ON \
|
||||||
|
--env BUILDSWIGPYTHON=ON \
|
||||||
|
--env BUILDSWIGJAVA=OFF \
|
||||||
|
--env BUILDSWIGNODE=OFF \
|
||||||
|
--env http_proxy=$http_proxy \
|
||||||
|
--env https_proxy=$https_proxy \
|
||||||
|
--env no_proxy=$no_proxy \
|
||||||
|
dnoliver/upm-python \
|
||||||
|
bash -c "./scripts/run-cmake.sh && make -Cbuild"
|
||||||
|
```
|
||||||
|
@ -4,6 +4,108 @@ Changelog {#changelog}
|
|||||||
Here's a list summarizing some of the key undergoing changes to our library
|
Here's a list summarizing some of the key undergoing changes to our library
|
||||||
from earlier versions:
|
from earlier versions:
|
||||||
|
|
||||||
|
### v1.3.0
|
||||||
|
|
||||||
|
* Finalized all required build system and JAVA binding changes to release the
|
||||||
|
UPM libraries for Android Things targets
|
||||||
|
* Enhanced the modules for lsm303 and tmp006 to support newer variants of the
|
||||||
|
chips
|
||||||
|
* Fixed Node.js detection on Ubuntu when installed with apt using official
|
||||||
|
packages
|
||||||
|
* Minor documentation changes
|
||||||
|
* New sensors: lsm303agr, lsm303d, veml6070, tca9548a, rn2903
|
||||||
|
|
||||||
|
### v1.2.0
|
||||||
|
|
||||||
|
* Improved JAVA binding compiler compatibility and added JAVA interfaces that
|
||||||
|
match existing C++ interfaces
|
||||||
|
* Ported Bosch drivers to C thus now they can be used on supported MCUs
|
||||||
|
* Completely redesigned C/C++ example handling by cmake to avoid maintaining
|
||||||
|
a list by hand
|
||||||
|
* Fixed several existing drivers, mostly based on static code analysis reports
|
||||||
|
* Added a sensor driver template plus bash script that can be easily used by
|
||||||
|
developers to start writing their own sensor driver
|
||||||
|
* Numerous documentation improvements
|
||||||
|
* New sensors: p9813, abp, rsc, mmc35240, tcs37727, tmp006, mma8x6x, mag3110,
|
||||||
|
hdc1000
|
||||||
|
|
||||||
|
### v1.1.0
|
||||||
|
|
||||||
|
* Reworked cmake handling of internal and external dependencies
|
||||||
|
* Documentation improvements for sensor names, sensor descriptions, external
|
||||||
|
contributor guides and added new section on installing UPM on a supported OS
|
||||||
|
* Fixed issues with C11 builds on some WRLinux gateways and Debian systems
|
||||||
|
* New examples and functionality for speaker and ads1x15 modules
|
||||||
|
* Modified JAVA builds to ensure the SWIG generated wrappers include all
|
||||||
|
functionality and typemaps
|
||||||
|
* New sensors: mcp2515, max30100, uartat, le910
|
||||||
|
|
||||||
|
### v1.0.2
|
||||||
|
|
||||||
|
* Minor cmake changes for Java builds and Java examples are now toggled with
|
||||||
|
the same BUILDEXAMPLES cmake switch
|
||||||
|
* Made some improvements in the utilities class for our C drivers
|
||||||
|
* Fixed issue with some drivers not being usable on subplatforms due to pin
|
||||||
|
numbers using uint8 type
|
||||||
|
* New sensors: ims, ecezo, mb704x, rf22
|
||||||
|
|
||||||
|
### v1.0.1
|
||||||
|
|
||||||
|
* Warnings as errors enabled for C/CXX (fixed warnings from -Wall and others)
|
||||||
|
* Fix for C/CXX compile flag append issue #485
|
||||||
|
* C sensor libraries for: my9221, otp538u, guvas12d, ppd42ns
|
||||||
|
* New sensor: ms5803
|
||||||
|
|
||||||
|
### v1.0.0
|
||||||
|
|
||||||
|
* Added approximately 50 C sources for UPM drivers that can be used on both
|
||||||
|
Unix and RTOS boards
|
||||||
|
* Provided generic alternatives to the Grove set of classes as they will be
|
||||||
|
deprecated over time and eventually removed
|
||||||
|
* UPM modules are now being packed and published on NPM as sources rather than
|
||||||
|
binaries to enhance compatibility with various boards and systems
|
||||||
|
* Build both python2 and python3 modules if the corresponding python libs are
|
||||||
|
available and removed cmake BUILDPYTHON3 switch
|
||||||
|
* Converted python examples to run on both python2 and python3
|
||||||
|
* Added 'upm' hierarchy to python module install path which changes the way
|
||||||
|
UPM modules are imported
|
||||||
|
Example:
|
||||||
|
old: import pyupm_dfrph
|
||||||
|
new: from upm import pyupm_dfrph
|
||||||
|
or
|
||||||
|
import upm.pyupm_dfrph
|
||||||
|
* Added ctests for consistancy checking UPM repo as well as sanity checking
|
||||||
|
for python2/3 modules and examples
|
||||||
|
* Various documentation and driver fixes throughout
|
||||||
|
* New sensors: nmea_gps, mma7361, bh1750, hka5, dfrorp, dfrec, sht1x
|
||||||
|
|
||||||
|
### v0.8.0
|
||||||
|
|
||||||
|
* Extended l3gd20 driver to support I2C connections in addition to IIO
|
||||||
|
* Updated ads1x15, mcp9808 and ssd1306 I2C drivers to not throw a fatal
|
||||||
|
exception if they fail to set a different I2C speed
|
||||||
|
* Added extra functionality to apa102 driver, backlight control to jhd1313m1
|
||||||
|
LCDs and fixed htu21d
|
||||||
|
* Improved documentation with build dependencies, refreshed the list of known
|
||||||
|
limitations and simplified the component name for a few sensors
|
||||||
|
|
||||||
|
### v0.7.3
|
||||||
|
|
||||||
|
* Fixed several existing drivers and updated Grove Temperature sensor to use
|
||||||
|
new formula for v1.1+ by default
|
||||||
|
* Separated codebase for upm_grove module that bundles some of the starter kit
|
||||||
|
sensors into individual source files
|
||||||
|
* Documentation and doxygen tag updates with correct spelling for Celsius in
|
||||||
|
several places, this also affects API compatibility
|
||||||
|
* Removed superfluous BUILDSWIG option, some build recipes might be impacted
|
||||||
|
* New sensor: ms5611
|
||||||
|
|
||||||
|
### v0.7.2
|
||||||
|
|
||||||
|
* Mraa 1.1.1 required changes to UPM drivers and examples for IIO core
|
||||||
|
kernel support
|
||||||
|
* Rev'ed libmraa requirement to 1.1.1
|
||||||
|
|
||||||
### v0.7.1
|
### v0.7.1
|
||||||
|
|
||||||
* Fix for building python2 vs python3 bindings
|
* Fix for building python2 vs python3 bindings
|
||||||
|
@ -94,3 +94,56 @@ then you just add a line to each of your commits with `--signoff` saying
|
|||||||
|
|
||||||
using your real name (sorry, no pseudonyms or anonymous contributions.)
|
using your real name (sorry, no pseudonyms or anonymous contributions.)
|
||||||
Unsigned commits will not be accepted.
|
Unsigned commits will not be accepted.
|
||||||
|
|
||||||
|
|
||||||
|
Creating a new sensor library using the sensortemplate
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
A stubbed-out sensor library is available which can be leveraged to get
|
||||||
|
up-and-running quickly when writing a new sensor library. Use the shell
|
||||||
|
commands below to generate collateral files for your new sensor library.
|
||||||
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function make_new_sensor {
|
||||||
|
export SensorName=$1
|
||||||
|
# Get a lowercase version of the string
|
||||||
|
export sensorname=${SensorName,,}
|
||||||
|
|
||||||
|
# Make sure this is run from the root UPM directory
|
||||||
|
if ! grep -q 'UPM ' README.md; then echo "Please run from the root UPM directory"; return -1; fi
|
||||||
|
|
||||||
|
printf "Generating new sensor: ${SensorName}\n"
|
||||||
|
# Copy sensortemplate files to ${sensorname}
|
||||||
|
find docs/ examples/ src/ -name '*sensortemplate*' -exec bash -c 'cp -r $0 ${0/sensortemplate/${sensorname}}' {} \;
|
||||||
|
# Copy SensorTemplate files to ${SensorName}
|
||||||
|
find examples/ src/ -name '*SensorTemplate*' -exec bash -c 'cp -r $0 ${0/SensorTemplate/${SensorName}}' {} \;
|
||||||
|
# Rename sernsortemplate src files
|
||||||
|
rename "s/sensortemplate/${sensorname}/" src/${sensorname}/*
|
||||||
|
# Search/replace the new files, replacing all instances of sensortemplate
|
||||||
|
perl -p -i -e "s/SensorTemplate/${SensorName}/g" src/${sensorname}/* examples/*/*${sensorname}* examples/*/*${SensorName}*
|
||||||
|
perl -p -i -e "s/sensortemplate/${sensorname}/g" src/${sensorname}/* examples/*/*${sensorname}* examples/*/*${SensorName}*
|
||||||
|
# Add mynewmodule example target for java
|
||||||
|
perl -p -i -e "s/^((.*)SensorTemplateSample sensortemplate(.*))/\1\n\2${SensorName}Sample ${sensorname}\3/g" examples/java/CMakeLists.txt
|
||||||
|
# Add mynewmodule example mappings for doxygen
|
||||||
|
perl -p -i -e "s/^(.*SensorTemplateSample.*)$/\1\n${sensorname}.cxx\t${SensorName}Sample.java\t${sensorname}.js\t${sensorname}.py/g" doxy/samples.mapping.txt
|
||||||
|
# Display TODO's
|
||||||
|
printf "Generation complete for sensor library: ${SensorName}\n"
|
||||||
|
printf "TODO's:\n"
|
||||||
|
printf "\t1. Update src/hdr files: src/${sensorname}/${sensorname}.hpp src/${sensorname}/${sensorname}.cxx\n"
|
||||||
|
printf "\t\tChange the Author\n"
|
||||||
|
printf "\t\tChange the Copyright\n"
|
||||||
|
printf "\t\tUpdate all doxygen tags (follow directions for @tags)\n"
|
||||||
|
printf "\t2. Update examples: examples/*/${sensorname}.* examples/java/*${SensorName}*.java\n"
|
||||||
|
printf "\t3. Overwrite docs/images/${sensorname}.png with a valid image of your sensor\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Call make_new_sensor with your new sensor name, example: 'MyNewSensor1234'
|
||||||
|
make_new_sensor MyNewSensor1234
|
||||||
|
```
|
||||||
|
|
||||||
|
Once all files have been created, they can be used as a starting-point for your
|
||||||
|
new library. They will need additional customization (your name/email address,
|
||||||
|
documentation, sensor images, etc).
|
||||||
|
@ -4,7 +4,7 @@ Writing sensor documentation {#documentation}
|
|||||||
It is highly encouraged to provide at least some basic documentation for the
|
It is highly encouraged to provide at least some basic documentation for the
|
||||||
sensors that you want to add to UPM:
|
sensors that you want to add to UPM:
|
||||||
|
|
||||||
- If you don't add documentation, the code review will take very long and
|
- If you don't add documentation, the code review will take very long and
|
||||||
your contribution could be rejected.
|
your contribution could be rejected.
|
||||||
- Try to have no warnings in doxygen, this is generally fairly easy.
|
- Try to have no warnings in doxygen, this is generally fairly easy.
|
||||||
- Have the specific sensor manufacturer/model & version that you used, if you
|
- Have the specific sensor manufacturer/model & version that you used, if you
|
||||||
@ -15,7 +15,7 @@ sensors that you want to add to UPM:
|
|||||||
|
|
||||||
####The sensor block
|
####The sensor block
|
||||||
|
|
||||||
This is added just before the class declaration in your header(.h) file and has
|
This is added just before the class declaration in your header(.h) file and has
|
||||||
mandatory fields. For single sensor libraries, this block will actually
|
mandatory fields. For single sensor libraries, this block will actually
|
||||||
follow immediately after the library block. If you have multiple physical
|
follow immediately after the library block. If you have multiple physical
|
||||||
sensors, add this to every one.
|
sensors, add this to every one.
|
||||||
@ -36,7 +36,7 @@ Here's an example (disregard the "@verbatim" tags in your actual code):
|
|||||||
* @kit <component-kit>
|
* @kit <component-kit>
|
||||||
*
|
*
|
||||||
* @brief Short class/sensor description
|
* @brief Short class/sensor description
|
||||||
*
|
*
|
||||||
* Then add a longer
|
* Then add a longer
|
||||||
* description here.
|
* description here.
|
||||||
*
|
*
|
||||||
@ -52,8 +52,9 @@ Here's an example (disregard the "@verbatim" tags in your actual code):
|
|||||||
- `<chip-id>` Usually the chip number used by the sensor. When this is not
|
- `<chip-id>` Usually the chip number used by the sensor. When this is not
|
||||||
available or relevant, use a unique descriptor that makes sense. Must match
|
available or relevant, use a unique descriptor that makes sense. Must match
|
||||||
class name. *Mandatory*
|
class name. *Mandatory*
|
||||||
- `<component-name>` A short name for your sensor, try to avoid including the
|
- `<component-name>` Title Case descriptive name for your sensor, try to avoid
|
||||||
manufacturer's name here. *Mandatory*
|
including the manufacturer's name here. Examples: Digital Pressure Sensor,
|
||||||
|
Serial MP3 Module, etc... *Mandatory*
|
||||||
- `<alt-name>` Alternative names that your sensor driver might have. This may
|
- `<alt-name>` Alternative names that your sensor driver might have. This may
|
||||||
include manufacturer's name. *Optional*
|
include manufacturer's name. *Optional*
|
||||||
- `<alt-id>` Alternative chip-ids that your sensor driver supports. *Optional*
|
- `<alt-id>` Alternative chip-ids that your sensor driver supports. *Optional*
|
||||||
@ -66,7 +67,7 @@ Here's an example (disregard the "@verbatim" tags in your actual code):
|
|||||||
- `<component-kit>` Specifies if the sensor is part of a kit. *Optional*
|
- `<component-kit>` Specifies if the sensor is part of a kit. *Optional*
|
||||||
|
|
||||||
Existing groups that can be used for the manufacturer, connection, category and
|
Existing groups that can be used for the manufacturer, connection, category and
|
||||||
kit tags are found in the src/upm.h file.
|
kit tags are found in the *src/groups.md* file.
|
||||||
|
|
||||||
Optionally, a small representative image can be placed in the "docs/images"
|
Optionally, a small representative image can be placed in the "docs/images"
|
||||||
subfolder and linked with the "@image" tag.
|
subfolder and linked with the "@image" tag.
|
||||||
|
348
docs/guidelines.md
Normal file
@ -0,0 +1,348 @@
|
|||||||
|
# Code Commenting And Documentation Authoring Guidelines
|
||||||
|
|
||||||
|
#### [Part I. Code Commenting](#code-commenting)
|
||||||
|
|
||||||
|
[Grammar](#grammar)
|
||||||
|
|
||||||
|
- [Active vs passive voice](#voice)
|
||||||
|
|
||||||
|
- [Capitalization](#capitalization)
|
||||||
|
|
||||||
|
- [No possessive case](#possessive-case)
|
||||||
|
|
||||||
|
- [Present tense](#present-tense)
|
||||||
|
|
||||||
|
- [Second person vs the user / reader / programmer / engineer](#second-person)
|
||||||
|
|
||||||
|
- [Third person vs infinitive](#third-person)
|
||||||
|
|
||||||
|
[Punctuation](#punctuation)
|
||||||
|
|
||||||
|
- [Comma in enumerations](#comma)
|
||||||
|
|
||||||
|
- [No period at the end of description](#period)
|
||||||
|
|
||||||
|
[Specific word usage](#word-usage)
|
||||||
|
|
||||||
|
- [Abbreviations and acronyms](#abbr-acr)
|
||||||
|
|
||||||
|
- [Adjectives containing numbers](#adj-num)
|
||||||
|
|
||||||
|
- [App vs application](#app)
|
||||||
|
|
||||||
|
- [Function vs method](#func-meth)
|
||||||
|
|
||||||
|
- [Onboard vs on-board](#onboard)
|
||||||
|
|
||||||
|
- [Sensor name vs sensor model](#name-model)
|
||||||
|
|
||||||
|
- [Setup vs set up](#setup)
|
||||||
|
|
||||||
|
- [Wi-Fi vs WiFi / Wifi / Wi-fi / wifi / wi-fi](#setup)
|
||||||
|
|
||||||
|
[Trademarks](#trademarks)
|
||||||
|
|
||||||
|
- [Intel products](#intel-prod)
|
||||||
|
|
||||||
|
- [Third-party technology](#third-party)
|
||||||
|
|
||||||
|
- [Trademark + noun](#tm-noun)
|
||||||
|
|
||||||
|
#### [Part II. Documentation Authoring](#doc-authoring)
|
||||||
|
|
||||||
|
[Grammar](#da-grammar)
|
||||||
|
|
||||||
|
- [Capitalization](#da-capitalization)
|
||||||
|
|
||||||
|
[Styling](#da-styling)
|
||||||
|
|
||||||
|
- [Bolding](#da-bolding)
|
||||||
|
|
||||||
|
- [Backticks](#da-backticks)
|
||||||
|
|
||||||
|
- [Links](#da-links)
|
||||||
|
|
||||||
|
- [Numbered list vs bullet points](#da-lists)
|
||||||
|
|
||||||
|
[Specific word usage](#da-word-usage)
|
||||||
|
|
||||||
|
- [Login vs log in](#da-login)
|
||||||
|
|
||||||
|
- [Click](#da-click)
|
||||||
|
|
||||||
|
- [SSH](#da-ssh)
|
||||||
|
|
||||||
|
# <a name="code-commenting"></a>Code Commenting Guidelines
|
||||||
|
|
||||||
|
## <a name="grammar"></a>Grammar
|
||||||
|
|
||||||
|
### <a name="voice"></a>Active vs passive voice
|
||||||
|
|
||||||
|
Where possible, prefer active voice over passive.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| It can be put into the configuration mode by grounding the CONFIG pin on the transceiver. | - You can put it into the configuration mode by grounding the CONFIG pin on the transceiver.<br>- To put it into the configuration mode, ground the CONFIG pin on the transceiver.<br>- Put it into the configuration mode by grounding the CONFIG pin on the transceiver. |
|
||||||
|
|
||||||
|
### <a name="capitalization"></a>Capitalization
|
||||||
|
|
||||||
|
- Capitalize the first word in the description of an entity.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| checks to see if there is data available for reading | Checks to see if there is data available for reading |
|
||||||
|
| @param len length of the buffer | @param len Length of the buffer |
|
||||||
|
|
||||||
|
- Be consistent with the capitalization of boolean values.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Returns True on success, false otherwise | - Returns true on success, false otherwise<br>- Returns True on success, False otherwise |
|
||||||
|
|
||||||
|
### <a name="possessive-case"></a>No possessive case
|
||||||
|
|
||||||
|
Do not use possessive case to avoid unnecessary personalization.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| method's output | - method output<br>- output of the method |
|
||||||
|
|
||||||
|
### <a name="present-tense"></a>Present tense
|
||||||
|
|
||||||
|
Use the present simple tense instead of future, past, or present perfect.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| When specified, this value will be used in computing the voltage. | When specified, this value is used in computing the voltage. |
|
||||||
|
| Once the data has been read… | Once the data is read… |
|
||||||
|
|
||||||
|
### <a name="second-person"></a>Second person vs the user / reader / programmer / engineer
|
||||||
|
|
||||||
|
Use second person when addressing the target reader of your comment.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| The user can easily override this method. | You can easily override this method. |
|
||||||
|
|
||||||
|
### <a name="third-person"></a>Third person vs infinitive
|
||||||
|
|
||||||
|
Use third-person verb forms in short descriptions of classes, methods, functions, etc., not infinitive.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Get the proximity value from the sensor | Gets the proximity value from the sensor |
|
||||||
|
|
||||||
|
## <a name="punctuation"></a>Punctuation
|
||||||
|
|
||||||
|
### <a name="comma"></a>Comma in enumerations
|
||||||
|
|
||||||
|
Add an extra comma before the last item in a list joined by **and** / **or**.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Returns raw values for the X, Y and Z axes. | Returns raw values for the X, Y, and Z axes. |
|
||||||
|
|
||||||
|
### <a name="period"></a>No period at the end of description
|
||||||
|
|
||||||
|
Do not put a period if the description of an entity is one sentence long.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Returns the name of the sensor. | Returns the name of the sensor |
|
||||||
|
| Sets the frequency modulation<br>Valid values are between 10 and 160 (in kHz) | Sets the frequency modulation. Valid values are between 10 and 160 (in kHz). |
|
||||||
|
| @param millis Maximum time in milliseconds to wait for the input<br>-1 means waiting forever (default) | @param millis Maximum time in milliseconds to wait for the input. -1 means waiting forever (default). |
|
||||||
|
|
||||||
|
<font color="purple">**Exception:**</font> if the description contains more than one sentence, put periods after each sentence.
|
||||||
|
|
||||||
|
## <a name="word-usage"></a>Specific word usage
|
||||||
|
|
||||||
|
### <a name="abbr-acr"></a>Abbreviations and acronyms
|
||||||
|
|
||||||
|
- Spell out the first occurrence or the first prominent use of an abbreviation or acronym, followed by a shortened form.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| @brief API for the GP2Y0A family of IR Proximity Sensors | @brief API for the GP2Y0A family of infrared (IR) Proximity Sensors |
|
||||||
|
|
||||||
|
- Do not use Latin abbreviations.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Works best with halved values; e.g., 1.0, 0.5, 0.25, etc. | Works best with halved values; for example, 1.0, 0.5, 0.25, and so on. |
|
||||||
|
|
||||||
|
- Know exactly what the abbreviation or acronym means to avoid unnecessary duplication.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| - LCD display<br>- ISR routine | - LCD / liquid-crystal display<br>- ISR / interrupt service routine |
|
||||||
|
|
||||||
|
### <a name="adj-num"></a>Adjectives containing numbers
|
||||||
|
|
||||||
|
Adjectives of the form **number + noun / participle** should be hyphenated. It does not matter if a number is represented by one or more digits or spelled out.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| - 4 wire stepper motor<br>- 3 axis gyroscope<br>- zero based indexing<br>- one byte register | - 4-wire stepper motor<br>- 3-axis gyroscope<br>- zero-based indexing<br>- one-byte register |
|
||||||
|
|
||||||
|
### <a name="app"></a>App vs application
|
||||||
|
|
||||||
|
Use **app** when referring to a program running on a device, and **application** when referring to a program running on a desktop / laptop computer.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| The wiki page for this device includes a link to an Android\* application that can be used to read the device via NFC. | The wiki page for this device includes a link to an Android\* app that can be used to read the device via NFC. |
|
||||||
|
|
||||||
|
### <a name="func-meth"></a>Function vs method
|
||||||
|
|
||||||
|
If a function is associated with a class, use **method** instead.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| class WheelEncoder {<br>...<br>/**<br>* Starts the counter. This function also clears<br>* the current count and resets the clock.<br>*/<br>void startCounter(); | class WheelEncoder {<br>...<br>/**<br>* Starts the counter. This method also clears<br>* the current count and resets the clock.<br>*/<br>void startCounter(); |
|
||||||
|
|
||||||
|
### <a name="onboard"></a>Onboard vs on-board
|
||||||
|
|
||||||
|
Use **onboard**.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| This ADC features an on-board reference and oscillator. | This ADC features an onboard reference and oscillator. |
|
||||||
|
|
||||||
|
### <a name="name-model"></a>Sensor name vs sensor model
|
||||||
|
|
||||||
|
Use a sensor name alone or a sensor model followed by a sensor name, not a sensor model alone.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| ADXL345 is compatible with… | - The ADXL345 3-axis digital accelerometer is compatible with…<br>- The accelerometer is compatible with… |
|
||||||
|
|
||||||
|
<font color="purple">**Exception:**</font> you can use a sensor model alone when introducing a
|
||||||
|
sensor for the first time:
|
||||||
|
|
||||||
|
ADXL345 is a 3-axis digital accelerometer…
|
||||||
|
|
||||||
|
### <a name="setup"></a>Setup vs set up
|
||||||
|
|
||||||
|
**Setup** is a noun, **set up** is a verb.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| It does not require any additional set up. | It does not require any additional setup. |
|
||||||
|
| For instructions on how to setup…, refer to... | For instructions on how to set up…, refer to... |
|
||||||
|
|
||||||
|
### <a name="wi-fi"></a>Wi-Fi vs WiFi / Wifi / Wi-fi / wifi / wi-fi
|
||||||
|
|
||||||
|
Use **Wi-Fi**.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| It was tested with the XBee\* S6B WiFi module. | It is tested with the XBee\* S6B Wi-Fi\* module. |
|
||||||
|
|
||||||
|
## <a name="trademarks"></a>Trademarks
|
||||||
|
|
||||||
|
### <a name="intel-prod"></a>Intel products
|
||||||
|
|
||||||
|
Use the correct official names of Intel products. When in doubt, check the TM names database.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| It is a 64x48 pixel OLED display that connects directly to an edison via its 80-pin connector. | It is a 64x48 pixel OLED display that connects directly to an Intel(R) Edison board via its 80-pin connector. |
|
||||||
|
|
||||||
|
**Note:** if an Intel product has a legally approved short name, you may use it in subsequent instances, after spelling it out the first time.
|
||||||
|
|
||||||
|
### <a name="third-party"></a>Third-party technology
|
||||||
|
|
||||||
|
Add an asterisk (\*) after a name to indicate a third-party trademark or registered intellectual property. If you are not sure whether an asterisk is necessary after a particular name, the rule of thumb is to put one, to be on the safe side.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| The Grove MQ2 Gas Sensor module is useful for gas leakage detection. | The Grove\* MQ2 Gas Sensor module is useful for gas leakage detection. |
|
||||||
|
|
||||||
|
### <a name="tm-noun"></a>Trademark + noun
|
||||||
|
|
||||||
|
Always follow trademarks by an appropriate noun. For a list of approved nouns for a particular trademark, check the TM names database.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| It is a 64x48 pixel OLED display that connects directly to an Intel(R) Edison via its 80-pin connector. | It is a 64x48 pixel OLED display that connects directly to an Intel(R) Edison board via its 80-pin connector. |
|
||||||
|
|
||||||
|
# <a name="doc-authoring"></a>Documentation Authoring Guidelines
|
||||||
|
|
||||||
|
## <a name="da-grammar"></a>Grammar
|
||||||
|
|
||||||
|
### <a name="da-capitalization"></a>Capitalization
|
||||||
|
|
||||||
|
For titles, use sentence capitalization.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Add a New Device | Add a new device |
|
||||||
|
|
||||||
|
## <a name="da-styling"></a>Styling
|
||||||
|
|
||||||
|
### <a name="da-bolding"></a>Bolding
|
||||||
|
|
||||||
|
For GUI elements and file names, use bolding instead of quotes.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| In the “Environment Variables” window, click “OK”. | In the **Environment Variables** window, click **OK**. |
|
||||||
|
| Copy the “example.zip” archive into the installation directory. | Copy the **example.zip** archive into the installation directory. |
|
||||||
|
|
||||||
|
### <a name="da-backticks"></a>Backticks
|
||||||
|
|
||||||
|
Enclose program commands, code blocks, and file paths in backticks (\`).
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| To create a new device, use the **create-thing** command. | To create a new device, use the \`create-thing\` (rendered as `create-thing`) command. |
|
||||||
|
| Go to **C:\Users\me\Documents\GitHub\intel-iot-examples-mqtt\support\aws**. | Go to \`C:\Users\me\Documents\GitHub\intel-iot-examples-mqtt\support\aws\` (rendered as `C:\Users\me\Documents\GitHub\intel-iot-examples-mqtt\support\aws`). |
|
||||||
|
|
||||||
|
### <a name="da-links"></a>Links
|
||||||
|
|
||||||
|
Do not use embedded links to third-party websites.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Create an account on [Microsoft Azure](https://azure.microsoft.com/en-us), if you do not yet have one. | Create an account on [https://azure.microsoft.com/en-us](https://azure.microsoft.com/en-us), if you do not yet have one. |
|
||||||
|
|
||||||
|
### <a name="da-lists"></a>Numbered list vs bullet points
|
||||||
|
|
||||||
|
- For a logical sequence of steps, use a numbered list.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| When running your C++ code on the Edison, you need to set the MQTT parameters in Eclipse. Go to "Run configurations", and change the "Commands to execute before application" to the following:<br>…<br>Click on the "Apply" button to save these settings.<br>Click on the "Run" button to run the code on the Edison. | When running your C++ code on the Intel® Edison board, you need to set the MQTT\* client parameters in Eclipse\*. To do that:<br>1. Go to **Run configurations** and, in the **Commands to execute before application** field, type the following:<br>…<br>2. Click the **Apply** button to save these settings.<br>3. Click the **Run** button to run the code on your board. |
|
||||||
|
|
||||||
|
- For a list of equally important options, use a bulleted list.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| From this exercise, developers will learn how to:<br>1. Connect the Intel® Edison board...<br>2. Run these code samples in the Intel® System Studio IoT Edition...<br>3. Set up a web application server... | From this exercise, developers will learn how to:<br>- Connect the Intel® Edison board…<br>- Run these code samples in the Intel® System Studio IoT Edition…<br>- Set up a web application server… |
|
||||||
|
|
||||||
|
## <a name="da-word-usage"></a>Specific word usage
|
||||||
|
|
||||||
|
### <a name="da-login"></a>Login vs log in
|
||||||
|
|
||||||
|
**Login** is a noun, **log in** is a verb.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Provide your log in and password. | Provide your login and password. |
|
||||||
|
| Login to your account. | Log in( )to your account. |
|
||||||
|
|
||||||
|
### <a name="da-click"></a>Click
|
||||||
|
|
||||||
|
Omit **on** after **click**.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| Click on **Advanced system settings**. | Click **Advanced system settings**. |
|
||||||
|
|
||||||
|
### <a name="da-ssh"></a>SSH
|
||||||
|
|
||||||
|
Do not use SSH as a verb. It is considered slang and is to be avoided.
|
||||||
|
|
||||||
|
| <font color="red">**Incorrect**</font> | <font color="green">**Correct**</font> |
|
||||||
|
| --- | --- |
|
||||||
|
| SSH into your Intel® Edison board. | Establish an SSH connection to your Intel® Edison board. |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 17 KiB |
BIN
docs/icons/iss.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/images/1wire.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
0
docs/images/a110x.jpg
Executable file → Normal file
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
0
docs/images/ad8232.jpg
Executable file → Normal file
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 222 KiB |
0
docs/images/adafruitms1438.jpg
Executable file → Normal file
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
0
docs/images/adafruitss.jpg
Executable file → Normal file
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 173 KiB |
0
docs/images/adc121c021.jpg
Executable file → Normal file
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
0
docs/images/apds9002.jpg
Executable file → Normal file
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
0
docs/images/at42qt1070.jpg
Executable file → Normal file
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
0
docs/images/biss0001.jpg
Executable file → Normal file
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
BIN
docs/images/button.jpg
Normal file
After Width: | Height: | Size: 164 KiB |
0
docs/images/buzzer.jpg
Executable file → Normal file
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
BIN
docs/images/circularled.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
0
docs/images/cjq4435.jpg
Executable file → Normal file
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
BIN
docs/images/collision.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
0
docs/images/ds1307.jpg
Executable file → Normal file
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
0
docs/images/ecs1030.jpg
Executable file → Normal file
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
BIN
docs/images/ehr.jpg
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
docs/images/eldriver.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
docs/images/electromagnet.jpg
Normal file
After Width: | Height: | Size: 6.6 KiB |
0
docs/images/groveemg.jpg → docs/images/emg.jpg
Executable file → Normal file
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
0
docs/images/enc03r.jpg
Executable file → Normal file
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
BIN
docs/images/es9257.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
0
docs/images/flex.jpg
Executable file → Normal file
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
0
docs/images/gp2y0a.jpg
Executable file → Normal file
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
BIN
docs/images/gprs.jpg
Normal file
After Width: | Height: | Size: 159 KiB |
0
docs/images/grovebutton.jpg
Executable file → Normal file
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 164 KiB |
0
docs/images/grovecircularled.jpg
Executable file → Normal file
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
0
docs/images/grovecollision.jpg
Executable file → Normal file
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
0
docs/images/groveehr.jpg
Executable file → Normal file
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
0
docs/images/groveeldriver.jpg
Executable file → Normal file
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
0
docs/images/groveelectromagnet.jpg
Executable file → Normal file
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
BIN
docs/images/grovegprs.jpg
Normal file
After Width: | Height: | Size: 159 KiB |
0
docs/images/groveled.jpg
Executable file → Normal file
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 138 KiB |
0
docs/images/grovelight.jpg
Executable file → Normal file
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
0
docs/images/grovelinefinder.jpg
Executable file → Normal file
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
0
docs/images/groveloudness.jpg
Executable file → Normal file
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
0
docs/images/grovemd.jpg
Executable file → Normal file
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB |
0
docs/images/grovemoisture.jpg
Executable file → Normal file
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
0
docs/images/groveo2.jpg
Executable file → Normal file
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
0
docs/images/groverelay.jpg
Executable file → Normal file
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
0
docs/images/grovescam.jpg
Executable file → Normal file
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
0
docs/images/grovespeaker.jpg
Executable file → Normal file
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
0
docs/images/grovetemp.jpg
Executable file → Normal file
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
0
docs/images/grovevdiv.jpg
Executable file → Normal file
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
0
docs/images/grovewfs.jpg
Executable file → Normal file
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
0
docs/images/grovegsr.jpg → docs/images/gsr.jpg
Executable file → Normal file
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
0
docs/images/guvas12d.jpg
Executable file → Normal file
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
0
docs/images/hm11.jpg
Executable file → Normal file
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
0
docs/images/hp20x.jpg
Executable file → Normal file
Before Width: | Height: | Size: 929 KiB After Width: | Height: | Size: 929 KiB |
BIN
docs/images/ims.png
Normal file
After Width: | Height: | Size: 71 KiB |
0
docs/images/ina132.jpg
Executable file → Normal file
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
0
docs/images/isd1820.jpg
Executable file → Normal file
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
0
docs/images/joystick12.jpg
Executable file → Normal file
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
0
docs/images/l298.jpg
Executable file → Normal file
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 169 KiB |
0
docs/images/ldt0028.jpg
Executable file → Normal file
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
BIN
docs/images/led.jpg
Normal file
After Width: | Height: | Size: 138 KiB |
BIN
docs/images/lidarlitev3.jpg
Normal file
After Width: | Height: | Size: 156 KiB |
BIN
docs/images/light.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
docs/images/linefinder.jpg
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
docs/images/loudness.jpg
Normal file
After Width: | Height: | Size: 9.4 KiB |
0
docs/images/lpd8806.jpg
Executable file → Normal file
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
0
docs/images/m24lr64e.jpg
Executable file → Normal file
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
BIN
docs/images/max30100.png
Normal file
After Width: | Height: | Size: 106 KiB |
0
docs/images/max31855.jpg
Executable file → Normal file
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 196 KiB |
0
docs/images/maxsonarez.jpg
Executable file → Normal file
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
BIN
docs/images/md.jpg
Normal file
After Width: | Height: | Size: 167 KiB |
0
docs/images/mhz16.jpg
Executable file → Normal file
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
0
docs/images/mlx90614.jpg
Executable file → Normal file
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
0
docs/images/mma7455.jpg
Executable file → Normal file
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
0
docs/images/mma7660.jpg
Executable file → Normal file
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
BIN
docs/images/moisture.jpg
Normal file
After Width: | Height: | Size: 3.3 KiB |
0
docs/images/nunchuck.jpg
Executable file → Normal file
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
BIN
docs/images/o2.jpg
Normal file
After Width: | Height: | Size: 79 KiB |