mirror of
https://github.com/espressif/openthread.git
synced 2026-06-17 19:03:29 +00:00
Compare commits
1095 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 54b31928cf | |||
| 962c06f8e7 | |||
| 3f38068a71 | |||
| 5e34b5062d | |||
| 9c8f0951df | |||
| 0729138e7b | |||
| 0e11f8bd9b | |||
| c923dff5c7 | |||
| 78d567a4f6 | |||
| 02c7c6440a | |||
| c7cda1feb2 | |||
| d7a025cb91 | |||
| 8370395c47 | |||
| 16a5c52d9f | |||
| bc195d1329 | |||
| 1ad22bac21 | |||
| 9481634ccc | |||
| 93243b5f1d | |||
| 528f8a1208 | |||
| 9dbebfc2fe | |||
| 1ad2c04bdb | |||
| a24737a2ad | |||
| 7dc3b2696a | |||
| f2d026729d | |||
| b47dda45cf | |||
| a6865e03e4 | |||
| b5e17e07ee | |||
| 66dcbac15d | |||
| 644e0a30f7 | |||
| 40c7a14b23 | |||
| 9af8fe8cc5 | |||
| ecd9436427 | |||
| 6dddd555e4 | |||
| 376f35a49e | |||
| 07221dd85c | |||
| e4a9281054 | |||
| 36b9ecbf11 | |||
| 6c75a53bdc | |||
| 5bac12f9d6 | |||
| 03bcb408f9 | |||
| c112b9351d | |||
| 45713b0dd2 | |||
| b06f4cad20 | |||
| d7343c877b | |||
| e810357adb | |||
| f8a6d52695 | |||
| 73afdadaa8 | |||
| 0af18a54ae | |||
| 36926a610a | |||
| b9040673c9 | |||
| 73a874ff9f | |||
| 659cf55a5a | |||
| 3c132d4620 | |||
| 7183b24e65 | |||
| 1cdb0e7767 | |||
| 3cd5f49d71 | |||
| 481f69703b | |||
| 5c6c798576 | |||
| be288331ac | |||
| 471129460e | |||
| addb1936c3 | |||
| b2f7414dac | |||
| 3b6eb7de42 | |||
| 3b877e54ae | |||
| 075017bedc | |||
| ccbb304969 | |||
| cca72a660f | |||
| 114a0e7dc7 | |||
| f0f924a747 | |||
| 6488b25484 | |||
| 82e7e32bb5 | |||
| 8c094c6ac2 | |||
| b49ee0879a | |||
| 0ef8f510c5 | |||
| 7fe1d29ab4 | |||
| 1dd46f9d93 | |||
| d46c03b588 | |||
| 89b657cc60 | |||
| 1081b45bec | |||
| cbf1a19483 | |||
| 2117dae5f8 | |||
| c5e7252fed | |||
| adde385643 | |||
| ac86fe52e6 | |||
| 692511070f | |||
| 25c058d8ad | |||
| fd66f2399f | |||
| c89fd9a8f5 | |||
| 2efe99c507 | |||
| 7a612437ed | |||
| d14a14a494 | |||
| 6640e7d865 | |||
| 90db2d2ee7 | |||
| bd197d3f47 | |||
| 85de837187 | |||
| a374905a1d | |||
| 812eeee027 | |||
| df2fa4c548 | |||
| 00f3043a06 | |||
| 2129b567b4 | |||
| 5e9b2818eb | |||
| 57ee45be21 | |||
| 5f01bc48f5 | |||
| 8d1060fb60 | |||
| 6c1abeab90 | |||
| 2d38c59a5a | |||
| c0442e88e8 | |||
| ceb63f97d5 | |||
| e8fe3bd6e7 | |||
| d5370ac4cd | |||
| 434e6bbffc | |||
| 85af5f1963 | |||
| c394080617 | |||
| a1f0b21c16 | |||
| 77d35929ce | |||
| c6d5c4aae0 | |||
| d2a625eb41 | |||
| a67fa9b5e7 | |||
| 89cd4b59f8 | |||
| 4e8836cbec | |||
| 6e98f3bb5b | |||
| b6027f9e65 | |||
| 32618835c2 | |||
| daf89169c6 | |||
| 4886b53b5c | |||
| bd3332810a | |||
| 5ce29eb89c | |||
| 51f9d2cb9d | |||
| b88f4fccba | |||
| dc1d47d2c0 | |||
| 9c660f6425 | |||
| b9a7903f19 | |||
| 32a3bef6dd | |||
| 848feb5aa5 | |||
| 4806fa4d0d | |||
| aa1a610203 | |||
| cd2b183251 | |||
| a7c0f51b9b | |||
| 71c16d9558 | |||
| ff712ca8e1 | |||
| 83d5bcf70b | |||
| 9acd16a1a2 | |||
| 4e0dc03e96 | |||
| d964694d19 | |||
| 36533b01e1 | |||
| 6dd57816ee | |||
| 04b35d0422 | |||
| abeb02fc52 | |||
| 396d23cd06 | |||
| eee173af0b | |||
| e29143b089 | |||
| f7e16fec24 | |||
| 9f0df30493 | |||
| d3a429b1ea | |||
| f490ea658c | |||
| 180f5824dc | |||
| 716e5f0726 | |||
| e7e69065b6 | |||
| 203774c181 | |||
| f75076078c | |||
| d164146010 | |||
| 74fd255465 | |||
| 2a05a4c5f2 | |||
| 5f0e36eeb2 | |||
| 4584deeae0 | |||
| 2184d2ce0f | |||
| 53c3940c1a | |||
| fbacefe85c | |||
| ce9040950e | |||
| 30343ce753 | |||
| 5ebd885996 | |||
| a795db710f | |||
| 88e2ca5714 | |||
| ae34357023 | |||
| 9920685b8d | |||
| 68e66bc633 | |||
| baa6523766 | |||
| 5ce4046751 | |||
| b0bff4f8c3 | |||
| eaaaa59071 | |||
| 284cd96886 | |||
| 6930dd3603 | |||
| 0ae329c21d | |||
| 5acad30791 | |||
| d65f8a3812 | |||
| 560fee9698 | |||
| bd078f1b30 | |||
| 6f1fc2e6c2 | |||
| ce1b8e6762 | |||
| 9e291e62ed | |||
| a7415b53a4 | |||
| c7dc2be7d2 | |||
| 5210ca3eee | |||
| 2ebdf874eb | |||
| 95679f1d83 | |||
| d787ad0a95 | |||
| 1cd9bb3074 | |||
| 6e80c8b058 | |||
| 95a434d737 | |||
| 15c3463cec | |||
| 6897dffb57 | |||
| 474cd5fd86 | |||
| 4975681a97 | |||
| b17327456c | |||
| 5c722a770c | |||
| 4e1a3bf670 | |||
| ede592918c | |||
| a6116725c0 | |||
| d6f2a155fc | |||
| a344fb5969 | |||
| f79406418a | |||
| 53d23b511d | |||
| 0cf84da100 | |||
| 8248c3d9df | |||
| b66ac5d907 | |||
| c4fd7df086 | |||
| 8367f885ea | |||
| 5c13cec30b | |||
| 2399220cc5 | |||
| 7574cde264 | |||
| 96509d36ec | |||
| a3860d6036 | |||
| 1326d64a64 | |||
| 3b362071e5 | |||
| f5d7f50f44 | |||
| 55785040c9 | |||
| 6094db2b96 | |||
| 54ad5a3960 | |||
| e653478c50 | |||
| 0db8dbeef3 | |||
| d81d769e68 | |||
| b50f33365c | |||
| 5ec3848005 | |||
| bbb77b7658 | |||
| 9488d4bc48 | |||
| bad53a2e95 | |||
| ae4dfca5dd | |||
| 44f1a8bf29 | |||
| 79c564fc6e | |||
| 8856ce132d | |||
| 4910f91e8c | |||
| 30f40fc0fa | |||
| 9aadfd0cdf | |||
| 29bcfee0df | |||
| 7f3013cb06 | |||
| 2c258a3f3e | |||
| 8e124e6fac | |||
| 0ad3c20747 | |||
| 55790fb960 | |||
| 71c0def4f8 | |||
| 4f85283fb3 | |||
| 4d1197a34a | |||
| dce84a77fb | |||
| bc9745584b | |||
| ef0045a6dd | |||
| f36ad41c62 | |||
| 5550a608d6 | |||
| 76b5270d8f | |||
| 8a1339a859 | |||
| b51d9100e6 | |||
| b28d7c4a45 | |||
| 54f24c6074 | |||
| f177acfc4a | |||
| adb57991e8 | |||
| 7ae409af65 | |||
| 75e21adcec | |||
| fb39910402 | |||
| 5ef652b5aa | |||
| 4b5eeadee6 | |||
| 2e60748d5b | |||
| 616d8cb8a5 | |||
| 99a42ccadc | |||
| 82053cc9db | |||
| 6a6cbe48f0 | |||
| 61f24c70fb | |||
| 1d9b705a48 | |||
| 06025122c0 | |||
| ea7c76cc4b | |||
| 201b7b1a3d | |||
| 72c369ced3 | |||
| f302796bd2 | |||
| 6de8d778b7 | |||
| ced3c08a04 | |||
| f0d07ae6d3 | |||
| 0565f44a4c | |||
| aa19e77ac7 | |||
| 1ce2a07afd | |||
| 71575ff76a | |||
| 2b9e8facba | |||
| 70f2e54d06 | |||
| b9d348c328 | |||
| ba0b896b20 | |||
| 075c46c7b5 | |||
| dfd022e1a4 | |||
| f8f75d6d05 | |||
| 115616c6bf | |||
| b0b2591bc0 | |||
| 46305be082 | |||
| c5aff31327 | |||
| f6956dfcc9 | |||
| 456cdf3091 | |||
| 19e2d148a1 | |||
| 615bf36d88 | |||
| f640774684 | |||
| 72717f5178 | |||
| 752ad977db | |||
| 46eb55bb09 | |||
| 8b387c5fb4 | |||
| 578b29fa60 | |||
| 8b904a30e6 | |||
| 23ed067d68 | |||
| 52f4125558 | |||
| 5e65833d72 | |||
| 204308f4a7 | |||
| 50cfda10b1 | |||
| 034f89d824 | |||
| 958c3c12e5 | |||
| 75a382d292 | |||
| 9a3c2dc3b3 | |||
| dd1be49d5f | |||
| cdd62370d6 | |||
| d281be6aef | |||
| 3bc67ee6f9 | |||
| 7942b00eee | |||
| 657b4cb291 | |||
| 12ac7d2730 | |||
| 875a945123 | |||
| 582c2c136a | |||
| ec1ba12dfd | |||
| 6ad88b49ab | |||
| f0df3e3d6b | |||
| c90f5f3f3e | |||
| c4faeea067 | |||
| 8160f3423b | |||
| 17a0405c51 | |||
| 6c0b9214d8 | |||
| 2b613be823 | |||
| 66afc9a969 | |||
| ff30eddfdb | |||
| dd5c9d3cac | |||
| 903ea67505 | |||
| c2126a392f | |||
| bdfafb437e | |||
| 99e0666082 | |||
| a142b4234c | |||
| 25d90c7f92 | |||
| 93c55f5837 | |||
| fa96bcd10f | |||
| 2485f72d15 | |||
| 883d32356f | |||
| 31e600f227 | |||
| c3e7fdc83e | |||
| 86369858f7 | |||
| dd0fa0d34c | |||
| cb9b353fb3 | |||
| 916023b6e7 | |||
| 8dbc0d9605 | |||
| 154958aab9 | |||
| 6adfa966e0 | |||
| 730b94f4f7 | |||
| 7d1934202f | |||
| 132ba9d3fb | |||
| 436aba64c0 | |||
| 72109da6f1 | |||
| 3d870fc312 | |||
| 7a3b52ed87 | |||
| 3122132af8 | |||
| 09dd07d823 | |||
| 495f76571f | |||
| 7edb455330 | |||
| 3e1bf97188 | |||
| 092eb186e1 | |||
| aa1b2927c8 | |||
| e3acd17466 | |||
| a272835196 | |||
| 39567513eb | |||
| 03d65251cb | |||
| 1ce5064832 | |||
| 2afbc59293 | |||
| cd9558ca91 | |||
| 8e84e05429 | |||
| b4a5df49e6 | |||
| 1016a5425b | |||
| 48086040b7 | |||
| 2f683e6e76 | |||
| 069afa5a17 | |||
| 9aa7340eb2 | |||
| c5b9c3efac | |||
| f97aacb501 | |||
| 19ecc83acc | |||
| 8ff86bba70 | |||
| 6a3e04a48f | |||
| e8d6705fdd | |||
| 3bc11b88bf | |||
| 2607671f33 | |||
| cf57110c47 | |||
| 7540758076 | |||
| af207d18d7 | |||
| ccaefa3e39 | |||
| 988d39ba34 | |||
| 97debabc03 | |||
| 0315ac0a0f | |||
| e79a7be773 | |||
| d20a65b87c | |||
| 4e9cefbb84 | |||
| 5590771eb8 | |||
| 5b8b36ab11 | |||
| 20ed51796d | |||
| 71af8794bd | |||
| 30bf77808e | |||
| 4f05c99e17 | |||
| e55906c5eb | |||
| 19ac977b08 | |||
| 1e5d816838 | |||
| 29c2d11170 | |||
| 1578346dce | |||
| 8172e31a47 | |||
| 8a27e6da83 | |||
| 11db44e36a | |||
| eac2dd9d07 | |||
| 7d8567d57b | |||
| 07120a8a54 | |||
| 3ce4159414 | |||
| a173ed3838 | |||
| 8ca96f0fd6 | |||
| 532a44b76d | |||
| 3f299d3701 | |||
| 40f4d20c9d | |||
| 86be53e190 | |||
| a1adaac91a | |||
| 1dd0abc591 | |||
| 92b290e018 | |||
| 417093e247 | |||
| 60aa241594 | |||
| f411a412be | |||
| b07a33acec | |||
| 612e10e664 | |||
| 64dfe6349c | |||
| f7a4d05219 | |||
| eb4125c97d | |||
| 49f36f8c24 | |||
| 6e8f2c9913 | |||
| 2153f5a4f4 | |||
| e08f5aebd9 | |||
| 9faa71dc3e | |||
| b378eb1aa8 | |||
| 7b0cb98445 | |||
| c4b098f0d3 | |||
| 47ebcbd184 | |||
| 8d6610f3d5 | |||
| 4cf2abc24e | |||
| 56cf651fb2 | |||
| 2e85801083 | |||
| 904e12d047 | |||
| bbcfc3ca1e | |||
| 46d5343d95 | |||
| 81fb1210c4 | |||
| 0ffe586ae8 | |||
| 0877efe2eb | |||
| 696d6389e6 | |||
| dd3b14dad0 | |||
| e5069a41d5 | |||
| 90ecb574bb | |||
| ebb52da68e | |||
| 1a43e27d47 | |||
| c76d325b21 | |||
| 15a443dd0c | |||
| c8efee95f3 | |||
| 79f1d4c5c8 | |||
| 972acd734f | |||
| 80285206d2 | |||
| 0778831ecd | |||
| 3c09c378d4 | |||
| 2567aec36f | |||
| 509807e377 | |||
| c169c2c552 | |||
| baa5fdfebe | |||
| 5c7c147ff2 | |||
| 83d73fc9f2 | |||
| c1f0856adb | |||
| 7c428118f0 | |||
| a58163c9a3 | |||
| 779da7c858 | |||
| b19aafc76d | |||
| 931cdedc84 | |||
| be48ea648c | |||
| 082f7e9fdc | |||
| c48f84d9ea | |||
| 32f8274395 | |||
| 7e5dce0542 | |||
| 3921409859 | |||
| 60be2be68a | |||
| a13d8b958f | |||
| c0075d42c3 | |||
| 4f3b66bf7e | |||
| 8822fcd590 | |||
| 577cccfeff | |||
| c2f316fead | |||
| 5632c271b8 | |||
| 25b29a1ade | |||
| c034fd0c0c | |||
| 85f40acbe4 | |||
| 29d7e69f23 | |||
| 7fd9715d71 | |||
| e839100be1 | |||
| 8de4ab4740 | |||
| f37d72e5ca | |||
| af4837d122 | |||
| 68fc38865a | |||
| 5b44a7d595 | |||
| 8efa1ee4c6 | |||
| 1089aa9ff4 | |||
| 4b55284bd2 | |||
| 39de36a9c9 | |||
| f797a42069 | |||
| 4b47deee5a | |||
| 542eff9ba4 | |||
| fd6cde5981 | |||
| ab029ec0ac | |||
| c34f3ef817 | |||
| 32e308833c | |||
| 69c3e2eed6 | |||
| b1ec563a81 | |||
| ec61d7e6fc | |||
| 8e932e8c77 | |||
| 9e3e8e0980 | |||
| f9470ed187 | |||
| a4592234f8 | |||
| b669914963 | |||
| 14991d96d0 | |||
| 7baefe62ed | |||
| fc848485e0 | |||
| 4c7ec29e6d | |||
| bfef9c6a03 | |||
| b37528645a | |||
| 911010a9bf | |||
| c2930f841f | |||
| 9c45b68759 | |||
| 854a2309bd | |||
| c024fac54c | |||
| 06cc9bce51 | |||
| 0aa880e73c | |||
| 0cd682f048 | |||
| 52777fb459 | |||
| a47ea011b1 | |||
| 03f4a4317e | |||
| 2f618bd4a7 | |||
| 881c7eb784 | |||
| 58e771cbad | |||
| 92796224b8 | |||
| a6adf0322a | |||
| fe736641b2 | |||
| adc62ecfe5 | |||
| 1f3e4552d6 | |||
| 130e5b6a88 | |||
| 737f7e349d | |||
| e16fca40c9 | |||
| dc21576f58 | |||
| 8d5fc20eda | |||
| 91111c6237 | |||
| c265aebe9e | |||
| 79831b1443 | |||
| c64d296c94 | |||
| c6a258e3a5 | |||
| 1e4f641115 | |||
| 335305101f | |||
| d62e550ffa | |||
| f9ce416f62 | |||
| 6f95f43b6f | |||
| 159dc8877c | |||
| f59641e484 | |||
| dd02c9faa4 | |||
| 74ff650cf1 | |||
| 03aba30cd5 | |||
| 787d6d3763 | |||
| 5902ce9222 | |||
| 00f8567e88 | |||
| 5ef14ccc9c | |||
| 64e03b8347 | |||
| 602d975596 | |||
| bac6d8c85d | |||
| ff5a3e0737 | |||
| 7fd9902c38 | |||
| 3579a68b93 | |||
| 8423ed3042 | |||
| daa626b504 | |||
| bb86ae4c76 | |||
| ee0dc4f9bb | |||
| 451a72f750 | |||
| ee4bc9cb12 | |||
| 17617a2ee4 | |||
| 8a5f538e6f | |||
| 3560ed06f7 | |||
| 999b29dcc2 | |||
| 4597d5e03f | |||
| 77ea86302e | |||
| d85c0007a1 | |||
| e2be5c475c | |||
| 8328aff1d9 | |||
| eb5b3a41a9 | |||
| f8de062657 | |||
| ec9968e1d1 | |||
| 132df25505 | |||
| 3535176535 | |||
| ba19a298a1 | |||
| 5790e31ea4 | |||
| dc0ae98927 | |||
| e4dd1da67d | |||
| d7fcb38386 | |||
| 275c38a5d2 | |||
| bd5549b1bb | |||
| f58319f82a | |||
| e28608cd0b | |||
| 315a27bf08 | |||
| 6606f2befe | |||
| 234c263be0 | |||
| c15664bccd | |||
| 2de22eb079 | |||
| b64d148b97 | |||
| 2ef2fb1717 | |||
| db22529c27 | |||
| 365ea0d2a8 | |||
| 9c69ad077d | |||
| 543dba995c | |||
| 1850152029 | |||
| d44f75112a | |||
| fbd27e3cb5 | |||
| d00f9f7228 | |||
| efa085e43f | |||
| 4cb09ec637 | |||
| 35bb0027d0 | |||
| c136ac2029 | |||
| 2b11826fbe | |||
| cb55c530bd | |||
| 322359fd88 | |||
| c03edff16b | |||
| c87665f0d5 | |||
| 72a2725ecd | |||
| 756824b5fa | |||
| 2738b05af7 | |||
| 6c365287e7 | |||
| 8eeb1e83eb | |||
| a6a93d688d | |||
| ecf90d281e | |||
| 2f63f74693 | |||
| 5a82d90e4d | |||
| f60a5295fc | |||
| b403fb9f9c | |||
| c6adc8ce45 | |||
| 91b654ba6e | |||
| 61b4c5a2af | |||
| 8e31a6ad79 | |||
| 6290f577b5 | |||
| 736cb27d3a | |||
| 133ec09b80 | |||
| db765d9370 | |||
| baca06f06b | |||
| 77a9ec594a | |||
| 26737a89a2 | |||
| f33b47e151 | |||
| f86438e740 | |||
| df5f08b135 | |||
| 64ac0ff38d | |||
| 2dcbd3926c | |||
| 46d790c442 | |||
| 7d323b30bf | |||
| d52b3a3032 | |||
| 8921feff4c | |||
| 8220981b6e | |||
| b3d05af6ff | |||
| 4ee8010558 | |||
| ccf4eb9a51 | |||
| 7456be9e80 | |||
| ab9c0a4091 | |||
| a144ff653e | |||
| 661d2b4f5f | |||
| cecf203388 | |||
| 0c34c42043 | |||
| bf1cf97b0f | |||
| 1d463868d9 | |||
| 6a277399e1 | |||
| 2bb72299d3 | |||
| a495dea4ac | |||
| ab81a256e4 | |||
| 052047a15f | |||
| 54e884569b | |||
| 9e1020c52f | |||
| 63c4dbbc2b | |||
| 9a7d831cb1 | |||
| 3884f05739 | |||
| e56621118f | |||
| 3b15b67886 | |||
| dc2f9edcb7 | |||
| 08c7113336 | |||
| 5903117da5 | |||
| 587cb7fb30 | |||
| c77342e5cc | |||
| 3530fc5907 | |||
| 415c42da57 | |||
| 653745911f | |||
| 34b83ae6c5 | |||
| e81562f182 | |||
| 27ec1a7648 | |||
| 2e09531745 | |||
| b5b97ae43b | |||
| c7bcdb9360 | |||
| 5d12c6247f | |||
| e41fec73cb | |||
| 39b796fa52 | |||
| 15d5644b7d | |||
| 19ed02842c | |||
| c54238fdd6 | |||
| dcfc0bca13 | |||
| 56d0e7212b | |||
| fdcb8553b1 | |||
| 9e4f9933be | |||
| 9c6df6e541 | |||
| b99f8293f9 | |||
| f9ad60600e | |||
| d77292ccc4 | |||
| a75b412ecf | |||
| 225f9b58eb | |||
| f88588e4b0 | |||
| b19d2cc8ce | |||
| 6e992e1f3e | |||
| 62e781d63a | |||
| b2866e26a1 | |||
| 708aea8c8c | |||
| 36e51132c8 | |||
| bc60ff5e96 | |||
| 2b828c164b | |||
| afe57bf36d | |||
| 50a06f80a1 | |||
| 6614d14c34 | |||
| a802bfb0f3 | |||
| e29e14b4fd | |||
| 6b8a77502d | |||
| 150aa9b6db | |||
| fc6ca182d3 | |||
| 7f25092938 | |||
| 688ae774aa | |||
| 15f6808206 | |||
| f4775fe13a | |||
| 5b622e690e | |||
| 8ab37df1a7 | |||
| 8c34040d74 | |||
| c36fa453f1 | |||
| 98f930c793 | |||
| 904719079d | |||
| a613ff0ee4 | |||
| a551133493 | |||
| fb16fd44d7 | |||
| acc24cef18 | |||
| 03dc380ef5 | |||
| e13c06e192 | |||
| 91b0dba2a0 | |||
| a90246b760 | |||
| b339a8946b | |||
| 835d9e2505 | |||
| c32a0ee561 | |||
| fe6a7e1493 | |||
| 9a4098fdb5 | |||
| b01754cabf | |||
| ff3033f24f | |||
| 24a24f1f9e | |||
| 87126b2b59 | |||
| d20db6eb40 | |||
| 8d9655a282 | |||
| b2a845947e | |||
| 2bc32a36d1 | |||
| b2024b8153 | |||
| 4bf95c6c7b | |||
| 530631fee9 | |||
| ea29b88f78 | |||
| 206da76b26 | |||
| 2dec88fc41 | |||
| 67f33091f0 | |||
| 167d616bc2 | |||
| ea09b6e064 | |||
| cec297475f | |||
| f81384f785 | |||
| f8b8b24b6f | |||
| 8fcdcf6fd3 | |||
| 5cddf90389 | |||
| 2437a75a6b | |||
| 0f5edc4c89 | |||
| fb65c77c1a | |||
| 67c5081d14 | |||
| 0823114dff | |||
| 4d1f60d82e | |||
| cc3e5ba6f4 | |||
| abf108a9b1 | |||
| 8546bceeab | |||
| aa62fd8f65 | |||
| c8dff09d3a | |||
| ef0cabafb1 | |||
| a8638d7ff8 | |||
| 9de99a8efa | |||
| cc115790da | |||
| d52f893b35 | |||
| 8079570ccf | |||
| 1f2bed8e7d | |||
| b4c5bd5044 | |||
| b6c534ecf0 | |||
| 27128db8ee | |||
| a70007dbdf | |||
| 1145d32cb0 | |||
| 954a9f284e | |||
| f7136eba3e | |||
| d3bca730aa | |||
| c85a1c3c71 | |||
| 61b18cbde5 | |||
| 17f779fa62 | |||
| 3d029d27fc | |||
| 0a730cd2d0 | |||
| 2c66141c17 | |||
| b81813fa4e | |||
| e83b8c77c0 | |||
| e9261b6842 | |||
| a84fea58e1 | |||
| 1edde90d91 | |||
| b5b607cc1d | |||
| b62d42f0ef | |||
| 253e99ba17 | |||
| aa78b2688e | |||
| 28dd4475b7 | |||
| 647539632b | |||
| b2227703d7 | |||
| c4940b3605 | |||
| c0313240d2 | |||
| 3d30955a3b | |||
| 26d6e7faf0 | |||
| 95f700dd7e | |||
| d052f36af8 | |||
| 53b711e4f4 | |||
| 50e094865b | |||
| de7083094e | |||
| 33808ebfba | |||
| 8368d440dd | |||
| 3a25f3a020 | |||
| 0d9f5cb58a | |||
| f1dc2d882b | |||
| 2f075974b5 | |||
| 8729bc4dac | |||
| c52ef80f4e | |||
| 9be3de3b1d | |||
| 45d5afb10e | |||
| a5862a6de1 | |||
| 0f274641f1 | |||
| 16b6c8df89 | |||
| cd0ef26c02 | |||
| 45d78d7871 | |||
| bc02c6c05c | |||
| 83c75333ec | |||
| 609665d017 | |||
| a5f2a41cb3 | |||
| 8d22fdd09c | |||
| b0a89c4083 | |||
| 69723afcb1 | |||
| ba22751658 | |||
| e2800ed10d | |||
| e5d4b971fe | |||
| ff5b209fe4 | |||
| 0e051b1a27 | |||
| 1f9118834a | |||
| a5369eaa98 | |||
| 24b84cc762 | |||
| c9ce2d42e9 | |||
| b7a56cdfd7 | |||
| e2403f6066 | |||
| 05747e7670 | |||
| 5ba6ede53a | |||
| 515e3bde8c | |||
| 583873c133 | |||
| f816635465 | |||
| 59b3c51184 | |||
| f6738b78e9 | |||
| 5b22b4d7c7 | |||
| 71a7e47c81 | |||
| 708c250fe5 | |||
| 5c9b60b855 | |||
| 26694bee5c | |||
| 51bb4be6c4 | |||
| f0c063f8e9 | |||
| ef4530a187 | |||
| 59b49de355 | |||
| 59fc287024 | |||
| c4f32fd907 | |||
| f947eefa51 | |||
| 0c48c06061 | |||
| 312dad2578 | |||
| 002f9dbe38 | |||
| 0ef278af6b | |||
| 46b7d09f14 | |||
| c47bded0ae | |||
| 9b86de8260 | |||
| 73ff9439e6 | |||
| 7d92134da2 | |||
| 05ba4c29f4 | |||
| 1ab8661d80 | |||
| 51485d4ecd | |||
| 78156bbdcd | |||
| b99f434a88 | |||
| 17168e9ba1 | |||
| 2ec0d2f8d4 | |||
| 086753c08d | |||
| 85ddb11add | |||
| 5eba7f1cb4 | |||
| 1a96fef16d | |||
| 40a84bb18f | |||
| fd808f72c1 | |||
| 1801e6c601 | |||
| bfa82fbb3b | |||
| 4695b74771 | |||
| 1a5c687810 | |||
| 4b0822fa8e | |||
| 3ea4c91b75 | |||
| 0dbae78d4c | |||
| 8e95e5e34c | |||
| 033cf4c4b1 | |||
| bfa84c26b0 | |||
| 8788cf5a97 | |||
| f520ea9a76 | |||
| c46c9f4374 | |||
| 4b6ba537df | |||
| b853231920 | |||
| cf809bd16a | |||
| da6c00bd29 | |||
| 812e108103 | |||
| 3cb411ca22 | |||
| ebc8684307 | |||
| 0215527358 | |||
| 73e30d1d7b | |||
| b87545f0c8 | |||
| f976db5c4c | |||
| e44461151f | |||
| 4fec70b67d | |||
| 77ae260c77 | |||
| aa9a45d212 | |||
| 568fab148b | |||
| 597e112259 | |||
| d7e9e5db31 | |||
| 809e7e641c | |||
| 53e4bcbfee | |||
| 90eda6ef6b | |||
| 5b0af03afb | |||
| 4fe0e718d5 | |||
| 9398c591bf | |||
| 5fd1083d14 | |||
| 636352431f | |||
| 1996d42d9d | |||
| bf4c7370bf | |||
| 194ea70abb | |||
| aec3e66e54 | |||
| c740a053fd | |||
| 2f18984017 | |||
| 7695a2e0e4 | |||
| 37d136d0fb | |||
| 2beb6778b7 | |||
| 2a9f1c76d1 | |||
| c646e6f57a | |||
| ed34a53829 | |||
| 2327072563 | |||
| 420479d899 | |||
| e79bb5557e | |||
| b4f245b025 | |||
| 47b4192503 | |||
| a9a7599130 | |||
| a1f7e43452 | |||
| c3a3a0c424 | |||
| b8c3161281 | |||
| e8735f45f2 | |||
| b689510672 | |||
| bae83ddfbc | |||
| 943715c464 | |||
| f0a753c0a9 | |||
| 04bec267e4 | |||
| f49d8b7b1d | |||
| dff1694fe1 | |||
| 1ea4ed3eab | |||
| 36aebfae2a | |||
| 88b2fa6fbb | |||
| 235d440e5d | |||
| 57b0f533bb | |||
| ef7a230c31 | |||
| 71dc756286 | |||
| 36ad76e53d | |||
| 295ce1125e | |||
| 7f61a9ee15 | |||
| ab89f40385 | |||
| 9c69030ae4 | |||
| 802c9dfcbc | |||
| db1f7d2eac | |||
| c75533fd15 | |||
| 6c159e7de2 | |||
| cd1804fa38 | |||
| eaf2e7b9f7 | |||
| 91e8903699 | |||
| 5be9084add | |||
| f10c6c36fd | |||
| ab27fcd9e6 | |||
| 720e9130da | |||
| 554407d107 | |||
| 8a1992e2e4 | |||
| 1d5497ef7f | |||
| 232b73477a | |||
| a08a9ceee3 | |||
| a52d80e475 | |||
| ca16be06d5 | |||
| e67fd2c0bd | |||
| 64f29fb29e | |||
| 6275173bab | |||
| eb2c2dfb26 | |||
| b77c244290 | |||
| 3244d7a644 | |||
| f7555a54f3 | |||
| b4b0531433 | |||
| 76f847babc | |||
| bf4dae0c18 | |||
| b5846532fe | |||
| 8297dd6634 | |||
| 4a9d80cef1 | |||
| 663b59eb57 | |||
| 57f5044c9a | |||
| 56d3a469b2 | |||
| 52a04dbed1 | |||
| 69d5e084e0 | |||
| f830a8b1ba | |||
| 173d545466 | |||
| e17c82b0b9 | |||
| 15e26f0e64 | |||
| 4e73575703 | |||
| b22f00aea9 | |||
| d12246d2ee | |||
| 0b49ea2b83 | |||
| 832944a94a | |||
| 2b8586925d | |||
| 7fdd85b687 | |||
| 4a4a1a349f | |||
| 2a94525196 | |||
| e2723f6c05 | |||
| 27f5d9a06e | |||
| 7e6446b927 | |||
| df5f46dfc0 | |||
| e4fe479baf | |||
| bec7fb0563 | |||
| 2233ae150e | |||
| e5db31162d | |||
| 045d4e05a3 | |||
| e860009914 | |||
| 2089716959 | |||
| d28da9fad6 | |||
| 3161e9bac2 | |||
| 8158343004 | |||
| af73358d3f | |||
| 3a1e5d145a | |||
| e04a999028 | |||
| 557c44dc6c | |||
| 9c6b33b5f2 | |||
| f756953819 | |||
| 14e4538e5b | |||
| f0bcd8a1ee | |||
| 889584c42c | |||
| 11074f7829 | |||
| 45ea461990 | |||
| e745c94ca6 | |||
| 96be52fd38 | |||
| ac903c3673 | |||
| a51e501b6a | |||
| 71b567c329 | |||
| e65880ecf3 | |||
| 6a00ea0cdb | |||
| 6cfa2f9bec | |||
| 24bd599b45 | |||
| 3807daa68a | |||
| b598fa337c | |||
| 501a190546 | |||
| 1a501a1840 | |||
| 1da4fdd703 | |||
| 23e89196c0 | |||
| 4b422a33a0 | |||
| 205842d414 | |||
| 61088c7782 | |||
| ab3a1ef6d4 | |||
| 9f2ff3bcbf | |||
| 88ba64fd17 | |||
| be28486fb7 | |||
| badae65876 | |||
| b816319a28 | |||
| 13d185bf01 | |||
| 9e9f506329 | |||
| 5af6b23e5f | |||
| ca7d0c1dec | |||
| e3737a915d | |||
| c97f545ded |
+1
-1
@@ -105,7 +105,7 @@ SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp03
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
+2
-1
@@ -5,7 +5,8 @@ coverage:
|
||||
|
||||
ignore:
|
||||
- "tests/*"
|
||||
- "third_party/*"
|
||||
- "third_party/**/*"
|
||||
|
||||
comment:
|
||||
layout: "diff, flags, files"
|
||||
after_n_builds: 16
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
**Describe the bug** A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce** Information to reproduce the behavior, including:
|
||||
|
||||
**To Reproduce**
|
||||
Information to reproduce the behavior, including:
|
||||
1. Git commit id
|
||||
2. IEEE 802.15.4 hardware platform
|
||||
3. Build steps
|
||||
4. Network topology
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
**Expected behavior** A clear and concise description of what you expected to happen.
|
||||
|
||||
**Console/log output**
|
||||
If applicable, add console/log output to help explain your problem.
|
||||
**Console/log output** If applicable, add console/log output to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
**Additional context** Add any other context about the problem here.
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is.
|
||||
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is.
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
**Describe the solution you'd like** A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
**Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
**Additional context** Add any other context or screenshots about the feature request here.
|
||||
|
||||
@@ -0,0 +1,267 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: Build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
cancel-previous-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "github.ref != 'refs/heads/master'"
|
||||
|
||||
pretty:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get remove -y clang-6.0 libclang-common-6.0-dev libclang1-6.0 libllvm6.0
|
||||
sudo apt-get autoremove
|
||||
sudo apt-get --no-install-recommends install -y clang-tools clang-format-6.0 shellcheck
|
||||
python3 -m pip install yapf==0.29.0
|
||||
sudo snap install shfmt
|
||||
- name: Check
|
||||
run: |
|
||||
script/make-pretty check
|
||||
|
||||
cmake-version:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo pip3 install --system -U cmake==3.10.3
|
||||
cmake --version | grep 3.10.3
|
||||
sudo apt-get --no-install-recommends install -y ninja-build libreadline-dev libncurses-dev
|
||||
- name: Build
|
||||
run: |
|
||||
NODE_MODE=rcp ./script/test build
|
||||
|
||||
package:
|
||||
name: package-${{ matrix.compiler }}
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- compiler: gcc
|
||||
compiler_c: gcc
|
||||
compiler_cpp: g++
|
||||
- compiler: clang
|
||||
compiler_c: clang
|
||||
compiler_cpp: clang++
|
||||
env:
|
||||
CC: ${{ matrix.compiler_c }}
|
||||
CXX: ${{ matrix.compiler_cpp }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build libreadline-dev libncurses-dev
|
||||
- name: Package
|
||||
run: |
|
||||
script/test package
|
||||
|
||||
scan-build:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get remove -y clang-6.0 libclang-common-6.0-dev libclang1-6.0 libllvm6.0
|
||||
sudo apt-get autoremove
|
||||
sudo apt-get --no-install-recommends install -y clang-tools
|
||||
- name: Run
|
||||
run: |
|
||||
script/check-scan-build
|
||||
|
||||
arm-gcc:
|
||||
name: arm-gcc-${{ matrix.gcc_ver }}
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- gcc_ver: 4
|
||||
gcc_download_url: https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
|
||||
gcc_extract_dir: gcc-arm-none-eabi-4_9-2015q3
|
||||
- gcc_ver: 5
|
||||
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
|
||||
gcc_extract_dir: gcc-arm-none-eabi-5_4-2016q3
|
||||
- gcc_ver: 6
|
||||
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
|
||||
gcc_extract_dir: gcc-arm-none-eabi-6-2017-q2-update
|
||||
- gcc_ver: 7
|
||||
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
|
||||
gcc_extract_dir: gcc-arm-none-eabi-7-2018-q2-update
|
||||
- gcc_ver: 9
|
||||
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
|
||||
gcc_extract_dir: gcc-arm-none-eabi-9-2019-q4-major
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
cd /tmp
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lib32z1 ninja-build
|
||||
wget ${{ matrix.gcc_download_url }} -O gcc-arm.tar.bz2
|
||||
tar xjf gcc-arm.tar.bz2
|
||||
|
||||
# required for jn5189 and k32w061
|
||||
pip install pycryptodome
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=/tmp/${{ matrix.gcc_extract_dir }}/bin:$PATH
|
||||
script/check-arm-build
|
||||
|
||||
gcc:
|
||||
name: gcc-${{ matrix.gcc_ver }}
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
gcc_ver: [5, 6, 7, 8, 9]
|
||||
env:
|
||||
CC: gcc-${{ matrix.gcc_ver }}
|
||||
CXX: g++-${{ matrix.gcc_ver }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y gcc-${{ matrix.gcc_ver }} g++-${{ matrix.gcc_ver }} ninja-build libreadline-dev libncurses-dev
|
||||
- name: Build
|
||||
run: |
|
||||
script/check-simulation-build
|
||||
script/check-posix-build
|
||||
|
||||
clang:
|
||||
name: clang-${{ matrix.clang_ver }}
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
clang_ver: ["6.0", "7", "8", "9"]
|
||||
env:
|
||||
CC: clang-${{ matrix.clang_ver }}
|
||||
CXX: clang++-${{ matrix.clang_ver }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y clang-${{ matrix.clang_ver }} clang++-${{ matrix.clang_ver }} ninja-build libreadline-dev libncurses-dev
|
||||
- name: Build
|
||||
run: |
|
||||
script/check-simulation-build
|
||||
script/check-posix-build
|
||||
|
||||
clang-m32:
|
||||
name: clang-m32-${{ matrix.clang_ver }}
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
clang_ver: ["6.0", "7", "8", "9"]
|
||||
env:
|
||||
CC: clang-${{ matrix.clang_ver }}
|
||||
CXX: clang++-${{ matrix.clang_ver }}
|
||||
CFLAGS: -m32 -Wconversion
|
||||
CXXFLAGS: -m32 -Wconversion
|
||||
LDFLAGS: -m32
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y clang-${{ matrix.clang_ver }} clang++-${{ matrix.clang_ver }} g++-multilib ninja-build
|
||||
sudo apt-get --no-install-recommends install -y libreadline-dev:i386 libncurses-dev:i386
|
||||
- name: Build
|
||||
run: |
|
||||
script/check-simulation-build
|
||||
script/check-posix-build
|
||||
|
||||
gn:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
cd /tmp
|
||||
wget -O gn.zip https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest
|
||||
unzip -o gn.zip
|
||||
chmod a+x gn && mkdir -p bin && mv -f gn bin/
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=/tmp/bin:$PATH
|
||||
script/check-gn-build
|
||||
|
||||
macos-clang:
|
||||
runs-on: macos-10.15
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
brew install automake ninja llvm
|
||||
- name: Build
|
||||
run: |
|
||||
script/check-posix-build
|
||||
script/check-simulation-build
|
||||
|
||||
macos-gcc:
|
||||
runs-on: macos-10.15
|
||||
env:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
brew install automake ninja
|
||||
- name: Build
|
||||
run: |
|
||||
script/check-posix-build
|
||||
script/check-simulation-build
|
||||
|
||||
android:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: |
|
||||
docker run --rm -v $PWD:/build/openthread openthread/android-trusty /build/openthread/script/check-android-build
|
||||
@@ -0,0 +1,100 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: Docker
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
cancel-previous-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "github.ref != 'refs/heads/master'"
|
||||
|
||||
buildx:
|
||||
name: buildx-${{ matrix.docker_name }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- docker_name: environment
|
||||
- docker_name: codelab_otsim
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set up Docker Buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v3
|
||||
- name: Prepare
|
||||
id: prepare
|
||||
run: |
|
||||
DOCKER_IMAGE=openthread/${{ matrix.docker_name }}
|
||||
DOCKER_FILE=etc/docker/${{ matrix.docker_name }}/Dockerfile
|
||||
DOCKER_PLATFORMS=linux/amd64
|
||||
VERSION=latest
|
||||
|
||||
TAGS="--tag ${DOCKER_IMAGE}:${VERSION}"
|
||||
|
||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||
echo ::set-output name=version::${VERSION}
|
||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
|
||||
--build-arg VERSION=${VERSION} \
|
||||
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
||||
--build-arg VCS_REF=${GITHUB_SHA::8} \
|
||||
${TAGS} --file ${DOCKER_FILE} .
|
||||
|
||||
- name: Docker Buildx (build)
|
||||
run: |
|
||||
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
|
||||
|
||||
- name: Docker Login
|
||||
if: success() && github.repository == 'openthread/openthread' && github.event_name != 'pull_request'
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
run: |
|
||||
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
|
||||
|
||||
- name: Docker Buildx (push)
|
||||
if: success() && github.repository == 'openthread/openthread' && github.event_name != 'pull_request'
|
||||
run: |
|
||||
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
|
||||
|
||||
- name: Docker Check Manifest
|
||||
if: always() && github.repository == 'openthread/openthread' && github.event_name != 'pull_request'
|
||||
run: |
|
||||
docker run --rm mplatform/mquery ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
|
||||
|
||||
- name: Clear
|
||||
if: always() && github.repository == 'openthread/openthread' && github.event_name != 'pull_request'
|
||||
run: |
|
||||
rm -f ${HOME}/.docker/config.json
|
||||
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: CIFuzz
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'openthread'
|
||||
dry-run: false
|
||||
- name: Run Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'openthread'
|
||||
fuzz-seconds: 1800
|
||||
dry-run: false
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v1
|
||||
if: failure()
|
||||
with:
|
||||
name: artifacts
|
||||
path: ./out/artifacts
|
||||
@@ -0,0 +1,175 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: POSIX
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
cancel-previous-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "github.ref != 'refs/heads/master'"
|
||||
|
||||
|
||||
posix-cli:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
PYTHONUNBUFFERED: 1
|
||||
READLINE: readline
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
VIRTUAL_TIME_UART: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y libreadline6-dev python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
make -f src/posix/Makefile-posix
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 OT_CLI_PATH="$(pwd)/$(ls output/posix/*/bin/ot-cli) -v" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" make -f src/posix/Makefile-posix check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
posix-ncp:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
NODE_TYPE: ncp-sim
|
||||
PYTHONUNBUFFERED: 1
|
||||
READLINE: readline
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
VIRTUAL_TIME_UART: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y libreadline6-dev python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
sudo python3 -m pip install git+https://github.com/openthread/pyspinel
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
make -f src/posix/Makefile-posix
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 OT_NCP_PATH="$(pwd)/$(ls output/posix/*/bin/ot-ncp)" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" make -f src/posix/Makefile-posix check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
posix-ncp-rcp-migrate:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y expect
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
script/check-ncp-rcp-migrate build
|
||||
- name: Run
|
||||
run: |
|
||||
script/check-ncp-rcp-migrate check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
posix-pty:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y socat expect
|
||||
cd /tmp
|
||||
wget https://github.com/obgm/libcoap/archive/bsd-licensed.tar.gz
|
||||
tar xvf bsd-licensed.tar.gz
|
||||
cd libcoap-bsd-licensed
|
||||
./autogen.sh
|
||||
./configure --prefix= --exec-prefix=/usr --with-boost=internal --disable-tests --disable-documentation
|
||||
make -j2
|
||||
sudo make install
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
script/check-posix-pty build
|
||||
- name: Run
|
||||
run: |
|
||||
script/check-posix-pty check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
posix-pty-daemon:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
DAEMON: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y socat expect
|
||||
cd /tmp
|
||||
wget https://github.com/obgm/libcoap/archive/bsd-licensed.tar.gz
|
||||
tar xvf bsd-licensed.tar.gz
|
||||
cd libcoap-bsd-licensed
|
||||
./autogen.sh
|
||||
./configure --prefix= --exec-prefix=/usr --with-boost=internal --disable-tests --disable-documentation
|
||||
make -j2
|
||||
sudo make install
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
script/check-posix-pty build
|
||||
- name: Run
|
||||
run: |
|
||||
script/check-posix-pty check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
@@ -0,0 +1,91 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: Simulation 1.2
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
cancel-previous-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "github.ref != 'refs/heads/master'"
|
||||
|
||||
thread-1-2:
|
||||
name: thread-1-2-${{ matrix.compiler.c }}-${{ matrix.arch }}
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CFLAGS: -${{ matrix.arch }}
|
||||
CXXFLAGS: -${{ matrix.arch }}
|
||||
LDFLAGS: -${{ matrix.arch }}
|
||||
COVERAGE: 1
|
||||
THREAD_VERSION: 1.2
|
||||
VIRTUAL_TIME: 1
|
||||
CC: ${{ matrix.compiler.c }}
|
||||
CXX: ${{ matrix.compiler.cxx }}
|
||||
strategy:
|
||||
matrix:
|
||||
compiler: [{c: "gcc", cxx: "g++"}, { c: "clang", cxx: "clang++"}]
|
||||
arch: ["m32", "m64"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib ninja-build python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
./script/test build
|
||||
- name: Run
|
||||
run: |
|
||||
./script/test unit
|
||||
./script/test cert_suite tests/scripts/thread-cert/v1_2_*
|
||||
- name: Keep-1-2-only
|
||||
run: |
|
||||
./script/test tar 1.1
|
||||
./script/test tar 1.2-bbr
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
- name: Keep-1-2-bbr-only
|
||||
run: |
|
||||
./script/test tar 1.2
|
||||
./script/test untar 1.2-bbr
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
- name: Keep-1-1-only
|
||||
run: |
|
||||
./script/test tar 1.2-bbr
|
||||
./script/test untar 1.1
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
@@ -0,0 +1,347 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: Simulation
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
cancel-previous-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "github.ref != 'refs/heads/master'"
|
||||
|
||||
distcheck:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y llvm-runtime python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
- name: Run
|
||||
run: |
|
||||
export ASAN_SYMBOLIZER_PATH=`which llvm-symbolizer`
|
||||
export ASAN_OPTIONS=symbolize=1
|
||||
export DISTCHECK_CONFIGURE_FLAGS= CPPFLAGS=-DOPENTHREAD_SIMULATION_VIRTUAL_TIME=1
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation distcheck
|
||||
|
||||
cli-ftd-otns:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CFLAGS: -m32
|
||||
CXXFLAGS: -m32
|
||||
LDFLAGS: -m32
|
||||
COVERAGE: 1
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.13'
|
||||
- name: Set up Python 3.6
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.6
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib
|
||||
./bootstrap
|
||||
- name: Run OTNS Tests
|
||||
run: |
|
||||
git clone https://github.com/openthread/ot-ns.git --depth 1 --branch master ~/otns
|
||||
export OT_DIR=$PWD
|
||||
cd ~/otns
|
||||
./script/test py-unittests py-examples
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
|
||||
packet-verification:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
PACKET_VERIFICATION: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel ninja-build
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
- name: Build
|
||||
run: |
|
||||
./script/test build
|
||||
- name: Run
|
||||
run: |
|
||||
for i in {1..10}
|
||||
do
|
||||
./script/test cert_suite ./tests/scripts/thread-cert/Cert_*.py
|
||||
done
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
|
||||
cli-ftd:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CFLAGS: -m32
|
||||
CXXFLAGS: -m32
|
||||
LDFLAGS: -m32
|
||||
COVERAGE: 1
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 make -f examples/Makefile-simulation check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
cli-mtd:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CFLAGS: -m32
|
||||
CXXFLAGS: -m32
|
||||
LDFLAGS: -m32
|
||||
COVERAGE: 1
|
||||
REFERENCE_DEVICE: 1
|
||||
USE_MTD: 1
|
||||
VIRTUAL_TIME: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 make -f examples/Makefile-simulation check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
cli-time-sync:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CFLAGS: -m32
|
||||
CXXFLAGS: -m32
|
||||
LDFLAGS: -m32
|
||||
COVERAGE: 1
|
||||
REFERENCE_DEVICE: 1
|
||||
TIME_SYNC: 1
|
||||
VIRTUAL_TIME: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 make -f examples/Makefile-simulation check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
expects:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CFLAGS: -DCLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER=1 -DOPENTHREAD_CONFIG_MLE_MAX_CHILDREN=15
|
||||
CXXFLAGS: -DCLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER=1 -DOPENTHREAD_CONFIG_MLE_MAX_CHILDREN=15
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
OT_OPTIONS=-DOT_READLINE=OFF sudo apt-get --no-install-recommends install -y expect ninja-build
|
||||
- name: Run
|
||||
run: |
|
||||
OT_OPTIONS=-DOT_TIME_SYNC=ON VIRTUAL_TIME=0 ./script/test build expect
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
- name: Run RCP Mode
|
||||
run: |
|
||||
OT_OPTIONS=-DOT_READLINE=OFF VIRTUAL_TIME=0 NODE_MODE=rcp ./script/test clean build expect
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
- name: Run TUN Mode
|
||||
run: |
|
||||
sudo apt-get install --no-install-recommends -y dnsmasq bind9-host ntp
|
||||
sudo systemctl start dnsmasq ntp
|
||||
host ipv6.google.com 127.0.0.1
|
||||
echo 'listen-address=::1' | sudo tee /etc/dnsmasq.conf
|
||||
echo 0 | sudo tee /proc/sys/net/ipv6/conf/all/disable_ipv6
|
||||
sudo systemctl restart dnsmasq
|
||||
host ipv6.google.com ::1
|
||||
OT_OPTIONS=-DOT_READLINE=OFF OT_NATIVE_IP=1 VIRTUAL_TIME=0 NODE_MODE=rcp ./script/test clean build expect
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
external-commissioner:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/*
|
||||
sudo apt-get install avahi-daemon avahi-utils -y
|
||||
git clone https://github.com/openthread/ot-commissioner.git /tmp/ot-commissioner --depth 1 --branch master
|
||||
- name: Build
|
||||
run: |
|
||||
cd /tmp/ot-commissioner
|
||||
script/bootstrap.sh
|
||||
cmake -GNinja \
|
||||
-DCMAKE_CXX_STANDARD=11 \
|
||||
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-DOT_COMM_COVERAGE=ON \
|
||||
-DOT_COMM_CCM=OFF \
|
||||
-S . -B build
|
||||
cmake --build build
|
||||
sudo cmake --install build
|
||||
- name: Run
|
||||
run: |
|
||||
export OT_COMM_OPENTHREAD="$(pwd)"
|
||||
cd /tmp/ot-commissioner/tests/integration
|
||||
./bootstrap.sh
|
||||
./run_tests.sh
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
multiple-instance:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
MULTIPLE_INSTANCE: 1
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo apt-get --no-install-recommends install -y python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 make -f examples/Makefile-simulation check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
ncp-gcc-m32:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CFLAGS: -m32
|
||||
CXXFLAGS: -m32
|
||||
LDFLAGS: -m32
|
||||
COVERAGE: 1
|
||||
NODE_TYPE: ncp-sim
|
||||
PYTHONUNBUFFERED: 1
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
sudo python3 -m pip install git+https://github.com/openthread/pyspinel
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 make -f examples/Makefile-simulation check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
ncp-clang:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
NODE_TYPE: ncp-sim
|
||||
PYTHONUNBUFFERED: 1
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y python3-setuptools python3-wheel
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
sudo python3 -m pip install git+https://github.com/openthread/pyspinel
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 make -f examples/Makefile-simulation check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
@@ -0,0 +1,58 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: Size
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
cancel-previous-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "github.ref != 'refs/heads/master'"
|
||||
|
||||
size-report:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
if: "github.event_name == 'push'"
|
||||
run: |
|
||||
python3 -m pip install --upgrade setuptools wheel
|
||||
python3 -m pip install mdv
|
||||
- name: Run
|
||||
env:
|
||||
OT_BASE_BRANCH: "${{ github.base_ref }}"
|
||||
SIZE_REPORT_URL: "https://openthread-size-report.glitch.me/size-report/1354027"
|
||||
run: |
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
./script/check-size
|
||||
@@ -0,0 +1,98 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: Toranj
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
cancel-previous-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "github.ref != 'refs/heads/master'"
|
||||
|
||||
toranj-ncp:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y dbus libdbus-1-dev
|
||||
sudo apt-get --no-install-recommends install -y autoconf-archive
|
||||
sudo apt-get --no-install-recommends install -y bsdtar
|
||||
sudo apt-get --no-install-recommends install -y libtool
|
||||
sudo apt-get --no-install-recommends install -y libglib2.0-dev
|
||||
sudo apt-get --no-install-recommends install -y libboost-dev libboost-signals-dev
|
||||
|
||||
git clone --depth=1 --branch=master https://github.com/openthread/wpantund.git
|
||||
cd wpantund
|
||||
./bootstrap.sh
|
||||
./configure
|
||||
sudo make -j2
|
||||
sudo make install
|
||||
- name: Build & Run
|
||||
run: |
|
||||
top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
toranj-rcp:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
TORANJ_POSIX_RCP_MODEL: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y dbus libdbus-1-dev
|
||||
sudo apt-get --no-install-recommends install -y autoconf-archive
|
||||
sudo apt-get --no-install-recommends install -y bsdtar
|
||||
sudo apt-get --no-install-recommends install -y libtool
|
||||
sudo apt-get --no-install-recommends install -y libglib2.0-dev
|
||||
sudo apt-get --no-install-recommends install -y libboost-dev libboost-signals-dev
|
||||
|
||||
git clone --depth=1 --branch=master https://github.com/openthread/wpantund.git
|
||||
cd wpantund
|
||||
./bootstrap.sh
|
||||
./configure
|
||||
sudo make -j2
|
||||
sudo make install
|
||||
- name: Build & Run
|
||||
run: |
|
||||
top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
name: API Version
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
cancel-previous-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "github.ref != 'refs/heads/master'"
|
||||
|
||||
api-version:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check
|
||||
run: |
|
||||
script/check-api-version
|
||||
+9
-2
@@ -8,10 +8,14 @@
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
*.ninja*
|
||||
*.opendb
|
||||
*.orig
|
||||
*.pyc
|
||||
*.suo
|
||||
*.swn
|
||||
*.swo
|
||||
*.swp
|
||||
*.trs
|
||||
*.user
|
||||
*.bak
|
||||
@@ -25,13 +29,15 @@
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
build
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
cmake_install.cmake
|
||||
configure
|
||||
config.log
|
||||
config.status
|
||||
doc/Doxyfile
|
||||
doc/html
|
||||
etc/visual-studio/BundleArtifacts
|
||||
etc/visual-studio/Generated Files
|
||||
etc/cmake/openthread-config-generic.h
|
||||
include/openthread-config.h
|
||||
include/openthread-config.h.in
|
||||
include/openthread-config-generic.h
|
||||
@@ -51,3 +57,4 @@ third_party/nlbuild-autotools/repo/third_party/autoconf/m4/ltsugar.m4
|
||||
third_party/nlbuild-autotools/repo/third_party/autoconf/m4/ltversion.m4
|
||||
third_party/nlbuild-autotools/repo/third_party/autoconf/m4/lt~obsolete.m4
|
||||
third_party/nlbuild-autotools/repo/third_party/autoconf/missing
|
||||
/tmp/
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
buildconfig = "//third_party/build_gn/BUILDCONFIG.gn"
|
||||
|
||||
check_system_includes = true
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/prettierrc",
|
||||
"printWidth": 80,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"proseWrap": "never"
|
||||
}
|
||||
-190
@@ -1,190 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
language: python
|
||||
python: "3.6"
|
||||
|
||||
sudo: required
|
||||
dist: bionic
|
||||
|
||||
before_install:
|
||||
- travis_retry .travis/before_install.sh
|
||||
|
||||
before_script:
|
||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
||||
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
|
||||
fi
|
||||
|
||||
after_success:
|
||||
- .travis/after_success.sh
|
||||
|
||||
stages:
|
||||
- lint
|
||||
- test
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- env: BUILD_TARGET="posix-app-cli" VERBOSE=1 VIRTUAL_TIME=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix-app-pty" VERBOSE=1 COVERAGE=1
|
||||
os: linux
|
||||
compiler: clang
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix-app-pty" DAEMON=1 VERBOSE=1 COVERAGE=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="android-build" VERBOSE=1
|
||||
os: linux
|
||||
dist: trusty
|
||||
python: "2.7" # The old Android build system only supports python2
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix-distcheck" VERBOSE=1 VIRTUAL_TIME=1
|
||||
os: linux
|
||||
compiler: clang
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1 VIRTUAL_TIME=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix-32-bit" VERBOSE=1 VIRTUAL_TIME=1 TIME_SYNC=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix-ncp" VERBOSE=1 VIRTUAL_TIME=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix-mtd" VERBOSE=1 VIRTUAL_TIME=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="scan-build"
|
||||
os: linux
|
||||
compiler: clang
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="arm-gcc-4"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="arm-gcc-5"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="arm-gcc-6"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="arm-gcc-7"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
# Disable Arm GCC 8 until slow compile bug is fixed:
|
||||
# https://github.com/openthread/openthread/issues/4053
|
||||
# - env: BUILD_TARGET="arm-gcc-8"
|
||||
# os: linux
|
||||
# compiler: gcc
|
||||
# script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix" CC="gcc-5" CXX="g++-5"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-5
|
||||
- g++-5
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix" CC="gcc-6" CXX="g++-6"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-6
|
||||
- g++-6
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix" CC="gcc-7" CXX="g++-7"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-7
|
||||
- g++-7
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix" CC="gcc-8" CXX="g++-8"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-8
|
||||
- g++-8
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix" CC="gcc-9" CXX="g++-9"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: "ppa:ubuntu-toolchain-r/test"
|
||||
packages:
|
||||
- gcc-9
|
||||
- g++-9
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="posix-ncp-spi" VERBOSE=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1 TORANJ_POSIX_APP_RCP_MODEL=1
|
||||
os: linux
|
||||
compiler: gcc
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="osx" VERBOSE=1
|
||||
os: osx
|
||||
language: generic
|
||||
script: .travis/script.sh
|
||||
- stage: lint
|
||||
name: "Pretty Check"
|
||||
os: linux
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-format-6.0
|
||||
script: .travis/check-pretty
|
||||
- env:
|
||||
name: "Size Report"
|
||||
os: linux
|
||||
script: .travis/check-size
|
||||
if: type = pull_request
|
||||
@@ -1,147 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2016, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
[ -n "$BUILD_TARGET" ] || exit 0
|
||||
|
||||
die() {
|
||||
echo " *** ERROR: " $*
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
cd /tmp || die
|
||||
|
||||
[ $TRAVIS_OS_NAME != linux ] || {
|
||||
(cd /etc/apt/sources.list.d && sudo rm -rf cassandra.list* couchdb.list* mongodb-3.4.list* rabbitmq_rabbitmq-server.list* chris-lea-redis-server.list* github_git-lfs.list* pgdg.list)
|
||||
sudo apt-get update || die
|
||||
|
||||
[ $BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-app-cli -a $BUILD_TARGET != posix-mtd -a $BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ] || {
|
||||
pip install --upgrade pip || die
|
||||
pip install -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
|
||||
[ $BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ] || {
|
||||
# Packages used by ncp tools.
|
||||
pip install git+https://github.com/openthread/pyspinel || die
|
||||
}
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != android-build ] || {
|
||||
sudo apt-get install -y bison gcc-multilib g++-multilib
|
||||
(
|
||||
cd $HOME
|
||||
wget https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip
|
||||
unzip android-ndk-r17c-linux-x86_64.zip > /dev/null
|
||||
mv android-ndk-r17c ndk-bundle
|
||||
) || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-app-pty ] || {
|
||||
sudo apt-get install socat expect || die
|
||||
JOBS=$(getconf _NPROCESSORS_ONLN)
|
||||
(
|
||||
LIBCOAP_TMPDIR=/tmp/libcoap
|
||||
mkdir $LIBCOAP_TMPDIR
|
||||
cd $LIBCOAP_TMPDIR
|
||||
wget https://github.com/obgm/libcoap/archive/bsd-licensed.tar.gz
|
||||
tar xvf bsd-licensed.tar.gz
|
||||
cd libcoap-bsd-licensed
|
||||
./autogen.sh
|
||||
./configure --prefix= --exec-prefix=/usr --with-boost=internal --disable-tests --disable-documentation
|
||||
make -j $JOBS
|
||||
sudo make install
|
||||
) || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-4 ] || {
|
||||
sudo apt-get install lib32z1 || die
|
||||
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-5 ] || {
|
||||
sudo apt-get install lib32z1 || die
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-6 ] || {
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-7 ] || {
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-8 ] || {
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2018q4/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-mtd ] || {
|
||||
sudo apt-get install g++-multilib || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-distcheck ] || {
|
||||
sudo apt-get install llvm-runtime || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != toranj-test-framework ] || {
|
||||
# packages for wpantund
|
||||
sudo apt-get install dbus || die
|
||||
sudo apt-get install gcc g++ libdbus-1-dev || die
|
||||
sudo apt-get install autoconf-archive || die
|
||||
sudo apt-get install bsdtar || die
|
||||
sudo apt-get install libtool || die
|
||||
sudo apt-get install libglib2.0-dev || die
|
||||
sudo apt-get install libboost-dev || die
|
||||
sudo apt-get install libboost-signals-dev || die
|
||||
|
||||
# clone and build wpantund
|
||||
git clone --depth=1 --branch=master https://github.com/openthread/wpantund.git
|
||||
cd wpantund || die
|
||||
./bootstrap.sh || die
|
||||
./configure || die
|
||||
sudo make -j 8 || die
|
||||
sudo make install || die
|
||||
cd .. || die
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2018, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
#
|
||||
# Run this command on parent directory of openthread
|
||||
#
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
#######################################
|
||||
# Prepare android build system
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# None
|
||||
#######################################
|
||||
android_prepare_build_system()
|
||||
{
|
||||
# Android build system
|
||||
(mkdir build && cd build && git init && git pull --depth 1 https://android.googlesource.com/platform/build 2db32730e79cafcf13e1f898a7bee7f82b0449d6)
|
||||
ln -s build/core/main.mk Makefile
|
||||
|
||||
# Workarounds for java checking
|
||||
export ANDROID_JAVA_HOME=/usr/lib/jvm/java-8-oracle
|
||||
mkdir bin
|
||||
cat > bin/java <<EOF
|
||||
#!/bin/sh
|
||||
echo java version \"1.6\"
|
||||
EOF
|
||||
|
||||
cat > bin/javac <<EOF
|
||||
echo javac \"1.6\"
|
||||
EOF
|
||||
chmod a+x bin/java bin/javac
|
||||
export PATH=$(pwd)/bin:$PATH
|
||||
|
||||
# Files for building ndk
|
||||
mkdir -p system/core/include/arch/linux-arm
|
||||
touch system/core/include/arch/linux-arm/AndroidConfig.h
|
||||
|
||||
mkdir -p system/core/include/arch/linux-x86
|
||||
touch system/core/include/arch/linux-x86/AndroidConfig.h
|
||||
|
||||
ANDROID_NDK_PATH=$HOME/ndk-bundle
|
||||
mkdir -p bionic/libc/
|
||||
cp -r $ANDROID_NDK_PATH/sysroot/usr/include bionic/libc/include
|
||||
mv bionic/libc/include/arm-linux-androideabi/asm bionic/libc/include/asm
|
||||
|
||||
mkdir -p out/target/product/generic/obj/
|
||||
cp -r $ANDROID_NDK_PATH/platforms/android-27/arch-arm/usr/lib out/target/product/generic/obj/
|
||||
|
||||
mkdir -p bionic/libstdc++
|
||||
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/include bionic/libstdc++
|
||||
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include/* bionic/libstdc++/include
|
||||
# The default libstdc++.so does not contain full stl implementation, see https://developer.android.com/ndk/guides/cpp-support
|
||||
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so out/target/product/generic/obj/lib/libstdc++.so
|
||||
|
||||
# Build spec
|
||||
cat > buildspec.mk <<EOF
|
||||
TARGET_PRODUCT := generic
|
||||
TARGET_BUILD_VARIANT := eng
|
||||
TARGET_BUILD_TYPE := release
|
||||
TARGET_TOOLS_PREFIX := $ANDROID_NDK_PATH/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
|
||||
EOF
|
||||
}
|
||||
|
||||
main() {
|
||||
android_prepare_build_system
|
||||
|
||||
make showcommands ot-core
|
||||
make showcommands ot-cli
|
||||
make showcommands ot-ncp
|
||||
make showcommands spi-hdlc-adapter
|
||||
|
||||
test -x out/target/product/generic/system/bin/ot-cli
|
||||
test -x out/target/product/generic/system/bin/ot-ncp
|
||||
test -x out/target/product/generic/system/bin/spi-hdlc-adapter
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,116 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set -e -x -o pipefail
|
||||
|
||||
setup_arm_gcc_7()
|
||||
{
|
||||
if arm-none-eabi-gcc --version | grep -q 'Arm Embedded Processors 7'; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
(cd /tmp/
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
|
||||
tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2)
|
||||
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH
|
||||
|
||||
arm-none-eabi-gcc --version
|
||||
}
|
||||
|
||||
size_nrf52840()
|
||||
{
|
||||
[ ${TRAVIS_PULL_REQUEST} != false ]
|
||||
|
||||
mkdir ../output
|
||||
|
||||
export MERGE_BASE_SHA=$(git merge-base HEAD ${TRAVIS_BRANCH})
|
||||
|
||||
# pull request
|
||||
OPENTHREAD_FLAGS="BORDER_AGENT=1 BORDER_ROUTER=1 CHANNEL_MANAGER=1 CHANNEL_MONITOR=1 CHILD_SUPERVISION=1 COAP=1 COAPS=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DIAGNOSTIC=1 DISABLE_DOC=1 DNS_CLIENT=1 ECDSA=1 FULL_LOGS=1 JAM_DETECTION=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 SLAAC=1 SNTP_CLIENT=1 TIME_SYNC=1 UDP_FORWARD=1"
|
||||
|
||||
git checkout -- .
|
||||
git clean -xfd
|
||||
./bootstrap
|
||||
make -f examples/Makefile-nrf52840 ${OPENTHREAD_FLAGS}
|
||||
mv output/nrf52840 ../output/nrf52840-b
|
||||
|
||||
git checkout -f ${MERGE_BASE_SHA}
|
||||
git submodule update --init
|
||||
|
||||
# base branch
|
||||
git checkout -- .
|
||||
git clean -xfd
|
||||
./bootstrap
|
||||
make -f examples/Makefile-nrf52840 ${OPENTHREAD_FLAGS}
|
||||
mv output/nrf52840 ../output/nrf52840-a
|
||||
|
||||
curl -s "${SIZE_REPORT_URL}/bash" > size-report
|
||||
chmod a+x size-report
|
||||
|
||||
./size-report init OpenThread
|
||||
|
||||
./size-report size ../output/nrf52840-a/bin/ot-cli-ftd ../output/nrf52840-b/bin/ot-cli-ftd
|
||||
./size-report size ../output/nrf52840-a/bin/ot-cli-mtd ../output/nrf52840-b/bin/ot-cli-mtd
|
||||
./size-report size ../output/nrf52840-a/bin/ot-ncp-ftd ../output/nrf52840-b/bin/ot-ncp-ftd
|
||||
./size-report size ../output/nrf52840-a/bin/ot-ncp-mtd ../output/nrf52840-b/bin/ot-ncp-mtd
|
||||
./size-report size ../output/nrf52840-a/bin/ot-rcp ../output/nrf52840-b/bin/ot-rcp
|
||||
|
||||
./size-report size ../output/nrf52840-a/lib/libopenthread-cli-ftd.a ../output/nrf52840-b/lib/libopenthread-cli-ftd.a
|
||||
./size-report size ../output/nrf52840-a/lib/libopenthread-cli-mtd.a ../output/nrf52840-b/lib/libopenthread-cli-mtd.a
|
||||
./size-report size ../output/nrf52840-a/lib/libopenthread-ftd.a ../output/nrf52840-b/lib/libopenthread-ftd.a
|
||||
./size-report size ../output/nrf52840-a/lib/libopenthread-mtd.a ../output/nrf52840-b/lib/libopenthread-mtd.a
|
||||
./size-report size ../output/nrf52840-a/lib/libopenthread-ncp-ftd.a ../output/nrf52840-b/lib/libopenthread-ncp-ftd.a
|
||||
./size-report size ../output/nrf52840-a/lib/libopenthread-ncp-mtd.a ../output/nrf52840-b/lib/libopenthread-ncp-mtd.a
|
||||
./size-report size ../output/nrf52840-a/lib/libopenthread-rcp.a ../output/nrf52840-b/lib/libopenthread-rcp.a
|
||||
./size-report size ../output/nrf52840-a/lib/libopenthread-radio.a ../output/nrf52840-b/lib/libopenthread-radio.a
|
||||
|
||||
./size-report post
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
case $1 in
|
||||
setup)
|
||||
setup_arm_gcc_7
|
||||
;;
|
||||
nrf52840)
|
||||
size_nrf52840
|
||||
;;
|
||||
'')
|
||||
setup_arm_gcc_7
|
||||
size_nrf52840
|
||||
;;
|
||||
*)
|
||||
echo "USAGE: $0 [setup|nrf52840]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,481 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2016, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
die() {
|
||||
echo " *** ERROR: " $*
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
python --version || die
|
||||
|
||||
[ $BUILD_TARGET != scan-build ] || {
|
||||
./bootstrap || die
|
||||
|
||||
export CPPFLAGS="-DMBEDTLS_DEBUG_C"
|
||||
export CPPFLAGS="${CPPFLAGS} -I${TRAVIS_BUILD_DIR}/third_party/mbedtls"
|
||||
export CPPFLAGS="${CPPFLAGS} -I${TRAVIS_BUILD_DIR}/third_party/mbedtls/repo/include"
|
||||
export CPPFLAGS="${CPPFLAGS} -DMBEDTLS_CONFIG_FILE=\\\"mbedtls-config.h\\\""
|
||||
|
||||
# UART transport
|
||||
export CPPFLAGS="${CPPFLAGS} \
|
||||
-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1"
|
||||
|
||||
scan-build ./configure \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--enable-cli \
|
||||
--enable-executable=no \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--with-examples=posix || die
|
||||
|
||||
scan-build --status-bugs -analyze-headers -v make -j2 || die
|
||||
|
||||
# SPI transport
|
||||
scan-build ./configure \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--enable-cli \
|
||||
--enable-executable=no \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--with-examples=posix || die
|
||||
|
||||
scan-build --status-bugs -analyze-headers -v make -j2 || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != android-build ] || {
|
||||
(cd .. && ${TRAVIS_BUILD_DIR}/.travis/check-android-build) || die
|
||||
}
|
||||
|
||||
build_cc1352() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
|
||||
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_cc2538() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc2538 || die
|
||||
arm-none-eabi-size output/cc2538/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/cc2538/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_cc2650() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-cc2650 || die
|
||||
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_cc2652() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
|
||||
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_kw41z() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-kw41z || die
|
||||
arm-none-eabi-size output/kw41z/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/kw41z/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/kw41z/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/kw41z/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_nrf52811() {
|
||||
# Default OpenThread switches for nRF52811 platform
|
||||
OPENTHREAD_FLAGS="BORDER_ROUTER=1 COAP=1 DNS_CLIENT=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1"
|
||||
|
||||
# UART transport
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-nrf52811 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-rcp || die
|
||||
|
||||
# SPI transport for NCP
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
NCP_SPI=1 make -f examples/Makefile-nrf52811 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-rcp || die
|
||||
|
||||
# Build without transport (no CLI or NCP applications)
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_TRANSPORTS=1 make -f examples/Makefile-nrf52811 || die
|
||||
}
|
||||
|
||||
build_nrf52840() {
|
||||
# Default OpenThread switches for nRF52840 platform
|
||||
OPENTHREAD_FLAGS="BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 COAPS=1 COMMISSIONER=1 DEBUG=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 ECDSA=1 FULL_LOGS=1 IP6_FRAGM=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 SLAAC=1 SNTP_CLIENT=1 UDP_FORWARD=1"
|
||||
|
||||
# UART transport
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
|
||||
# USB transport with bootloader e.g. to support PCA10059 dongle
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
USB=1 BOOTLOADER=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
|
||||
# SPI transport for NCP
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
NCP_SPI=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
|
||||
# Build without transport (no CLI or NCP applications)
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_TRANSPORTS=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
|
||||
# Software cryptography
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_BUILTIN_MBEDTLS=0 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
|
||||
# Software cryptography with threading support
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_BUILTIN_MBEDTLS=0 MBEDTLS_THREADING=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
}
|
||||
|
||||
build_qpg6095() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-qpg6095 || die
|
||||
arm-none-eabi-size output/qpg6095/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/qpg6095/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/qpg6095/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/qpg6095/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_samr21() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.45.0.85.zip || die
|
||||
unzip -qq asf-standalone-archive-3.45.0.85.zip || die
|
||||
mv xdk-asf-3.45.0 third_party/microchip/asf || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
|
||||
arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-4 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-5 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-6 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-7 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-8 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix ] || {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_NONE make -f examples/Makefile-posix || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG make -f examples/Makefile-posix || die
|
||||
|
||||
export CPPFLAGS=" \
|
||||
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
CPPFLAGS=-DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1 make -f examples/Makefile-posix || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
./configure \
|
||||
--enable-ncp \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--with-examples=posix \
|
||||
--disable-docs \
|
||||
--disable-tests \
|
||||
--with-vendor-extension=./src/core/common/extension_example.cpp || die
|
||||
make -j 8 || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
./configure \
|
||||
--enable-cli \
|
||||
--enable-mtd \
|
||||
--with-examples=posix \
|
||||
--disable-docs \
|
||||
--disable-tests || die
|
||||
make -j 8 || die
|
||||
|
||||
export CPPFLAGS=" \
|
||||
-DOPENTHREAD_CONFIG_ANOUNCE_SENDER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
./configure \
|
||||
--enable-cli \
|
||||
--enable-ncp \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-radio-only \
|
||||
--with-examples=posix || die
|
||||
make -j 8 || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-distcheck ] || {
|
||||
export ASAN_SYMBOLIZER_PATH=`which llvm-symbolizer` || die
|
||||
export ASAN_OPTIONS=symbolize=1 || die
|
||||
export DISTCHECK_CONFIGURE_FLAGS= CPPFLAGS=-DOPENTHREAD_POSIX_VIRTUAL_TIME=1 || die
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 make -f examples/Makefile-posix distcheck || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-32-bit ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-posix check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-app-cli ] || {
|
||||
./bootstrap || die
|
||||
# enable code coverage for OpenThread transceiver only
|
||||
COVERAGE=1 VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
|
||||
# readline supports pipe, editline does not
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 READLINE=readline make -f src/posix/Makefile-posix || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 OT_CLI_PATH="$(pwd)/$(ls output/posix/*/bin/ot-cli) -v" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" make -f src/posix/Makefile-posix check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-app-pty ] || {
|
||||
./bootstrap
|
||||
.travis/check-posix-app-pty || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-mtd ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-posix check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-ncp-spi ] || {
|
||||
CPPFLAGS="-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1"
|
||||
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp --enable-ftd --with-examples=posix" || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-app-ncp ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
|
||||
# enable code coverage for OpenThread posix radio
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 READLINE=readline make -f src/posix/Makefile-posix || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 OT_NCP_PATH="$(pwd)/$(ls output/posix/*/bin/ot-ncp)" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" NODE_TYPE=ncp-sim make -f src/posix/Makefile-posix check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-ncp ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != toranj-test-framework ] || {
|
||||
./tests/toranj/start.sh || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != osx ] || {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-posix || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f src/posix/Makefile-posix || die
|
||||
}
|
||||
+217
-90
@@ -30,31 +30,60 @@ LOCAL_PATH := $(call my-dir)
|
||||
|
||||
OPENTHREAD_DEFAULT_VERSION := $(shell cat $(LOCAL_PATH)/.default-version)
|
||||
OPENTHREAD_SOURCE_VERSION := $(shell git -C $(LOCAL_PATH) describe --always --match "[0-9].*" 2> /dev/null)
|
||||
OPENTHREAD_PROJECT_CFLAGS ?= -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\"
|
||||
|
||||
OPENTHREAD_COMMON_FLAGS := \
|
||||
OPENTHREAD_PUBLIC_CFLAGS := \
|
||||
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
|
||||
-DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
|
||||
-DOPENTHREAD_POSIX_CONFIG_RCP_PTY_ENABLE=1 \
|
||||
-DOPENTHREAD_FTD=1 \
|
||||
-DOPENTHREAD_POSIX=1 \
|
||||
-DOPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE=1 \
|
||||
$(NULL)
|
||||
|
||||
OPENTHREAD_PRIVATE_CFLAGS := \
|
||||
-DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" \
|
||||
-DPACKAGE=\"openthread\" \
|
||||
-DPACKAGE_BUGREPORT=\"openthread-devel@googlegroups.com\" \
|
||||
-DPACKAGE_NAME=\"OPENTHREAD\" \
|
||||
-DPACKAGE_STRING=\"OPENTHREAD\ $(OPENTHREAD_DEFAULT_VERSION)\" \
|
||||
-DPACKAGE_VERSION=\"$(OPENTHREAD_SOURCE_VERSION)\" \
|
||||
-DPACKAGE_TARNAME=\"openthread\" \
|
||||
-DVERSION=\"$(OPENTHREAD_DEFAULT_VERSION)\" \
|
||||
-DPACKAGE_URL=\"http://github.com/openthread/openthread\" \
|
||||
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
|
||||
-DPACKAGE_VERSION=\"$(OPENTHREAD_SOURCE_VERSION)\" \
|
||||
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
|
||||
-DVERSION=\"$(OPENTHREAD_DEFAULT_VERSION)\" \
|
||||
$(NULL)
|
||||
|
||||
# Enable required features for on-device tests.
|
||||
ifeq ($(TARGET_BUILD_VARIANT),eng)
|
||||
OPENTHREAD_COMMON_FLAGS += \
|
||||
OPENTHREAD_PUBLIC_CFLAGS += \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_OTBR_DAEMON), 1)
|
||||
OPENTHREAD_PUBLIC_CFLAGS += \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_UNSECURE_TRAFFIC_MANAGED_BY_STACK_ENABLE=1 \
|
||||
-DOPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE=1 \
|
||||
$(NULL)
|
||||
else
|
||||
OPENTHREAD_PUBLIC_CFLAGS += -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(USE_OT_RCP_BUS), spi)
|
||||
OPENTHREAD_PUBLIC_CFLAGS += -DOPENTHREAD_POSIX_CONFIG_RCP_BUS=OT_POSIX_RCP_BUS_SPI
|
||||
else
|
||||
OPENTHREAD_PUBLIC_CFLAGS += -DOPENTHREAD_POSIX_CONFIG_RCP_BUS=OT_POSIX_RCP_BUS_UART
|
||||
endif
|
||||
|
||||
# Enable all optional features for CI tests.
|
||||
ifeq ($(TARGET_PRODUCT),generic)
|
||||
OPENTHREAD_COMMON_FLAGS += \
|
||||
OPENTHREAD_PUBLIC_CFLAGS += \
|
||||
-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
|
||||
@@ -77,32 +106,44 @@ LOCAL_MODULE := ot-core
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(OPENTHREAD_PROJECT_INCLUDES) \
|
||||
$(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/src \
|
||||
$(LOCAL_PATH)/src/cli \
|
||||
$(LOCAL_PATH)/src/core \
|
||||
$(LOCAL_PATH)/src/ncp \
|
||||
$(LOCAL_PATH)/src/posix/platform \
|
||||
$(LOCAL_PATH)/src/posix/platform/include \
|
||||
$(LOCAL_PATH)/third_party \
|
||||
$(LOCAL_PATH)/third_party/mbedtls \
|
||||
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" \
|
||||
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
|
||||
$(OPENTHREAD_COMMON_FLAGS) \
|
||||
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
|
||||
-DOPENTHREAD_FTD=1 \
|
||||
-DOPENTHREAD_POSIX=1 \
|
||||
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
|
||||
$(OPENTHREAD_PUBLIC_CFLAGS) \
|
||||
$(OPENTHREAD_PRIVATE_CFLAGS) \
|
||||
$(OPENTHREAD_PROJECT_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_EXPORT_CFLAGS := \
|
||||
$(OPENTHREAD_PUBLIC_CFLAGS) \
|
||||
$(OPENTHREAD_PROJECT_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS := \
|
||||
$(OPENTHREAD_PROJECT_INCLUDES) \
|
||||
$(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/src \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CPPFLAGS := \
|
||||
-Wno-non-virtual-dtor \
|
||||
-std=c++11 \
|
||||
-pedantic-errors \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
src/core/api/backbone_router_api.cpp \
|
||||
src/core/api/backbone_router_ftd_api.cpp \
|
||||
src/core/api/border_router_api.cpp \
|
||||
src/core/api/channel_manager_api.cpp \
|
||||
src/core/api/channel_monitor_api.cpp \
|
||||
@@ -124,6 +165,7 @@ LOCAL_SRC_FILES := \
|
||||
src/core/api/logging_api.cpp \
|
||||
src/core/api/message_api.cpp \
|
||||
src/core/api/netdata_api.cpp \
|
||||
src/core/api/netdiag_api.cpp \
|
||||
src/core/api/random_crypto_api.cpp \
|
||||
src/core/api/random_noncrypto_api.cpp \
|
||||
src/core/api/server_api.cpp \
|
||||
@@ -131,6 +173,9 @@ LOCAL_SRC_FILES := \
|
||||
src/core/api/thread_api.cpp \
|
||||
src/core/api/thread_ftd_api.cpp \
|
||||
src/core/api/udp_api.cpp \
|
||||
src/core/backbone_router/bbr_leader.cpp \
|
||||
src/core/backbone_router/bbr_local.cpp \
|
||||
src/core/backbone_router/bbr_manager.cpp \
|
||||
src/core/coap/coap.cpp \
|
||||
src/core/coap/coap_message.cpp \
|
||||
src/core/coap/coap_secure.cpp \
|
||||
@@ -173,8 +218,8 @@ LOCAL_SRC_FILES := \
|
||||
src/core/meshcop/energy_scan_client.cpp \
|
||||
src/core/meshcop/joiner.cpp \
|
||||
src/core/meshcop/joiner_router.cpp \
|
||||
src/core/meshcop/leader.cpp \
|
||||
src/core/meshcop/meshcop.cpp \
|
||||
src/core/meshcop/meshcop_leader.cpp \
|
||||
src/core/meshcop/meshcop_tlvs.cpp \
|
||||
src/core/meshcop/panid_query_client.cpp \
|
||||
src/core/meshcop/timestamp.cpp \
|
||||
@@ -189,13 +234,15 @@ LOCAL_SRC_FILES := \
|
||||
src/core/net/ip6_mpl.cpp \
|
||||
src/core/net/netif.cpp \
|
||||
src/core/net/udp6.cpp \
|
||||
src/core/radio/radio.cpp \
|
||||
src/core/radio/radio_callbacks.cpp \
|
||||
src/core/radio/radio_platform.cpp \
|
||||
src/core/thread/address_resolver.cpp \
|
||||
src/core/thread/announce_begin_server.cpp \
|
||||
src/core/thread/announce_sender.cpp \
|
||||
src/core/thread/child_table.cpp \
|
||||
src/core/thread/device_mode.cpp \
|
||||
src/core/thread/discover_scanner.cpp \
|
||||
src/core/thread/dua_manager.cpp \
|
||||
src/core/thread/energy_scan_server.cpp \
|
||||
src/core/thread/indirect_sender.cpp \
|
||||
src/core/thread/key_manager.cpp \
|
||||
@@ -206,10 +253,14 @@ LOCAL_SRC_FILES := \
|
||||
src/core/thread/mesh_forwarder_mtd.cpp \
|
||||
src/core/thread/mle.cpp \
|
||||
src/core/thread/mle_router.cpp \
|
||||
src/core/thread/mle_types.cpp \
|
||||
src/core/thread/mlr_manager.cpp \
|
||||
src/core/thread/neighbor_table.cpp \
|
||||
src/core/thread/network_data.cpp \
|
||||
src/core/thread/network_data_leader.cpp \
|
||||
src/core/thread/network_data_leader_ftd.cpp \
|
||||
src/core/thread/network_data_local.cpp \
|
||||
src/core/thread/network_data_notifier.cpp \
|
||||
src/core/thread/network_diagnostic.cpp \
|
||||
src/core/thread/panid_query_server.cpp \
|
||||
src/core/thread/router_table.cpp \
|
||||
@@ -221,24 +272,27 @@ LOCAL_SRC_FILES := \
|
||||
src/core/utils/child_supervision.cpp \
|
||||
src/core/utils/heap.cpp \
|
||||
src/core/utils/jam_detector.cpp \
|
||||
src/core/utils/missing_strlcpy.c \
|
||||
src/core/utils/missing_strlcat.c \
|
||||
src/core/utils/missing_strnlen.c \
|
||||
src/core/utils/parse_cmdline.cpp \
|
||||
src/core/utils/slaac_address.cpp \
|
||||
src/ncp/hdlc.cpp \
|
||||
src/ncp/spinel.c \
|
||||
src/ncp/spinel_decoder.cpp \
|
||||
src/ncp/spinel_encoder.cpp \
|
||||
src/posix/platform/alarm.c \
|
||||
src/posix/platform/entropy.c \
|
||||
src/lib/hdlc/hdlc.cpp \
|
||||
src/lib/platform/exit_code.c \
|
||||
src/lib/spinel/spinel.c \
|
||||
src/lib/spinel/spinel_decoder.cpp \
|
||||
src/lib/spinel/spinel_encoder.cpp \
|
||||
src/lib/url/url.cpp \
|
||||
src/posix/platform/alarm.cpp \
|
||||
src/posix/platform/entropy.cpp \
|
||||
src/posix/platform/hdlc_interface.cpp \
|
||||
src/posix/platform/logging.c \
|
||||
src/posix/platform/misc.c \
|
||||
src/posix/platform/radio_spinel.cpp \
|
||||
src/posix/platform/logging.cpp \
|
||||
src/posix/platform/misc.cpp \
|
||||
src/posix/platform/netif.cpp \
|
||||
src/posix/platform/radio.cpp \
|
||||
src/posix/platform/radio_url.cpp \
|
||||
src/posix/platform/settings.cpp \
|
||||
src/posix/platform/system.c \
|
||||
src/posix/platform/uart.c \
|
||||
src/posix/platform/spi_interface.cpp \
|
||||
src/posix/platform/system.cpp \
|
||||
src/posix/platform/uart.cpp \
|
||||
src/posix/platform/udp.cpp \
|
||||
third_party/mbedtls/repo/library/md.c \
|
||||
third_party/mbedtls/repo/library/md_wrap.c \
|
||||
third_party/mbedtls/repo/library/memory_buffer_alloc.c \
|
||||
@@ -264,15 +318,51 @@ LOCAL_SRC_FILES := \
|
||||
third_party/mbedtls/repo/library/ssl_tls.c \
|
||||
third_party/mbedtls/repo/library/aes.c \
|
||||
third_party/mbedtls/repo/library/ecp.c \
|
||||
$(OPENTHREAD_PROJECT_SRC_FILES) \
|
||||
$(NULL)
|
||||
|
||||
include $(OT_EXTRA_BUILD_CONFIG)
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
ifeq ($(filter -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=%,$(LOCAL_CFLAGS)),)
|
||||
LOCAL_CFLAGS += \
|
||||
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libopenthread-cli
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(OPENTHREAD_PROJECT_INCLUDES) \
|
||||
$(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/src \
|
||||
$(LOCAL_PATH)/src/cli \
|
||||
$(LOCAL_PATH)/src/core \
|
||||
$(LOCAL_PATH)/src/posix/platform \
|
||||
$(LOCAL_PATH)/src/posix/platform/include \
|
||||
$(LOCAL_PATH)/third_party/mbedtls \
|
||||
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(OPENTHREAD_PUBLIC_CFLAGS) \
|
||||
$(OPENTHREAD_PRIVATE_CFLAGS) \
|
||||
-DOPENTHREAD_CONFIG_UART_CLI_RAW=1 \
|
||||
$(OPENTHREAD_PROJECT_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CPPFLAGS := \
|
||||
-std=c++11 \
|
||||
-pedantic-errors \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
src/cli/cli.cpp \
|
||||
src/cli/cli_coap.cpp \
|
||||
src/cli/cli_coap_secure.cpp \
|
||||
src/cli/cli_commissioner.cpp \
|
||||
src/cli/cli_console.cpp \
|
||||
src/cli/cli_dataset.cpp \
|
||||
src/cli/cli_joiner.cpp \
|
||||
src/cli/cli_uart.cpp \
|
||||
src/cli/cli_udp.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
@@ -282,109 +372,146 @@ LOCAL_MODULE := ot-cli
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(OPENTHREAD_PROJECT_INCLUDES) \
|
||||
$(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/src \
|
||||
$(LOCAL_PATH)/src/cli \
|
||||
$(LOCAL_PATH)/src/core \
|
||||
$(LOCAL_PATH)/src/posix/platform \
|
||||
$(LOCAL_PATH)/src/posix/platform/include \
|
||||
$(LOCAL_PATH)/third_party/mbedtls \
|
||||
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" \
|
||||
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
|
||||
$(OPENTHREAD_COMMON_FLAGS) \
|
||||
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
|
||||
-DOPENTHREAD_CONFIG_UART_CLI_RAW=1 \
|
||||
-DOPENTHREAD_FTD=1 \
|
||||
-DOPENTHREAD_POSIX=1 \
|
||||
-DOPENTHREAD_POSIX_APP_TYPE=2 \
|
||||
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
|
||||
$(OPENTHREAD_PUBLIC_CFLAGS) \
|
||||
$(OPENTHREAD_PRIVATE_CFLAGS) \
|
||||
-DOPENTHREAD_POSIX_APP_TYPE=OT_POSIX_APP_TYPE_CLI \
|
||||
$(OPENTHREAD_PROJECT_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CPPFLAGS := \
|
||||
-Wno-non-virtual-dtor \
|
||||
-std=c++11 \
|
||||
-pedantic-errors \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_LDLIBS := \
|
||||
-lrt \
|
||||
-lutil
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
src/cli/cli.cpp \
|
||||
src/cli/cli_coap.cpp \
|
||||
src/cli/cli_commissioner.cpp \
|
||||
src/cli/cli_console.cpp \
|
||||
src/cli/cli_dataset.cpp \
|
||||
src/cli/cli_joiner.cpp \
|
||||
src/cli/cli_server.cpp \
|
||||
src/cli/cli_uart.cpp \
|
||||
src/cli/cli_udp.cpp \
|
||||
src/posix/main.c \
|
||||
$(NULL)
|
||||
|
||||
include $(OT_EXTRA_BUILD_CONFIG)
|
||||
|
||||
ifeq ($(filter -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=%,$(LOCAL_CFLAGS)),)
|
||||
LOCAL_CFLAGS += \
|
||||
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
LOCAL_STATIC_LIBRARIES = ot-core
|
||||
LOCAL_STATIC_LIBRARIES = libopenthread-cli ot-core
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libopenthread-ncp
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(OPENTHREAD_PROJECT_INCLUDES) \
|
||||
$(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/src \
|
||||
$(LOCAL_PATH)/src/core \
|
||||
$(LOCAL_PATH)/src/ncp \
|
||||
$(LOCAL_PATH)/src/posix/platform \
|
||||
$(LOCAL_PATH)/src/posix/platform/include \
|
||||
$(LOCAL_PATH)/third_party/mbedtls \
|
||||
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(OPENTHREAD_PUBLIC_CFLAGS) \
|
||||
$(OPENTHREAD_PRIVATE_CFLAGS) \
|
||||
$(OPENTHREAD_PROJECT_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CPPFLAGS := \
|
||||
-std=c++11 \
|
||||
-pedantic-errors \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
src/lib/spinel/spinel_buffer.cpp \
|
||||
src/ncp/changed_props_set.cpp \
|
||||
src/ncp/ncp_base.cpp \
|
||||
src/ncp/ncp_base_mtd.cpp \
|
||||
src/ncp/ncp_base_ftd.cpp \
|
||||
src/ncp/ncp_base_dispatcher.cpp \
|
||||
src/ncp/ncp_uart.cpp \
|
||||
$(NULL)
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := ot-ncp
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(OPENTHREAD_PROJECT_INCLUDES) \
|
||||
$(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/src \
|
||||
$(LOCAL_PATH)/src/core \
|
||||
$(LOCAL_PATH)/src/ncp \
|
||||
$(LOCAL_PATH)/src/posix/platform \
|
||||
$(LOCAL_PATH)/src/posix/platform/include \
|
||||
$(LOCAL_PATH)/third_party/mbedtls \
|
||||
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" \
|
||||
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
|
||||
$(OPENTHREAD_COMMON_FLAGS) \
|
||||
-DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 \
|
||||
-DOPENTHREAD_FTD=1 \
|
||||
-DOPENTHREAD_POSIX=1 \
|
||||
-DOPENTHREAD_POSIX_APP_TYPE=1 \
|
||||
-DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\" \
|
||||
$(OPENTHREAD_PUBLIC_CFLAGS) \
|
||||
$(OPENTHREAD_PRIVATE_CFLAGS) \
|
||||
-DOPENTHREAD_POSIX_APP_TYPE=OT_POSIX_APP_TYPE_NCP \
|
||||
$(OPENTHREAD_PROJECT_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CPPFLAGS := \
|
||||
-Wno-non-virtual-dtor \
|
||||
-std=c++11 \
|
||||
-pedantic-errors \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_LDLIBS := \
|
||||
-lutil
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
src/ncp/changed_props_set.cpp \
|
||||
src/ncp/ncp_base.cpp \
|
||||
src/ncp/ncp_base_mtd.cpp \
|
||||
src/ncp/ncp_base_ftd.cpp \
|
||||
src/ncp/ncp_base_dispatcher.cpp \
|
||||
src/ncp/ncp_buffer.cpp \
|
||||
src/ncp/ncp_uart.cpp \
|
||||
src/posix/main.c \
|
||||
$(NULL)
|
||||
|
||||
include $(OT_EXTRA_BUILD_CONFIG)
|
||||
LOCAL_LDLIBS := \
|
||||
-lrt \
|
||||
-lutil
|
||||
|
||||
ifeq ($(filter -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=%,$(LOCAL_CFLAGS)),)
|
||||
LOCAL_CFLAGS += \
|
||||
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
|
||||
$(NULL)
|
||||
endif
|
||||
LOCAL_STATIC_LIBRARIES = libopenthread-ncp ot-core
|
||||
|
||||
LOCAL_STATIC_LIBRARIES = ot-core
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
ifeq ($(USE_OTBR_DAEMON), 1)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := ot-ctl
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
|
||||
LOCAL_CPPFLAGS := \
|
||||
-std=c++11 \
|
||||
-pedantic-errors \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(OPENTHREAD_PROJECT_INCLUDES) \
|
||||
$(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/src/ \
|
||||
$(LOCAL_PATH)/src/core \
|
||||
$(LOCAL_PATH)/src/posix/platform \
|
||||
$(LOCAL_PATH)/src/posix/platform/include \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_SRC_FILES := src/posix/client.cpp
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
endif # ($(USE_OTBR_DAEMON), 1)
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
import("etc/gn/openthread.gni")
|
||||
|
||||
config("openthread_config") {
|
||||
if (openthread_config_file != "") {
|
||||
defines += [ "OPENTHREAD_CONFIG_FILE=${openthread_config_file}" ]
|
||||
}
|
||||
|
||||
include_dirs = openthread_project_include_dirs
|
||||
|
||||
include_dirs += [
|
||||
"${root_gen_dir}/include",
|
||||
"include",
|
||||
]
|
||||
}
|
||||
|
||||
config("openthread_ftd_config") {
|
||||
defines = [ "OPENTHREAD_FTD=1" ]
|
||||
}
|
||||
|
||||
config("openthread_mtd_config") {
|
||||
defines = [ "OPENTHREAD_MTD=1" ]
|
||||
}
|
||||
|
||||
config("openthread_radio_config") {
|
||||
defines = [ "OPENTHREAD_RADIO=1" ]
|
||||
}
|
||||
|
||||
group("libopenthread-ftd") {
|
||||
public_deps = [ "include/openthread" ]
|
||||
deps = [ "src/core:libopenthread-ftd" ]
|
||||
}
|
||||
|
||||
group("libopenthread-mtd") {
|
||||
public_deps = [ "include/openthread" ]
|
||||
deps = [ "src/core:libopenthread-mtd" ]
|
||||
}
|
||||
|
||||
group("libopenthread-radio") {
|
||||
public_deps = [ "include/openthread" ]
|
||||
deps = [ "src/core:libopenthread-radio" ]
|
||||
}
|
||||
|
||||
group("libopenthread-cli-ftd") {
|
||||
public_deps = [ "include/openthread" ]
|
||||
deps = [ "src/cli:libopenthread-cli-ftd" ]
|
||||
}
|
||||
|
||||
group("libopenthread-cli-mtd") {
|
||||
public_deps = [ "include/openthread" ]
|
||||
deps = [ "src/cli:libopenthread-cli-mtd" ]
|
||||
}
|
||||
|
||||
group("libopenthread-spinel-ncp") {
|
||||
public_deps = [ "src/lib/spinel:spinel-api" ]
|
||||
deps = [ "src/lib/spinel:libopenthread-spinel-ncp" ]
|
||||
}
|
||||
|
||||
group("libopenthread-spinel-rcp") {
|
||||
public_deps = [ "src/lib/spinel:spinel-api" ]
|
||||
deps = [ "src/lib/spinel:libopenthread-spinel-rcp" ]
|
||||
}
|
||||
|
||||
if (current_os == "fuchsia") {
|
||||
group("lib-ot-core") {
|
||||
public_deps = [ ":libopenthread-ftd" ]
|
||||
}
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
cmake_minimum_required(VERSION 3.10.2)
|
||||
|
||||
file(READ .default-version OT_DEFAULT_VERSION)
|
||||
string(STRIP ${OT_DEFAULT_VERSION} OT_DEFAULT_VERSION)
|
||||
|
||||
project(openthread VERSION ${OT_DEFAULT_VERSION})
|
||||
|
||||
option(OT_BUILD_EXECUTABLES "Build executables" ON)
|
||||
option(OT_COVERAGE "enable coverage" OFF)
|
||||
set(OT_EXTERNAL_MBEDTLS "" CACHE STRING "Specify external mbedtls library")
|
||||
|
||||
add_library(ot-config INTERFACE)
|
||||
|
||||
target_include_directories(ot-config INTERFACE
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${PROJECT_SOURCE_DIR}/src
|
||||
${PROJECT_SOURCE_DIR}/src/core
|
||||
)
|
||||
|
||||
include(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(OT_BIG_ENDIAN)
|
||||
if(OT_BIG_ENDIAN)
|
||||
target_compile_definitions(ot-config INTERFACE "BYTE_ORDER_BIG_ENDIAN=1")
|
||||
endif()
|
||||
|
||||
include("${PROJECT_SOURCE_DIR}/etc/cmake/checks.cmake")
|
||||
include("${PROJECT_SOURCE_DIR}/etc/cmake/options.cmake")
|
||||
include("${PROJECT_SOURCE_DIR}/etc/cmake/functions.cmake")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
|
||||
option(OT_COMPILE_WARNING_AS_ERROR "whether to include -Werror -pedantic-errors with gcc-compatible compilers")
|
||||
if (OT_COMPILE_WARNING_AS_ERROR)
|
||||
set(OT_CFLAGS -Werror -pedantic-errors)
|
||||
endif()
|
||||
|
||||
if(OT_COVERAGE)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_ENABLE_COVERAGE=1")
|
||||
target_compile_options(ot-config INTERFACE -g -O0 --coverage)
|
||||
target_link_libraries(ot-config INTERFACE --coverage)
|
||||
endif()
|
||||
|
||||
set(OT_CFLAGS
|
||||
$<$<COMPILE_LANGUAGE:C>:${OT_CFLAGS} -Wall -Wextra -Wshadow>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${OT_CFLAGS} -Wall -Wextra -Wshadow -Wno-c++14-compat -fno-exceptions>
|
||||
)
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND bash "-c" "third_party/nlbuild-autotools/repo/scripts/mkversion -b ${OT_DEFAULT_VERSION}"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE OT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
message(STATUS "Version: ${OT_VERSION}")
|
||||
|
||||
target_compile_definitions(ot-config INTERFACE
|
||||
"PACKAGE_NAME=\"OPENTHREAD\""
|
||||
"PACKAGE_VERSION=\"${OT_VERSION}\""
|
||||
)
|
||||
|
||||
set(OT_THREAD_VERSION "1.1" CACHE STRING "Thread version chosen by the user at configure time")
|
||||
set_property(CACHE OT_THREAD_VERSION PROPERTY STRINGS "1.1" "1.2")
|
||||
if(${OT_THREAD_VERSION} EQUAL "1.1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_1")
|
||||
elseif(${OT_THREAD_VERSION} EQUAL "1.2")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_2")
|
||||
else()
|
||||
message(FATAL_ERROR "Thread version unknown: ${OT_THREAD_VERSION}")
|
||||
endif()
|
||||
|
||||
set(OT_PLATFORM "NO" CACHE STRING "Target platform chosen by the user at configure time")
|
||||
ot_get_platforms(OT_PLATFORMS)
|
||||
set_property(CACHE OT_PLATFORM PROPERTY STRINGS ${OT_PLATFORMS})
|
||||
if(NOT OT_PLATFORM IN_LIST OT_PLATFORMS)
|
||||
message(FATAL_ERROR "Platform unknown: ${OT_PLATFORM}")
|
||||
endif()
|
||||
|
||||
set(OT_LOG_OUTPUT_VALUES
|
||||
"APP"
|
||||
"DEBUG_UART"
|
||||
"NONE"
|
||||
"PLATFORM_DEFINED"
|
||||
)
|
||||
if(OT_REFERENCE_DEVICE AND NOT OT_PLATFORM STREQUAL "posix")
|
||||
set(OT_LOG_OUTPUT "APP" CACHE STRING "Set log output to application for reference device")
|
||||
else()
|
||||
set(OT_LOG_OUTPUT "" CACHE STRING "Where log output goes to")
|
||||
endif()
|
||||
set_property(CACHE OT_LOG_OUTPUT PROPERTY STRINGS ${OT_LOG_OUTPUT_VALUES})
|
||||
if(OT_LOG_OUTPUT)
|
||||
if(NOT OT_LOG_OUTPUT IN_LIST OT_LOG_OUTPUT_VALUES)
|
||||
message(FATAL_ERROR "Log output unknown: ${OT_LOG_OUTPUT}")
|
||||
endif()
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_${OT_LOG_OUTPUT}")
|
||||
message(STATUS "Log output: ${OT_LOG_OUTPUT}")
|
||||
endif()
|
||||
|
||||
# OT_CONFIG allows users to specify the path to OpenThread project core
|
||||
# config header file. The default value of this parameter is empty string.
|
||||
# When not specified by user (value is ""), a platform cmake file may
|
||||
# choose to change this variable to provide its own core config header
|
||||
# file instead.
|
||||
|
||||
set(OT_CONFIG "" CACHE STRING "OpenThread project-specific config header file chosen by user at configure time")
|
||||
|
||||
list(APPEND OT_PUBLIC_INCLUDES ${PROJECT_BINARY_DIR}/etc/cmake)
|
||||
list(APPEND OT_PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/etc/cmake)
|
||||
list(APPEND OT_PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
if(OT_PLATFORM STREQUAL "posix")
|
||||
target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/src/posix/platform)
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/src/posix/platform")
|
||||
elseif(OT_PLATFORM)
|
||||
target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/examples/platforms/${OT_PLATFORM})
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/examples/platforms/${OT_PLATFORM}")
|
||||
endif()
|
||||
|
||||
if(OT_CONFIG)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"")
|
||||
message(STATUS "Project core config: \"${OT_CONFIG}\"")
|
||||
endif()
|
||||
|
||||
target_compile_definitions(ot-config INTERFACE ${OT_PLATFORM_DEFINES})
|
||||
|
||||
if(OT_PLATFORM STREQUAL "posix")
|
||||
if(OT_BUILD_EXECUTABLES)
|
||||
add_subdirectory(src/posix)
|
||||
else()
|
||||
add_subdirectory(src/posix EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
elseif(OT_PLATFORM)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(third_party EXCLUDE_FROM_ALL)
|
||||
|
||||
if(OT_PLATFORM STREQUAL "simulation")
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
add_custom_target(print-ot-config ALL COMMAND echo -e "$<JOIN:$<TARGET_PROPERTY:ot-config,INTERFACE_COMPILE_DEFINITIONS>,\"\\n\">")
|
||||
+18
-46
@@ -2,73 +2,45 @@
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at openthread-conduct@google.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at openthread-conduct@google.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
|
||||
+17
-29
@@ -2,21 +2,21 @@
|
||||
|
||||
We would love for you to contribute to OpenThread and help make it even better than it is today! As a contributor, here are the guidelines we would like you to follow.
|
||||
|
||||
* [1 Code of Conduct](#code-of-conduct)
|
||||
* [2 Bugs](#bugs)
|
||||
* [3 New Features](#new-features)
|
||||
* [4 Contributing Code](#contributing-code)
|
||||
* [4.1 Initial Setup](#initial-setup)
|
||||
* [4.2 Contributor License Agreement (CLA)](#contributor-license-agreement--cla-)
|
||||
* [4.3 Submitting a Pull Request](#submitting-a-pull-request)
|
||||
- [1 Code of Conduct](#code-of-conduct)
|
||||
- [2 Bugs](#bugs)
|
||||
- [3 New Features](#new-features)
|
||||
- [4 Contributing Code](#contributing-code)
|
||||
- [4.1 Initial Setup](#initial-setup)
|
||||
- [4.2 Contributor License Agreement (CLA)](#contributor-license-agreement--cla-)
|
||||
- [4.3 Submitting a Pull Request](#submitting-a-pull-request)
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
Help us keep OpenThread open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
Help us keep OpenThread open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
|
||||
## Bugs
|
||||
|
||||
If you find a bug in the source code, you can help us by [submitting a GitHub Issue](https://github.com/openthread/openthread/issues/new). The best bug reports provide a detailed description of the issue and step-by-step instructions for predictably reproducing the issue. Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix.
|
||||
If you find a bug in the source code, you can help us by [submitting a GitHub Issue](https://github.com/openthread/openthread/issues/new). The best bug reports provide a detailed description of the issue and step-by-step instructions for predictably reproducing the issue. Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix.
|
||||
|
||||
## New Features
|
||||
|
||||
@@ -24,9 +24,9 @@ You can request a new feature by [submitting a GitHub Issue](https://github.com/
|
||||
|
||||
If you would like to implement a new feature, please consider the scope of the new feature:
|
||||
|
||||
* *Large feature*: first [submit a GitHub Issue](https://github.com/openthread/openthread/issues/new) and communicate your proposal so that the community can review and provide feedback. Getting early feedback will help ensure your implementation work is accepted by the community. This will also allow us to better coordinate our efforts and minimize duplicated effort.
|
||||
- _Large feature_: first [submit a GitHub Issue](https://github.com/openthread/openthread/issues/new) and communicate your proposal so that the community can review and provide feedback. Getting early feedback will help ensure your implementation work is accepted by the community. This will also allow us to better coordinate our efforts and minimize duplicated effort.
|
||||
|
||||
* *Small feature*: can be implemented and directly [submitted as a Pull Request](#submitting-a-pull-request).
|
||||
- _Small feature_: can be implemented and directly [submitted as a Pull Request](#submitting-a-pull-request).
|
||||
|
||||
## Contributing Code
|
||||
|
||||
@@ -37,7 +37,6 @@ The OpenThread Project follows the "Fork-and-Pull" model for accepting contribut
|
||||
Setup your GitHub fork and continuous-integration services:
|
||||
|
||||
1. Fork the [OpenThread repository](https://github.com/openthread/openthread) by clicking "Fork" on the web UI.
|
||||
2. Enable [Travis CI](https://travis-ci.org/) by logging in the respective service with your GitHub account and enabling your newly created fork. We use Travis CI for Linux-based continuous integration checks. All contributions must pass these checks to be accepted.
|
||||
|
||||
Setup your local development environment:
|
||||
|
||||
@@ -51,12 +50,9 @@ git remote add upstream git@github.com:openthread/openthread.git
|
||||
|
||||
### Contributor License Agreement (CLA)
|
||||
|
||||
The OpenThread Project requires all contributors to sign a Contributor License Agreement ([individual](https://developers.google.com/open-source/cla/individual) or [corporate](https://developers.google.com/open-source/cla/corporate)) in order to protect contributors, users, and Google in issues of intellectual property.
|
||||
|
||||
With each Pull Request, an automated check occurs to verify that you have signed the CLA. Make sure that you sign the CLA with the same email address associated with your commits (i.e. via the `user.email` Git config as described on GitHub's [Set up Git](https://help.github.com/articles/set-up-git/) page.
|
||||
|
||||
NOTE: Only original source code from you and other people that have signed the CLA can be accepted into the repository. This policy does not apply to [third_party](https://github.com/openthread/openthread/tree/master/third_party).
|
||||
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to <https://cla.developers.google.com/> to see your current agreements on file or to sign a new one.
|
||||
|
||||
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
|
||||
|
||||
### Submitting a Pull Request
|
||||
|
||||
@@ -112,17 +108,9 @@ This will open up a text editor where you can specify which commits to squash.
|
||||
|
||||
#### Coding Conventions and Style
|
||||
|
||||
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party). Use the `make pretty` and `make pretty-check` targets to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v6.0.0](http://releases.llvm.org/download.html#6.0.0) for `make pretty` and `make pretty-check`.
|
||||
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party). Use `script/make-pretty` and `script/make-pretty check` to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v6.0.0](http://releases.llvm.org/download.html#6.0.0) for C/C++ and [yapf v0.29.0](https://github.com/google/yapf) for Python.
|
||||
|
||||
As part of the cleanup process, you should also run `make pretty-check` to ensure that your code passes the baseline code style checks.
|
||||
|
||||
```bash
|
||||
./bootstrap
|
||||
./configure
|
||||
make pretty-check
|
||||
```
|
||||
|
||||
Make sure to include any code format changes in your commits.
|
||||
As part of the cleanup process, you should also run `script/make-pretty check` to ensure that your code passes the baseline code style checks.
|
||||
|
||||
#### Push and Test
|
||||
|
||||
@@ -134,8 +122,8 @@ git checkout <branch-name>
|
||||
git push origin <branch-name>
|
||||
```
|
||||
|
||||
This will trigger the Travis CI continuous-integration checks. You can view the results in the respective services. Note that the integration checks will report failures on occasion. If a failure occurs, you may try rerunning the test via the Travis web UI.
|
||||
This will trigger continuous-integration checks using GitHub Actions. You can view the status and logs via the "Actions" tab in your fork.
|
||||
|
||||
#### Submit Pull Request
|
||||
|
||||
Once you've validated the Travis CI results, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update.
|
||||
Once you've validated that all continuous-integration checks have passed, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update.
|
||||
|
||||
+1
-9
@@ -37,7 +37,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--with-examples=posix \
|
||||
--with-examples=simulation \
|
||||
$(NULL)
|
||||
|
||||
SUBDIRS = \
|
||||
@@ -71,14 +71,6 @@ DISTCLEANFILES = \
|
||||
.local-version \
|
||||
$(NULL)
|
||||
|
||||
PRETTY_SUBDIRS = \
|
||||
examples \
|
||||
include \
|
||||
src \
|
||||
tests \
|
||||
tools \
|
||||
$(NULL)
|
||||
|
||||
# Ignore the pseudo flash files on Posix platform during diskcheck
|
||||
distcleancheck_listfiles = \
|
||||
$(AM_V_at)find . -type f -name "*flash"
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
[![OpenThread][ot-logo]][ot-repo]
|
||||
[![Build Status][ot-travis-svg]][ot-travis]
|
||||
[![Coverage Status][ot-codecov-svg]][ot-codecov]
|
||||
[![Build Status][ot-docker-dev-svg]][ot-docker-dev]
|
||||
[![OpenThread][ot-logo]][ot-repo] [![Build][ot-gh-action-build-svg]][ot-gh-action-build] [![Simulation][ot-gh-action-simulation-svg]][ot-gh-action-simulation] [![Docker][ot-gh-action-docker-svg]][ot-gh-action-docker] [![Language grade: C/C++][ot-lgtm-svg]][ot-lgtm] [![Coverage Status][ot-codecov-svg]][ot-codecov]
|
||||
|
||||
---
|
||||
|
||||
# What is OpenThread?
|
||||
|
||||
OpenThread released by Google is...
|
||||
<a href="http://threadgroup.org/technology/ourtechnology#certifiedproducts">
|
||||
<img src="https://cdn.rawgit.com/openthread/openthread/ab4c4e1e/doc/images/certified.svg" alt="Thread Certified Component" width="150px" align="right">
|
||||
</a>
|
||||
OpenThread released by Google is... <a href="http://threadgroup.org/technology/ourtechnology#certifiedproducts"> <img src="https://cdn.rawgit.com/openthread/openthread/ab4c4e1e/doc/images/certified.svg" alt="Thread Certified Component" width="150px" align="right"> </a>
|
||||
|
||||
**...an open-source implementation of the [Thread](http://threadgroup.org/technology/ourtechnology) networking protocol.** Google Nest has released OpenThread to make the technology used in Nest products more broadly available to developers to accelerate the development of products for the connected home.
|
||||
|
||||
@@ -23,27 +17,31 @@ More information about Thread can be found at [threadgroup.org](http://threadgro
|
||||
[thread]: http://threadgroup.org/technology/ourtechnology
|
||||
[ot-repo]: https://github.com/openthread/openthread
|
||||
[ot-logo]: doc/images/openthread_logo.png
|
||||
[ot-travis]: https://travis-ci.org/openthread/openthread
|
||||
[ot-travis-svg]: https://travis-ci.org/openthread/openthread.svg?branch=master
|
||||
[ot-gh-action-build]: https://github.com/openthread/openthread/actions?query=workflow%3ABuild+branch%3Amaster+event%3Apush
|
||||
[ot-gh-action-build-svg]: https://github.com/openthread/openthread/workflows/Build/badge.svg?branch=master&event=push
|
||||
[ot-gh-action-simulation]: https://github.com/openthread/openthread/actions?query=workflow%3ASimulation+branch%3Amaster+event%3Apush
|
||||
[ot-gh-action-simulation-svg]: https://github.com/openthread/openthread/workflows/Simulation/badge.svg?branch=master&event=push
|
||||
[ot-gh-action-docker]: https://github.com/openthread/openthread/actions?query=workflow%3ADocker+branch%3Amaster+event%3Apush
|
||||
[ot-gh-action-docker-svg]: https://github.com/openthread/openthread/workflows/Docker/badge.svg?branch=master&event=push
|
||||
[ot-lgtm]: https://lgtm.com/projects/g/openthread/openthread/context:cpp
|
||||
[ot-lgtm-svg]: https://img.shields.io/lgtm/grade/cpp/g/openthread/openthread.svg?logo=lgtm&logoWidth=18
|
||||
[ot-codecov]: https://codecov.io/gh/openthread/openthread
|
||||
[ot-codecov-svg]: https://codecov.io/gh/openthread/openthread/branch/master/graph/badge.svg
|
||||
[ot-docker-dev]: https://hub.docker.com/r/openthread/environment
|
||||
[ot-docker-dev-svg]: https://img.shields.io/docker/cloud/build/openthread/environment.svg?label=docker%20%7C%20dev
|
||||
|
||||
# Who supports OpenThread?
|
||||
|
||||
<a href="https://www.arm.com/"><img src="doc/images/ot-contrib-arm.png" alt="ARM" width="200px"></a><a href="https://www.cascoda.com/"><img src="doc/images/ot-contrib-cascoda.png" alt="Cascoda" width="200px"></a><a href="https://www.google.com/"><img src="doc/images/ot-contrib-google.png" alt="Google" width="200px"></a><a href="http://www.nordicsemi.com/"><img src="doc/images/ot-contrib-nordic.png" alt="Nordic" width="200px"></a><a href="http://www.nxp.com/"><img src="doc/images/ot-contrib-nxp.png" alt="NXP" width="200px"></a><a href="https://www.particle.io/"><img src="doc/images/ot-contrib-particle.png" alt="Particle" width="200px"></a><a href="http://www.qorvo.com/"><img src="doc/images/ot-contrib-qorvo.png" alt="Qorvo" width="200px"></a><a href="https://www.qualcomm.com/"><img src="doc/images/ot-contrib-qc.png" alt="Qualcomm" width="200px"></a><a href="https://www.samsung.com/"><img src="doc/images/ot-contrib-samsung.png" alt="Samsung" width="200px"></a><a href="https://www.silabs.com/"><img src="doc/images/ot-contrib-silabs.png" alt="Silicon Labs" width="200px"></a><a href="https://www.st.com/"><img src="doc/images/ot-contrib-stm.png" alt="STMicroelectronics" width="200px"></a><a href="https://www.synopsys.com/"><img src="doc/images/ot-contrib-synopsys.png" alt="Synopsys" width="200px"></a><a href="https://www.ti.com/"><img src="doc/images/ot-contrib-ti.png" alt="Texas Instruments" width="200px"></a><a href="https://www.zephyrproject.org/"><img src="doc/images/ot-contrib-zephyr.png" alt="Zephyr Project" width="200px"></a>
|
||||
<a href="https://www.arm.com/"><img src="doc/images/ot-contrib-arm.png" alt="ARM" width="200px"></a><a href="https://www.cascoda.com/"><img src="doc/images/ot-contrib-cascoda.png" alt="Cascoda" width="200px"></a><a href="https://www.google.com/"><img src="doc/images/ot-contrib-google.png" alt="Google" width="200px"></a><a href="http://www.nordicsemi.com/"><img src="doc/images/ot-contrib-nordic.png" alt="Nordic" width="200px"></a><a href="http://www.nxp.com/"><img src="doc/images/ot-contrib-nxp.png" alt="NXP" width="200px"></a><a href="http://www.qorvo.com/"><img src="doc/images/ot-contrib-qorvo.png" alt="Qorvo" width="200px"></a><a href="https://www.qualcomm.com/"><img src="doc/images/ot-contrib-qc.png" alt="Qualcomm" width="200px"></a><a href="https://www.samsung.com/"><img src="doc/images/ot-contrib-samsung.png" alt="Samsung" width="200px"></a><a href="https://www.silabs.com/"><img src="doc/images/ot-contrib-silabs.png" alt="Silicon Labs" width="200px"></a><a href="https://www.st.com/"><img src="doc/images/ot-contrib-stm.png" alt="STMicroelectronics" width="200px"></a><a href="https://www.synopsys.com/"><img src="doc/images/ot-contrib-synopsys.png" alt="Synopsys" width="200px"></a><a href="https://www.ti.com/"><img src="doc/images/ot-contrib-ti.png" alt="Texas Instruments" width="200px"></a><a href="https://www.zephyrproject.org/"><img src="doc/images/ot-contrib-zephyr.png" alt="Zephyr Project" width="200px"></a>
|
||||
|
||||
# Getting started
|
||||
|
||||
All end-user documentation and guides are located at [openthread.io](https://openthread.io). If you're looking to do things like...
|
||||
|
||||
* Learn more about OpenThread features and enhancements
|
||||
* Use OpenThread in your products
|
||||
* Learn how to build and configure a Thread network
|
||||
* Port OpenThread to a new platform
|
||||
* Build an application on top of OpenThread
|
||||
* Certify a product using OpenThread
|
||||
- Learn more about OpenThread features and enhancements
|
||||
- Use OpenThread in your products
|
||||
- Learn how to build and configure a Thread network
|
||||
- Port OpenThread to a new platform
|
||||
- Build an application on top of OpenThread
|
||||
- Certify a product using OpenThread
|
||||
|
||||
...then [openthread.io](https://openthread.io) is the place for you.
|
||||
|
||||
@@ -71,8 +69,8 @@ Please only use the OpenThread name and marks when accurately referencing this s
|
||||
|
||||
There are numerous avenues for OpenThread support:
|
||||
|
||||
* Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
|
||||
* Stack Overflow — [post questions using the `openthread` tag](http://stackoverflow.com/questions/tagged/openthread)
|
||||
* Google Groups — [discussion and announcements at openthread-users](https://groups.google.com/forum/#!forum/openthread-users)
|
||||
- Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
|
||||
- Stack Overflow — [post questions using the `openthread` tag](http://stackoverflow.com/questions/tagged/openthread)
|
||||
- Google Groups — [discussion and announcements at openthread-users](https://groups.google.com/forum/#!forum/openthread-users)
|
||||
|
||||
The openthread-users Google Group is the recommended place for users to discuss OpenThread and interact directly with the OpenThread team.
|
||||
|
||||
+30
-27
@@ -1,15 +1,15 @@
|
||||
# OpenThread Coding Conventions and Style
|
||||
|
||||
* [1 C and C++](#c-and-c)
|
||||
* [1.1 Standards](#standards)
|
||||
* [1.2 Conventions and Best Practices](#conventions-and-best-practices)
|
||||
* [1.3 Tightly-constrained Systems and Shared Infrastructure](#tightly-constrained-systems-and-shared-infrastructure)
|
||||
* [1.4 Format and Style](#format-and-style)
|
||||
* [1.5 Comments](#comments)
|
||||
* [2 Python](#python)
|
||||
* [2.1 Standards](#standards)
|
||||
* [2.2 Conventions and Best Practices](#conventions-and-best-practices)
|
||||
* [2.3 Format and Style](#format-and-style)
|
||||
- [1 C and C++](#c-and-c)
|
||||
- [1.1 Standards](#standards)
|
||||
- [1.2 Conventions and Best Practices](#conventions-and-best-practices)
|
||||
- [1.3 Tightly-constrained Systems and Shared Infrastructure](#tightly-constrained-systems-and-shared-infrastructure)
|
||||
- [1.4 Format and Style](#format-and-style)
|
||||
- [1.5 Comments](#comments)
|
||||
- [2 Python](#python)
|
||||
- [2.1 Standards](#standards)
|
||||
- [2.2 Conventions and Best Practices](#conventions-and-best-practices)
|
||||
- [2.3 Format and Style](#format-and-style)
|
||||
|
||||
# C and C++
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
- C
|
||||
- OpenThread uses and enforces the ISO9899:1999 (aka ISO C99, C99) C language standard as the minimum.
|
||||
- C++
|
||||
- OpenThread uses and enforces the ISO14882:2003 (aka ISO C++03, C++03) C++ language standard as the minimum.
|
||||
- OpenThread uses and enforces the ISO14882:2011 (aka ISO C++11, C++11) C++ language standard as the minimum.
|
||||
- Extensions
|
||||
- Wherever possible, toolchain-specific (e.g GCC/GNU) extensions or the use of later standards shall be avoided or shall be leveraged through toolchain-compatibility preprocessor macros.
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
### Language Independent
|
||||
|
||||
- Inline functions should be used judiciously.
|
||||
- The use of code in headers and, more specifically, the use of the non-local scope inline functions should be avoided. Exception: Simple setters and getters are fine since the compiler can efficiently optimize these and make their overhead as low as a direct data member access.
|
||||
- The use of code in headers and, more specifically, the use of the non-local scope inline functions should be avoided. Exception: Simple setters and getters are fine since the compiler can efficiently optimize these and make their overhead as low as a direct data member access.
|
||||
- Return Statements
|
||||
- There should be one return statement per free function or method at the end of the free function or method.
|
||||
- Non-local Goto
|
||||
- There should be no calls to the functions `setjmp` or `longjmp`.
|
||||
- Local Goto
|
||||
- There should be no calls to the C/C++ keyword goto. Exception: The use of local gotos for the purposes of common error handling blocks and single points of function return at the bottom of a function.
|
||||
- There should be no calls to the C/C++ keyword goto. Exception: The use of local gotos for the purposes of common error handling blocks and single points of function return at the bottom of a function.
|
||||
- C Preprocessor
|
||||
- Use of the C preprocessor should be limited to file inclusion and simple macros.
|
||||
- Macros shall not be defined within a function or a block and should be defined at the top of a file.
|
||||
@@ -63,16 +63,16 @@
|
||||
- Unbounded Recursion
|
||||
- There shall be no direct or indirect use of unbounded recursive function calls.
|
||||
- Symmetric APIs
|
||||
- Wherever possible and appropriate, particularly around the management of resources, APIs should be symmetric. For example, if there is a free function or object method that allocates a resource, then there should be one that deallocates it. If there is a free function or object method that opens a file or network stream, then there should be one that closes it.
|
||||
- Wherever possible and appropriate, particularly around the management of resources, APIs should be symmetric. For example, if there is a free function or object method that allocates a resource, then there should be one that deallocates it. If there is a free function or object method that opens a file or network stream, then there should be one that closes it.
|
||||
- Use C stdint.h or C++ cstdint for Plain Old Data Types
|
||||
- Standard, scalar data types defined in stdint.h (C) or cstdint (C++) should be used for basic signed and unsigned integer types, especially when size and serialization to non-volatile storage or across a network is concerned. Examples of these are: `uint8_t`, `int8_t`, etc.
|
||||
- Standard, scalar data types defined in stdint.h (C) or cstdint (C++) should be used for basic signed and unsigned integer types, especially when size and serialization to non-volatile storage or across a network is concerned. Examples of these are: `uint8_t`, `int8_t`, etc.
|
||||
- Constant Qualifiers
|
||||
- Read-only methods, global variables, stack variables, or data members are read-only should be qualified using the C or C++ `const` qualifier.
|
||||
- Pointers or references to read-only objects or storage, including but not limited to function parameters, should be qualified using the C or C++ `const` qualifier.
|
||||
- Header Include Guard
|
||||
- All C and C++ headers shall use preprocessor header include guards.
|
||||
- The terminating endif preprocessor directive shall have a comment, C or C++ depending on the header type, containing the preprocessor symbol introduced by the ifndef directive starting the guard.
|
||||
- The symbol used for the guard should be the file name, converted to all uppercase, with any spaces (“ “) or dots (“.”) converted to underscores (“_”).
|
||||
- The symbol used for the guard should be the file name, converted to all uppercase, with any spaces (“ “) or dots (“.”) converted to underscores (“\_”).
|
||||
- Function and Method Prototypes
|
||||
- All void functions or methods shall explicitly declare and specify the void type keyword.
|
||||
- Unused parameters
|
||||
@@ -86,16 +86,16 @@
|
||||
### C++
|
||||
|
||||
- Prefer Passing Parameters by Reference to Pointer
|
||||
- Unlike C, C++ offers an alternate way to alias data over and above a pointer, the reference, indicated by the & symbol. Where appropriate, the reference should be preferred to the pointer.
|
||||
- Unlike C, C++ offers an alternate way to alias data over and above a pointer, the reference, indicated by the & symbol. Where appropriate, the reference should be preferred to the pointer.
|
||||
- Passing Base Scalars
|
||||
- Size- and call frequency-based considerations should be made when passing scalars as to whether they should be passed by value or by constant reference; however, pass-by-value should generally be preferred.
|
||||
- Eliminate Unnecessary Destructors
|
||||
- The creation of empty or useless destructors should be avoided. Empty or useless destructors should be removed.
|
||||
- The creation of empty or useless destructors should be avoided. Empty or useless destructors should be removed.
|
||||
- Default Parameters
|
||||
- When you declare C++ free functions and object methods, you should avoid or minimize using default parameters.
|
||||
- When you declare C++ virtual object methods, you shall avoid using default parameters.
|
||||
- Global and Scoped Static Construction
|
||||
- There shall be no use of global, static or otherwise, object construction. The use of scoped static object construction should be avoided.
|
||||
- There shall be no use of global, static or otherwise, object construction. The use of scoped static object construction should be avoided.
|
||||
- C++-style Casts
|
||||
- Wherever possible and practical, C++ style casts should be used and preferred to the C style cast equivalent.
|
||||
- Avoid `using namespace` Statements in Headers
|
||||
@@ -114,23 +114,25 @@
|
||||
|
||||
## Format and Style
|
||||
|
||||
- OpenThread uses the `make pretty` build target to reformat code and enforce code format and style. The `make pretty-check` build target is included in OpenThread's continuous integration and must pass before a pull request is merged.
|
||||
- OpenThread uses `script/make-pretty` to reformat code and enforce code format and style. `script/make-pretty check` build target is included in OpenThread's continuous integration and must pass before a pull request is merged.
|
||||
|
||||
- The `make pretty` and `make pretty-check` build targets require [clang-format v6.0.0](http://releases.llvm.org/download.html#6.0.0).
|
||||
- `script/make-pretty` requires [clang-format v6.0.0](http://releases.llvm.org/download.html#6.0.0) for C/C++ and [yapf v0.29.0](https://github.com/google/yapf) for Python.
|
||||
|
||||
### File Names
|
||||
- File names should match the names and types of what is described in the file. If a file contains many declarations and definitions, the author should choose the one that predominantly describes or that makes the most sense.
|
||||
|
||||
- File names should match the names and types of what is described in the file. If a file contains many declarations and definitions, the author should choose the one that predominantly describes or that makes the most sense.
|
||||
- File contents and names should be limited in the scope of what they contain. It may also be possible that there is too much stuff in one file and you need to break it up into multiple files.
|
||||
- File names should be all lower case.
|
||||
- File extensions shall be indicative and appropriate for the type and usage of the source or header file.
|
||||
|
||||
### Naming
|
||||
- Names should be descriptive but not overly so and they should give some idea of scope and should be selected such that *wrong code looks wrong*.
|
||||
|
||||
- Names should be descriptive but not overly so and they should give some idea of scope and should be selected such that _wrong code looks wrong_.
|
||||
- Names shall not give any idea of type, such as is done with System Hungarian notation.
|
||||
- Case
|
||||
- C preprocessor symbols should be all uppercase.
|
||||
- All OpenThread class, namespace, structure, method, function, enumeration, and type names in the C/C++ language shall be in *upper camel case*. Exception: the top level OpenThread namespace 'ot'.
|
||||
- All OpenThread instantiated names of instances of classes, namespaces, structures, methods, functions, enumerations, and types as well as method and function parameters in the C++ language shall be in *lower camel case*.
|
||||
- All OpenThread class, namespace, structure, method, function, enumeration, and type names in the C/C++ language shall be in _upper camel case_. Exception: the top level OpenThread namespace 'ot'.
|
||||
- All OpenThread instantiated names of instances of classes, namespaces, structures, methods, functions, enumerations, and types as well as method and function parameters in the C++ language shall be in _lower camel case_.
|
||||
- Symbol Qualification
|
||||
- All OpenThread C public data types and free functions should have `ot` prepended to their name.
|
||||
- All OpenThread C++ code should be in the ‘ot’ top-level namespace.
|
||||
@@ -142,6 +144,7 @@
|
||||
- All variables that do not have such prefixes shall be assumed to be function local scope.
|
||||
|
||||
### White Space
|
||||
|
||||
- Indentation shall be 4 space characters.
|
||||
- Conditionals shall always appear on a separate line from the code to execute as a result of the condition.
|
||||
- Scoped Variable declarations
|
||||
@@ -181,8 +184,8 @@
|
||||
|
||||
## Conventions and Best Practices
|
||||
|
||||
- Run `pylint` over your code. `pylint` is a tool for finding bugs and style problems in Python source code. It finds problems that are typically caught by a compiler for less dynamic languages like C and C++. Because of the dynamic nature of Python, some warnings may be incorrect; however, spurious warnings should be fairly infrequent.
|
||||
- Run `pylint` over your code. `pylint` is a tool for finding bugs and style problems in Python source code. It finds problems that are typically caught by a compiler for less dynamic languages like C and C++. Because of the dynamic nature of Python, some warnings may be incorrect; however, spurious warnings should be fairly infrequent.
|
||||
|
||||
## Format and Style
|
||||
|
||||
- All code should adhere to [PEP 8](https://www.python.org/dev/peps/pep-0008/).
|
||||
- All code should adhere to [Google Python Style Guide](http://google.github.io/styleguide/pyguide.html) except maximum line length being 119.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2016, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
@@ -36,10 +36,10 @@
|
||||
|
||||
nlbuild_autotools_stem="third_party/nlbuild-autotools/repo"
|
||||
|
||||
# Establish some key directories
|
||||
abs_srcdir=$(cd "$(dirname "${0}")" && pwd)
|
||||
|
||||
srcdir=`dirname ${0}`
|
||||
abs_srcdir=`pwd`
|
||||
abs_top_srcdir="${abs_srcdir}"
|
||||
|
||||
exec ${srcdir}/${nlbuild_autotools_stem}/scripts/bootstrap -I "${abs_top_srcdir}/${nlbuild_autotools_stem}" $*
|
||||
# filter out knowning information from stderr which is causing GitHub annotation check warnings.
|
||||
(cd "$abs_srcdir" && exec "$abs_srcdir/$nlbuild_autotools_stem/scripts/bootstrap" -I "$abs_srcdir/$nlbuild_autotools_stem" "${@}") 2> \
|
||||
>(grep -v "installing 'third_party/nlbuild-autotools/repo/third_party/autoconf/missing'" \
|
||||
| grep -v "installing 'third_party/nlbuild-autotools/repo/third_party/autoconf/compile'" \
|
||||
| grep -v "installing 'third_party/nlbuild-autotools/repo/third_party/autoconf/depcomp'" 1>&2)
|
||||
|
||||
+189
-118
@@ -137,24 +137,17 @@ case ${host_os} in
|
||||
|
||||
*darwin*)
|
||||
OPENTHREAD_TARGET=darwin
|
||||
OPENTHREAD_TARGET_DEFINES="-DOPENTHREAD_TARGET_DARWIN"
|
||||
;;
|
||||
|
||||
*linux*)
|
||||
OPENTHREAD_TARGET=linux
|
||||
OPENTHREAD_TARGET_DEFINES="-DOPENTHREAD_TARGET_LINUX"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
AC_SUBST(OPENTHREAD_TARGET_DARWIN)
|
||||
AM_CONDITIONAL([OPENTHREAD_TARGET_DARWIN], [test "${OPENTHREAD_TARGET}" = "darwin"])
|
||||
|
||||
AC_SUBST(OPENTHREAD_TARGET_LINUX)
|
||||
AM_CONDITIONAL([OPENTHREAD_TARGET_LINUX], [test "${OPENTHREAD_TARGET}" = "linux"])
|
||||
|
||||
AC_SUBST(OPENTHREAD_TARGET_DEFINES)
|
||||
|
||||
#
|
||||
# Checks for build host programs
|
||||
#
|
||||
@@ -170,12 +163,6 @@ if test "${enable_no_executables_hack}" = "yes"
|
||||
then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_NO_EXECUTABLES
|
||||
# Here we guess conservative values for tests that require link checks
|
||||
# to test for these features. This will prevent these checks from
|
||||
# being performed later in the configuration process.
|
||||
ac_cv_func_strlcat=${ac_cv_func_strlcat-no}
|
||||
ac_cv_func_strlcpy=${ac_cv_func_strlcpy-no}
|
||||
ac_cv_func_strnlen=${ac_cv_func_strnlen-no}
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
@@ -208,6 +195,8 @@ AC_PROG_CXX_C_O
|
||||
|
||||
AM_PROG_AS
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
# Check for other compiler toolchain tools.
|
||||
|
||||
AC_CHECK_TOOL(AR, ar)
|
||||
@@ -222,6 +211,11 @@ AC_PROG_LN_S
|
||||
|
||||
AC_PATH_PROG(CMP, cmp)
|
||||
|
||||
# Check for and initialize libtool
|
||||
|
||||
LT_INIT
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
#
|
||||
# Checks for specific compiler characteristics
|
||||
#
|
||||
@@ -232,8 +226,8 @@ AC_PATH_PROG(CMP, cmp)
|
||||
# -Wall CC, CXX
|
||||
#
|
||||
|
||||
PROSPECTIVE_CFLAGS="-Wall -Wextra -Wshadow -Werror -std=c99 -pedantic-errors -Wno-gnu-zero-variadic-macro-arguments"
|
||||
PROSPECTIVE_CXXFLAGS="-Wall -Wextra -Wshadow -Werror -std=gnu++98 -Wno-c++14-compat -fno-exceptions"
|
||||
PROSPECTIVE_CFLAGS="-Wall -Wextra -Wshadow -Wundef -Wcast-align -Werror -Wno-error=undef -std=c99 -pedantic-errors"
|
||||
PROSPECTIVE_CXXFLAGS="-Wall -Wextra -Wshadow -Wundef -Wcast-align -Werror -Wno-error=undef -std=c++11 -Wno-c++14-compat -fno-exceptions -pedantic-errors"
|
||||
|
||||
AC_CACHE_CHECK([whether $CC is Clang],
|
||||
[nl_cv_clang],
|
||||
@@ -250,17 +244,60 @@ AC_CACHE_CHECK([whether $CC is Clang],
|
||||
])
|
||||
|
||||
if test "${nl_cv_clang}" = "yes"; then
|
||||
PROSPECTIVE_CFLAGS="${PROSPECTIVE_CFLAGS} -Wconversion"
|
||||
PROSPECTIVE_CFLAGS="${PROSPECTIVE_CFLAGS} -Wconversion -Wno-gnu-zero-variadic-macro-arguments"
|
||||
PROSPECTIVE_CXXFLAGS="${PROSPECTIVE_CXXFLAGS} -Wconversion"
|
||||
fi
|
||||
|
||||
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
|
||||
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CXXFLAGS})
|
||||
function convert_warning_flags_to_positive() {
|
||||
flags_to_check=""
|
||||
warning_flag_backup=""
|
||||
for option in ${1}; do
|
||||
case "$option"
|
||||
in
|
||||
-Wno-*)
|
||||
flags_to_check="${flags_to_check} -W${option##-Wno-}"
|
||||
warning_flag_backup="${warning_flag_backup} ${option##-Wno-}";;
|
||||
*)
|
||||
flags_to_check="${flags_to_check} ${option}";;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Check for and initialize libtool
|
||||
function restore_negative_form_of_warning_flags() {
|
||||
final_flags=${1}
|
||||
for positive_option in ${warning_flag_backup}; do
|
||||
final_flags=$(echo $ECHO_N $final_flags | $SED "s|-W${positive_option}|-Wno-${positive_option}|g")
|
||||
done
|
||||
unset flags_to_check
|
||||
unset warning_flag_backup
|
||||
}
|
||||
|
||||
LT_INIT
|
||||
AC_PROG_LIBTOOL
|
||||
function check_prospective_CFLAGS() {
|
||||
if test "${nl_cv_clang}" = "yes"; then
|
||||
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
|
||||
else
|
||||
convert_warning_flags_to_positive "${PROSPECTIVE_CFLAGS}"
|
||||
AX_CHECK_COMPILER_OPTIONS([C], ${flags_to_check})
|
||||
restore_negative_form_of_warning_flags "${CFLAGS}"
|
||||
CFLAGS=${final_flags}
|
||||
unset final_flags
|
||||
fi
|
||||
}
|
||||
|
||||
function check_prospective_CXXFLAGS() {
|
||||
if test "${nl_cv_clang}" = "yes"; then
|
||||
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CXXFLAGS})
|
||||
else
|
||||
convert_warning_flags_to_positive "${PROSPECTIVE_CXXFLAGS}"
|
||||
AX_CHECK_COMPILER_OPTIONS([C++], ${flags_to_check})
|
||||
restore_negative_form_of_warning_flags "${CXXFLAGS}"
|
||||
CXXFLAGS=${final_flags}
|
||||
unset final_flags
|
||||
fi
|
||||
}
|
||||
|
||||
check_prospective_CFLAGS
|
||||
check_prospective_CXXFLAGS
|
||||
|
||||
# Disable building shared libraries by default (can be enabled with --enable-shared)
|
||||
|
||||
@@ -322,7 +359,7 @@ AM_CONDITIONAL([OPENTHREAD_ENABLE_FUZZ_TARGETS], [test "${enable_fuzz_targets}"
|
||||
|
||||
if test "${enable_fuzz_targets}" = "no" ; then
|
||||
PROSPECTIVE_CXXFLAGS="-fno-rtti"
|
||||
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CXXFLAGS})
|
||||
check_prospective_CXXFLAGS
|
||||
fi
|
||||
|
||||
# Address Sanitizer
|
||||
@@ -351,29 +388,18 @@ AM_CONDITIONAL([OPENTHREAD_WITH_ADDRESS_SANITIZER], [test "${enable_address_sani
|
||||
if test "${enable_address_sanitizer}" = "yes" ; then
|
||||
|
||||
PROSPECTIVE_CFLAGS="-fsanitize=address"
|
||||
PROSPECTIVE_CXXFLAGS="-fsanitize=address"
|
||||
|
||||
# Check if the compilers support address sanitizer
|
||||
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
|
||||
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CFLAGS})
|
||||
|
||||
check_prospective_CFLAGS
|
||||
check_prospective_CXXFLAGS
|
||||
fi
|
||||
|
||||
#
|
||||
# Code style
|
||||
#
|
||||
|
||||
AC_SUBST(PRETTY, ["\${abs_top_srcdir}/script/clang-format.sh"])
|
||||
AC_SUBST(PRETTY_ARGS, ["-style=file -i"])
|
||||
AC_SUBST(PRETTY_CHECK, ["\${abs_top_srcdir}/script/clang-format-check.sh"])
|
||||
AC_SUBST(PRETTY_CHECK_ARGS, [""])
|
||||
|
||||
#
|
||||
# Tests
|
||||
#
|
||||
AC_MSG_NOTICE([checking whether to build tests])
|
||||
|
||||
# Tests
|
||||
|
||||
NL_ENABLE_TESTS([yes])
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_BUILD_TESTS], [test "${nl_cv_build_tests}" = "yes"])
|
||||
@@ -414,65 +440,35 @@ AC_MSG_CHECKING([whether mbed TLS should be enabled])
|
||||
AC_MSG_RESULT(${enable_builtin_mbedtls})
|
||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_BUILTIN_MBEDTLS], [test "${enable_builtin_mbedtls}" = "yes"])
|
||||
|
||||
#
|
||||
# POSIX Application
|
||||
#
|
||||
|
||||
AC_MSG_CHECKING([whether to build POSIX applicaton])
|
||||
AC_ARG_ENABLE(posix-app,
|
||||
[AS_HELP_STRING([--enable-posix-app], [Build POSIX application @<:@default=no@:>@.])],
|
||||
[
|
||||
case "${enableval}" in
|
||||
|
||||
no|yes)
|
||||
enable_posix_app=${enableval}
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR([Invalid value ${enable_posix_app} for --enable-posix-app])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[enable_posix_app=no])
|
||||
|
||||
if test "$enable_posix_app" = "yes"; then
|
||||
CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_PLATFORM_POSIX_APP=1"
|
||||
else
|
||||
CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_PLATFORM_POSIX_APP=0"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT(${enable_posix_app})
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_POSIX_APP], [test "${enable_posix_app}" = "yes"])
|
||||
|
||||
#
|
||||
# POSIX Daemon
|
||||
#
|
||||
|
||||
AC_MSG_CHECKING([whether to build POSIX applicaton in daemon mode])
|
||||
AC_ARG_ENABLE(posix-app-daemon,
|
||||
[AS_HELP_STRING([--enable-posix-app-daemon], [Build POSIX application in daemon mode@<:@default=no@:>@.])],
|
||||
AC_ARG_ENABLE(posix-daemon,
|
||||
[AS_HELP_STRING([--enable-posix-daemon], [Build POSIX application in daemon mode@<:@default=no@:>@.])],
|
||||
[
|
||||
case "${enableval}" in
|
||||
|
||||
no|yes)
|
||||
enable_posix_app_daemon=${enableval}
|
||||
enable_posix_daemon=${enableval}
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR([Invalid value ${enable_posix_app} for --enable-posix-app-daemon])
|
||||
AC_MSG_ERROR([Invalid value ${enable_posix} for --enable-posix-daemon])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[enable_posix_app_daemon=no])
|
||||
[enable_posix_daemon=no])
|
||||
|
||||
if test "$enable_posix_app_daemon" = "yes"; then
|
||||
CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_ENABLE_POSIX_APP_DAEMON=1"
|
||||
if test "$enable_posix_daemon" = "yes"; then
|
||||
CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE=1"
|
||||
else
|
||||
CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_ENABLE_POSIX_APP_DAEMON=0"
|
||||
CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE=0"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT(${enable_posix_app_daemon})
|
||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_POSIX_APP_DAEMON], [test "${enable_posix_app_daemon}" = "yes"])
|
||||
AC_MSG_RESULT(${enable_posix_daemon})
|
||||
AM_CONDITIONAL([OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE], [test "${enable_posix_daemon}" = "yes"])
|
||||
|
||||
#
|
||||
# FTD Library
|
||||
@@ -780,20 +776,23 @@ AM_CONDITIONAL([OPENTHREAD_ENABLE_CUSTOM_LINKER_FILE], [test "${with_custom_link
|
||||
# Examples
|
||||
#
|
||||
|
||||
AC_MSG_CHECKING([whether to build examples])
|
||||
|
||||
AC_ARG_WITH(examples,
|
||||
[AS_HELP_STRING([--with-examples=TARGET],
|
||||
[Specify the examples from one of: no, posix, cc1352, cc2538, cc2650, cc2652, efr32mg12, efr32mg21, gp712, kw41z, nrf52811, nrf52840, qpg6095, samr21 @<:@default=no@:>@.])],
|
||||
[Build example applications for one of: simulation, cc1352, cc2538, cc2650, cc2652, efr32mg1, efr32mg12, efr32mg13, efr32mg21,
|
||||
gp712, jn5189, k32w061, kw41z, nrf52811, nrf52833, nrf52840, qpg6095, samr21 @<:@default=no@:>@.
|
||||
Note that building example applications also builds the associated OpenThread platform libraries
|
||||
and any third_party libraries needed to support the examples.])],
|
||||
[
|
||||
case "${with_examples}" in
|
||||
no)
|
||||
;;
|
||||
posix|cc1352|cc2538|cc2650|cc2652|efr32mg12|efr32mg21|gp712|kw41z|nrf52811|nrf52840|qpg6095|samr21)
|
||||
if test ${enable_posix_app} = "yes"; then
|
||||
AC_MSG_ERROR([--with-examples must be no when POSIX apps are enabled by --enable-posix-app])
|
||||
fi
|
||||
simulation|cc1352|cc2538|cc2650|cc2652|efr32mg1|efr32mg12|efr32mg13|efr32mg21|gp712|jn5189|k32w061|kw41z|nrf52811|nrf52833|nrf52840|qpg6095|samr21)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Invalid value ${with_examples} for --with-examples])
|
||||
AC_MSG_RESULT(ERROR)
|
||||
AC_MSG_ERROR([Invalid value given for --with-examples: ${with_examples}])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
@@ -801,26 +800,115 @@ AC_ARG_WITH(examples,
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_EXAMPLES], [test ${with_examples} != "no"])
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_POSIX], [test "${with_examples}" = "posix"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_SIMULATION],[test "${with_examples}" = "simulation"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC1352], [test "${with_examples}" = "cc1352"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2538], [test "${with_examples}" = "cc2538"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2650], [test "${with_examples}" = "cc2650"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2652], [test "${with_examples}" = "cc2652"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32MG1], [test "${with_examples}" = "efr32mg1"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32MG12], [test "${with_examples}" = "efr32mg12"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32MG13], [test "${with_examples}" = "efr32mg13"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32MG21], [test "${with_examples}" = "efr32mg21"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_GP712], [test "${with_examples}" = "gp712"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_JN5189], [test "${with_examples}" = "jn5189"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_K32W061], [test "${with_examples}" = "k32w061"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_KW41Z], [test "${with_examples}" = "kw41z"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52811], [test "${with_examples}" = "nrf52811"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52833], [test "${with_examples}" = "nrf52833"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52840], [test "${with_examples}" = "nrf52840"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_QPG6095], [test "${with_examples}" = "qpg6095"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_SAMR21], [test "${with_examples}" = "samr21"])
|
||||
|
||||
AM_COND_IF([OPENTHREAD_EXAMPLES_POSIX], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_POSIX=1")
|
||||
AM_COND_IF([OPENTHREAD_EXAMPLES_SIMULATION], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_SIMULATION=1", CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_SIMULATION=0")
|
||||
|
||||
AC_MSG_CHECKING([whether to enable examples])
|
||||
AC_MSG_RESULT(${with_examples})
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF528XX], [test OPENTHREAD_EXAMPLES_NRF52811 || test OPENTHREAD_EXAMPLES_NRF52833 || test OPENTHREAD_EXAMPLES_NRF52840])
|
||||
|
||||
case ${with_examples} in
|
||||
no)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([yes (${with_examples})])
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
# Platform
|
||||
#
|
||||
|
||||
AC_MSG_CHECKING([whether to build platform libraries])
|
||||
|
||||
AC_ARG_WITH(platform,
|
||||
[AS_HELP_STRING([--with-platform=TARGET],
|
||||
[Build OpenThread platform libraries for one of: cc1352, cc2538, cc2650, cc2652,
|
||||
efr32mg1, efr32mg12, efr32mg13, efr32mg21, gp712, jn5189, kw41z, nrf52811, nrf52833, nrf52840, posix, qpg6095, samr21, simulation @<:@default=simulation@:>@.])],
|
||||
[
|
||||
# Make sure the given target is valid.
|
||||
case "${with_platform}" in
|
||||
no|cc1352|cc2538|cc2650|cc2652|efr32mg1|efr32mg12|efr32mg13|efr32mg21|gp712|jn5189|kw41z|nrf52811|nrf52833|nrf52840|posix|qpg6095|samr21|simulation)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(ERROR)
|
||||
AC_MSG_ERROR([Invalid value given for --with-platform: ${with_platform}])
|
||||
;;
|
||||
esac
|
||||
|
||||
# If both --with-platform and --with-examples are specified, make sure the targets match.
|
||||
case "${with_examples}" in
|
||||
no)
|
||||
;;
|
||||
${with_platform})
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(ERROR)
|
||||
AC_MSG_ERROR([Invalid value given for --with-platform: The targets for --with-examples and --with-platform must match.])
|
||||
;;
|
||||
esac
|
||||
|
||||
],
|
||||
[
|
||||
# If --with-platform is NOT specified, but --with-examples is, automatically build the
|
||||
# corresponding platform libraries. (Essentially, --with-examples implies --with-platform).
|
||||
with_platform=${with_examples}
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_PLATFORM], [test ${with_platform} != "no"])
|
||||
|
||||
OPENTHREAD_ENABLE_PLATFORM=${with_platform}
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_CC1352], [test "${with_platform}" = "cc1352"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_CC2538], [test "${with_platform}" = "cc2538"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_CC2650], [test "${with_platform}" = "cc2650"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_CC2652], [test "${with_platform}" = "cc2652"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32MG1], [test "${with_platform}" = "efr32mg1"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32MG12], [test "${with_platform}" = "efr32mg12"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32MG13], [test "${with_platform}" = "efr32mg13"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32MG21], [test "${with_platform}" = "efr32mg21"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_GP712], [test "${with_platform}" = "gp712"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_JN5189], [test "${with_platform}" = "jn5189"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_KW41Z], [test "${with_platform}" = "kw41z"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52811], [test "${with_platform}" = "nrf52811"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52833], [test "${with_platform}" = "nrf52833"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52840], [test "${with_platform}" = "nrf52840"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_POSIX], [test "${with_platform}" = "posix"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_QPG6095], [test "${with_platform}" = "qpg6095"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_SAMR21], [test "${with_platform}" = "samr21"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_SIMULATION],[test "${with_platform}" = "simulation"])
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF528XX], [test OPENTHREAD_PLATFORM_NRF52811 || test OPENTHREAD_PLATFORM_NRF52833 || test OPENTHREAD_PLATFORM_NRF52840])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_K32W], [test OPENTHREAD_PLATFORM_K32W061 || test OPENTHREAD_PLATFORM_JN5189])
|
||||
|
||||
AM_COND_IF([OPENTHREAD_PLATFORM_POSIX], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_PLATFORM_POSIX=1", CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_PLATFORM_POSIX=0")
|
||||
|
||||
case ${with_platform} in
|
||||
no)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([yes (${with_platform})])
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF528XX], [test OPENTHREAD_EXAMPLES_NRF52811 || test OPENTHREAD_EXAMPLES_NRF52840])
|
||||
#
|
||||
# Tools
|
||||
#
|
||||
@@ -857,7 +945,7 @@ NL_ENABLE_DOCS([auto],[NO])
|
||||
|
||||
AM_CONDITIONAL(OPENTHREAD_BUILD_DOCS, [test "${nl_cv_build_docs}" = "yes"])
|
||||
|
||||
AM_CONDITIONAL(OPENTHREAD_POSIX, [test "${enable_posix_app}" = "yes" -o "${with_examples}" = "posix"])
|
||||
AM_CONDITIONAL(OPENTHREAD_POSIX, [test "${with_platform}" = "posix" -o "${with_examples}" = "simulation"])
|
||||
|
||||
#
|
||||
# Checks for libraries and packages.
|
||||
@@ -875,21 +963,6 @@ AC_MSG_NOTICE([checking required package dependencies])
|
||||
# Check for headers
|
||||
#
|
||||
|
||||
#---------------------------------------------------
|
||||
# Enable BSD Security Features
|
||||
# This enables strlcpy() and other friends in GNU land.
|
||||
# While the references below generally speak of: "glibc"
|
||||
# The ARM Embedded platform uses the nano instance of NEWLIB
|
||||
# Which greatly follows and mirrors glibc.
|
||||
# --------------------------------------------------
|
||||
#
|
||||
# References:
|
||||
# 1) http://stackoverflow.com/questions/29201515/what-does-d-default-source-do
|
||||
# 2) http://man7.org/linux/man-pages/man7/feature_test_macros.7.html
|
||||
#
|
||||
CFLAGS="${CFLAGS} -D_BSD_SOURCE=1 -D_DEFAULT_SOURCE=1"
|
||||
CXXFLAGS="${CXXFLAGS} -D_BSD_SOURCE=1 -D_DEFAULT_SOURCE=1"
|
||||
|
||||
OLD_CFLAGS="${CFLAGS}"
|
||||
CFLAGS="${CFLAGS} -Wno-error=address"
|
||||
AC_HEADER_STDBOOL
|
||||
@@ -899,13 +972,6 @@ AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stdint.h])
|
||||
AC_CHECK_HEADERS([string.h])
|
||||
|
||||
#
|
||||
# Missing Functions
|
||||
#
|
||||
AC_CHECK_FUNC([strlcpy], [AC_DEFINE([HAVE_STRLCPY], [1], [Define if strlcpy exists.])])
|
||||
AC_CHECK_FUNC([strlcat], [AC_DEFINE([HAVE_STRLCAT], [1], [Define if strlcat exists.])])
|
||||
AC_CHECK_FUNC([strnlen], [AC_DEFINE([HAVE_STRNLEN], [1], [Define if strnlen exists.])])
|
||||
|
||||
#
|
||||
# Check for types and structures
|
||||
#
|
||||
@@ -948,14 +1014,17 @@ NL_RESTORE_WERROR
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
include/Makefile
|
||||
include/openthread/Makefile
|
||||
include/openthread/platform/Makefile
|
||||
src/Makefile
|
||||
src/cli/Makefile
|
||||
src/ncp/Makefile
|
||||
src/core/Makefile
|
||||
src/posix/Makefile
|
||||
src/posix/platform/Makefile
|
||||
src/lib/Makefile
|
||||
src/lib/hdlc/Makefile
|
||||
src/lib/platform/Makefile
|
||||
src/lib/spinel/Makefile
|
||||
src/lib/url/Makefile
|
||||
third_party/Makefile
|
||||
third_party/jlink/Makefile
|
||||
third_party/mbedtls/Makefile
|
||||
@@ -970,20 +1039,26 @@ examples/platforms/cc1352/Makefile
|
||||
examples/platforms/cc2538/Makefile
|
||||
examples/platforms/cc2650/Makefile
|
||||
examples/platforms/cc2652/Makefile
|
||||
examples/platforms/efr32mg1/Makefile
|
||||
examples/platforms/efr32mg12/Makefile
|
||||
examples/platforms/efr32mg12/sleepy-demo/Makefile
|
||||
examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-ftd/Makefile
|
||||
examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-mtd/Makefile
|
||||
examples/platforms/efr32mg13/Makefile
|
||||
examples/platforms/efr32mg13/sleepy-demo/Makefile
|
||||
examples/platforms/efr32mg13/sleepy-demo/sleepy-demo-ftd/Makefile
|
||||
examples/platforms/efr32mg13/sleepy-demo/sleepy-demo-mtd/Makefile
|
||||
examples/platforms/efr32mg21/Makefile
|
||||
examples/platforms/efr32mg21/sleepy-demo/Makefile
|
||||
examples/platforms/efr32mg21/sleepy-demo/sleepy-demo-ftd/Makefile
|
||||
examples/platforms/efr32mg21/sleepy-demo/sleepy-demo-mtd/Makefile
|
||||
examples/platforms/gp712/Makefile
|
||||
examples/platforms/k32w/Makefile
|
||||
examples/platforms/kw41z/Makefile
|
||||
examples/platforms/nrf528xx/Makefile
|
||||
examples/platforms/qpg6095/Makefile
|
||||
examples/platforms/samr21/Makefile
|
||||
examples/platforms/posix/Makefile
|
||||
examples/platforms/simulation/Makefile
|
||||
examples/platforms/utils/Makefile
|
||||
tools/Makefile
|
||||
tools/harness-automation/Makefile
|
||||
@@ -1051,10 +1126,6 @@ AC_MSG_NOTICE([
|
||||
Link flags : ${LDFLAGS:--}
|
||||
Link libraries : ${LIBS}
|
||||
Link maps : ${enable_linker_map}
|
||||
Pretty : ${PRETTY:--}
|
||||
Pretty args : ${PRETTY_ARGS:--}
|
||||
Pretty check : ${PRETTY_CHECK:--}
|
||||
Pretty check args : ${PRETTY_CHECK_ARGS:--}
|
||||
OpenThread FTD support : ${enable_ftd}
|
||||
OpenThread MTD support : ${enable_mtd}
|
||||
OpenThread Radio Only support : ${enable_radio_only}
|
||||
@@ -1065,6 +1136,6 @@ AC_MSG_NOTICE([
|
||||
OpenThread Vendor Extension Source : ${with_vendor_extension}
|
||||
OpenThread builtin mbedtls support : ${enable_builtin_mbedtls}
|
||||
OpenThread Examples : ${with_examples}
|
||||
OpenThread POSIX Application : ${enable_posix_app}
|
||||
OpenThread Platform Libraries : ${with_platform}
|
||||
|
||||
])
|
||||
|
||||
+4
-1
@@ -38,7 +38,6 @@ EXTRA_DIST = \
|
||||
$(srcdir)/images/ot-contrib-google.png \
|
||||
$(srcdir)/images/ot-contrib-nordic.png \
|
||||
$(srcdir)/images/ot-contrib-nxp.png \
|
||||
$(srcdir)/images/ot-contrib-particle.png \
|
||||
$(srcdir)/images/ot-contrib-qc.png \
|
||||
$(srcdir)/images/ot-contrib-qorvo.png \
|
||||
$(srcdir)/images/ot-contrib-samsung.png \
|
||||
@@ -47,6 +46,7 @@ EXTRA_DIST = \
|
||||
$(srcdir)/images/ot-contrib-synopsys.png \
|
||||
$(srcdir)/images/ot-contrib-ti.png \
|
||||
$(srcdir)/images/ot-contrib-zephyr.png \
|
||||
$(srcdir)/ot_api_doc.h \
|
||||
$(NULL)
|
||||
|
||||
#
|
||||
@@ -77,6 +77,9 @@ CLEANFILES = \
|
||||
|
||||
if OPENTHREAD_BUILD_DOCS
|
||||
|
||||
openthreaddir = $(includedir)/openthread
|
||||
dist_openthread_HEADERS = ot_api_doc.h
|
||||
|
||||
all-local: html/index.html
|
||||
|
||||
#
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB |
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
* This file defines the Doxygen group structure for OpenThread documentation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup api API
|
||||
* @brief
|
||||
* This module includes the application programming interface to the OpenThread stack.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-error Error
|
||||
*
|
||||
* @defgroup api-execution Execution
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-instance Instance
|
||||
* @defgroup api-tasklets Tasklets
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup api-net IPv6 Networking
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-dns DNSv6
|
||||
* @defgroup api-icmp6 ICMPv6
|
||||
* @defgroup api-ip6 IPv6
|
||||
* @defgroup api-udp-group UDP
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-udp UDP
|
||||
* @defgroup api-udp-forward UDP Forward
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup api-link Link
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-link-link Link
|
||||
* @defgroup api-link-raw Raw Link
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup api-message Message
|
||||
*
|
||||
* @defgroup api-thread Thread
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-backbone-router Backbone Router
|
||||
* @defgroup api-border-agent Border Agent
|
||||
* @defgroup api-border-router Border Router
|
||||
* @defgroup api-commissioner Commissioner
|
||||
* @defgroup api-thread-general General
|
||||
* @brief This module includes functions for all Thread roles.
|
||||
* @defgroup api-joiner Joiner
|
||||
* @defgroup api-thread-router Router/Leader
|
||||
* @brief This module includes functions for Thread Routers and Leaders.
|
||||
* @defgroup api-server Server
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup api-addons Add-Ons
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-channel-manager Channel Manager
|
||||
* @defgroup api-channel-monitor Channel Monitoring
|
||||
* @defgroup api-child-supervision Child Supervision
|
||||
* @defgroup api-coap-group CoAP
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-coap CoAP
|
||||
* @defgroup api-coap-secure CoAP Secure
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup api-cli Command Line Interface
|
||||
* @defgroup api-crypto Crypto
|
||||
* @defgroup api-entropy Entropy Source
|
||||
* @defgroup api-factory-diagnostics Factory Diagnostics
|
||||
* @defgroup api-heap Heap
|
||||
* @defgroup api-jam-detection Jam Detection
|
||||
* @defgroup api-logging Logging
|
||||
* @defgroup api-ncp Network Co-Processor
|
||||
* @defgroup api-network-time Network Time Synchronization
|
||||
* @defgroup api-random-group Random Number Generator
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup api-random-crypto RNG Cryptographic
|
||||
* @defgroup api-random-non-crypto RNG Non-cryptographic
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup api-sntp SNTP
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup platform Platform Abstraction
|
||||
* @brief
|
||||
* This module includes the platform abstraction used by the OpenThread stack.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup plat-alarm Alarm
|
||||
* @defgroup plat-ble BLE Host
|
||||
* @defgroup plat-entropy Entropy
|
||||
* @defgroup plat-factory-diagnostics Factory Diagnostics
|
||||
* @defgroup plat-logging Logging
|
||||
* @defgroup plat-memory Memory
|
||||
* @defgroup plat-messagepool Message Pool
|
||||
* @defgroup plat-misc Miscellaneous
|
||||
* @defgroup plat-otns Network Simulator
|
||||
* @defgroup plat-radio Radio
|
||||
* @defgroup plat-settings Settings
|
||||
* @defgroup plat-spi-slave SPI Slave
|
||||
* @defgroup plat-time Time Service
|
||||
* @defgroup plat-toolchain Toolchain
|
||||
* @defgroup plat-uart UART
|
||||
*
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,37 @@
|
||||
# What is Thread?
|
||||
|
||||
<figure class="attempt-right">
|
||||
<img src="../images/ot-logo-thread.png" srcset="../images/ot-logo-thread.png 1x, ../images/ot-logo-thread_2x.png 2x" border="0" alt="Thread" />
|
||||
</figure>
|
||||
|
||||
<a href="http://threadgroup.org/">Thread<sup>®</sup></a> is an IPv6-based
|
||||
networking protocol designed for low-power Internet of Things devices in an IEEE
|
||||
802.15.4-2006 wireless mesh network, commonly called a Wireless Personal Area
|
||||
Network (WPAN). Thread is independent of other 802.15 mesh networking
|
||||
protocols, such a ZigBee, Z-Wave, and Bluetooth LE.
|
||||
|
||||
Thread's primary features include:
|
||||
|
||||
* Simplicity — Simple installation, start up, and operation
|
||||
* Security — All devices in a Thread network are authenticated and all
|
||||
communications are encrypted
|
||||
* Reliability — Self-healing mesh networking, with no single point of failure,
|
||||
and spread-spectrum techniques to provide immunity to interference
|
||||
* Efficiency — Low-power Thread devices can sleep and operate on battery power
|
||||
for years
|
||||
* Scalability — Thread networks can scale up to hundreds of devices
|
||||
|
||||
If you're new to Thread, understanding the basics are critical to using
|
||||
OpenThread in your own applications. The goal of this primer is to explain the
|
||||
concepts behind Thread and how it works, and provide a springboard to OpenThread
|
||||
development.
|
||||
|
||||
It is assumed you have good working knowledge of the following:
|
||||
|
||||
* IEEE 802.15.4
|
||||
* Networking and routing concepts
|
||||
* IPv6
|
||||
|
||||
This primer is based on version 1.1.1 of the Thread Specification. It does not
|
||||
cover the full specification, which is available at
|
||||
[threadgroup.org](http://threadgroup.org/ThreadSpec).
|
||||
@@ -0,0 +1,276 @@
|
||||
# IPv6 Addressing
|
||||
|
||||
Let's take a look at how Thread identifies each device in the network, and what
|
||||
types of addresses they use to communicate with each other.
|
||||
|
||||
Key Term: In this primer, the term "interface" is used to identify an endpoint
|
||||
of a Thread device within a network. Typically, a single Thread device has
|
||||
a single Thread interface.
|
||||
|
||||
## Scopes
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-scopes_2x.png"><img src="../images/ot-primer-scopes.png" srcset="../images/ot-primer-scopes.png 1x, ../images/ot-primer-scopes_2x.png 2x" border="0" alt="OT Scopes" /></a>
|
||||
</figure>
|
||||
|
||||
There are three scopes in a Thread network for unicast addressing:
|
||||
|
||||
* Link-Local — all interfaces reachable by a single radio transmission
|
||||
* Mesh-Local — all interfaces reachable within the same Thread network
|
||||
* Global — all interfaces reachable from outside a Thread network
|
||||
|
||||
The first two scopes correspond to prefixes designated by a Thread network.
|
||||
Link-Local have prefixes of `fe80::/16`, while Mesh-Local have prefixes of
|
||||
`fd00::/8`.
|
||||
|
||||
<h2 style="clear:right">Unicast</h2>
|
||||
|
||||
There are multiple IPv6 unicast addresses that identify a single Thread device.
|
||||
Each has a different function based on the scope and use case.
|
||||
|
||||
Before we detail each type, let's learn more about a common one, called the
|
||||
Routing Locator (RLOC). The RLOC identifies a Thread interface, based on its
|
||||
location in the network topology.
|
||||
|
||||
### How a Routing Locator is generated
|
||||
|
||||
All devices are assigned a Router ID and a Child ID. Each Router maintains a
|
||||
table of all their Children, the combination of which uniquely identifies a
|
||||
device within the topology. For example, consider the highlighted nodes in the
|
||||
following topology, where the number in a Router (pentagon) is the Router ID,
|
||||
and the number in an End Device (circle) is the Child ID:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc-topology_2x.png"><img src="../images/ot-primer-rloc-topology.png" srcset="../images/ot-primer-rloc-topology.png 1x, ../images/ot-primer-rloc-topology_2x.png 2x" border="0" width="600" alt="OT RLOC Topology" /></a>
|
||||
</figure>
|
||||
|
||||
Each Child's Router ID corresponds to their Parent (Router). Because a Router is
|
||||
not a Child, the Child ID for a Router is always 0. Together, these values are
|
||||
unique for each device in the Thread network, and are used to create the RLOC16,
|
||||
which represents the last 16 bits of the RLOC.
|
||||
|
||||
For example, here's how the RLOC16 is calculated for the upper-left node (Router
|
||||
ID = 1 and Child ID = 1):
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc16_2x.png"><img src="../images/ot-primer-rloc16.png" srcset="../images/ot-primer-rloc16.png 1x, ../images/ot-primer-rloc16_2x.png 2x" border="0" width="400" alt="OT RLOC16" /></a>
|
||||
</figure>
|
||||
|
||||
The RLOC16 is part of the Interface Identifier (IID), which corresponds to the
|
||||
last 64 bits of the IPv6 address. Some IIDs can be used to identify some types
|
||||
of Thread interfaces. For example, the IID for RLOCs is always of the form
|
||||
<code>0000:00ff:fe00:<var>RLOC16</var></code>.
|
||||
|
||||
The IID, combined with a Mesh-Local Prefix, results in the RLOC. For example,
|
||||
using a Mesh-Local Prefix of `fde5:8dba:82e1:1::/64`, the RLOC for a node where
|
||||
RLOC16 = `0x401` is:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc_2x.png"><img src="../images/ot-primer-rloc.png" srcset="../images/ot-primer-rloc.png 1x, ../images/ot-primer-rloc_2x.png 2x" border="0" width="600" alt="OT RLOC" /></a>
|
||||
</figure>
|
||||
|
||||
This same logic can be used to determine the RLOC for all highlighted nodes in the sample topology above:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc-topology-address_2x.png"><img src="../images/ot-primer-rloc-topology-address.png" srcset="../images/ot-primer-rloc-topology-address.png 1x, ../images/ot-primer-rloc-topology-address_2x.png 2x" border="0" width="600" alt="OT Topology w/ Address" /></a>
|
||||
</figure>
|
||||
|
||||
However, because the RLOC is based on the location of the node in the topology,
|
||||
the RLOC of a node can change as the topology changes.
|
||||
|
||||
For example, perhaps node `0x400` is removed from the Thread network. Nodes
|
||||
`0x401` and `0x402` establish new links to different Routers, and as a result
|
||||
they are each assigned a new RLOC16 and RLOC:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc-topology-change_2x.png"><img src="../images/ot-primer-rloc-topology-change.png" srcset="../images/ot-primer-rloc-topology-change.png 1x, ../images/ot-primer-rloc-topology-change_2x.png 2x" border="0" width="600" alt="OT Topology after Change" /></a>
|
||||
</figure>
|
||||
|
||||
## Unicast address types
|
||||
The RLOC is just one of many IPv6 unicast addresses a Thread device can have.
|
||||
Another category of addresses are called Endpoint Identifiers (EIDs), which
|
||||
identify a unique Thread interface within a Thread network partition. EIDs are
|
||||
independent of Thread network topology.
|
||||
|
||||
Common unicast types are detailed below.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Link-Local Address (LLA)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">An EID that identifies a Thread interface reachable by a single radio transmission.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Example</b></td><td><code>fe80::54db:881c:3845:57f4</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td>Based on 802.15.4 Extended Address</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Scope</b></td><td>Link-Local</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Details</b></td><td><ul><li>Used to discover neighbors, configure links, and exchange routing information</li><li>Not a routable address</li><li>Always has a prefix of <code>fe80::/16</code></li></ul></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Mesh-Local EID (ML-EID)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">An EID that identifies a Thread interface, independent of network topology. Used to reach a Thread interface within the same Thread partition. Also called a Unique Local Address (ULA).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Example</b></td><td><code>fde5:8dba:82e1:1:416:993c:8399:35ab</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td>Random, chosen after commissioning is complete</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Scope</b></td><td>Mesh-Local</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Details</b></td><td><ul><li>Does not change as the topology changes</li><li>Should be used by applications</li><li>Always has a prefix <code>fd00::/8</code></li></ul></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Routing Locator (RLOC)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">Identifies a Thread interface, based on its location in the network topology.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Example</b></td><td><code>fde5:8dba:82e1:1::ff:fe00:1001</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td><code>0000:00ff:fe00:<var>RLOC16</var></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Scope</b></td><td>Mesh-Local</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Details</b></td><td><ul><li>Generated once a device attaches to a network</li><li>For delivering IPv6 datagrams within a Thread network</li><li>Changes as the topology changes</li><li>Generally not used by applications</li></ul></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Anycast Locator (ALOC)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">Identifies a Thread interface via RLOC lookup, when the RLOC of a destination is not known.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Example</b></td><td><code>fde5:8dba:82e1:1::ff:fe00:fc01</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td><code>0000:00ff:fe00:fc<var>XX</var></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Scope</b></td><td>Mesh-Local</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Details</b></td><td><ul><li><code>fc<var>XX</var></code> = <a href="#anycast">ALOC destination</a>, which looks up the appropriate RLOC</li><li>Generally not used by applications</li></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Global Unicast Address (GUA)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">An EID that identifies a Thread interface on a global scope, beyond a Thread network.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Example</b></td><td><code>2000::54db:881c:3845:57f4</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td><ul><li>SLAAC — Randomly assigned by the device itself</li><li>DHCP — Assigned by a DHCPv6 server</li><li>Manual — Assigned by the application layer</li></ul></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Scope</b></td><td>Global</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Details</b></td><td><ul><li>A public IPv6 address</li><li>Always has a prefix of <code>2000::/3</code></li></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Multicast
|
||||
|
||||
Multicast is used to communicate information to multiple devices at once. In a
|
||||
Thread network, specific addresses are reserved for multicast use with different
|
||||
groups of devices, depending on the scope.
|
||||
|
||||
| IPv6 Address | Scope | Delivered to |
|
||||
| ------------ | ---------- | ----------------- |
|
||||
| `ff02::1` | Link-Local | All FTDs and MEDs |
|
||||
| `ff02::2` | Link-Local | All FTDs |
|
||||
| `ff03::1` | Mesh-Local | All FTDs and MEDs |
|
||||
| `ff03::2` | Mesh-Local | All FTDs |
|
||||
|
||||
Key Point: A major difference between FTDs and MTDs are that FTDs subscribe to
|
||||
the `ff03::2` multicast address. MTDs do not.
|
||||
|
||||
You might notice that Sleepy End Devices (SEDs) are not included as a
|
||||
recipient in the multicast table above. Instead, Thread defines
|
||||
link-local and realm-local scope unicast prefix-based IPv6 multicast
|
||||
address used for All Thread Nodes, including SEDs. These multicast
|
||||
addresses vary by Thread network, because it is built on the unicast
|
||||
Mesh-Local prefix (see [RFC 3306](https://tools.ietf.org/html/rfc3306)
|
||||
for more details on unicast-prefix-based IPv6 multicast addresses).
|
||||
|
||||
Arbitrary scopes beyond those already listed are also supported for Thread
|
||||
devices.
|
||||
|
||||
|
||||
## Anycast
|
||||
|
||||
Anycast is used to route traffic to a Thread interface when the RLOC of a
|
||||
destination is not known. An Anycast Locator (ALOC) identifies the location of
|
||||
multiple interfaces within a Thread partition. The last 16 bits of an ALOC,
|
||||
called the ALOC16, is in the format of <code>0xfc<var>XX</var></code>, which
|
||||
represents the type of ALOC.
|
||||
|
||||
For example, an ALOC16 between `0xfc01` and `0xfc0f` is reserved for DHCPv6
|
||||
Agents. If the specific DHCPv6 Agent RLOC is unknown (perhaps because the
|
||||
network topology has changed), a message can be sent to a DHCPv6 Agent ALOC to
|
||||
obtain the RLOC.
|
||||
|
||||
Thread defines the following ALOC16 values:
|
||||
|
||||
| ALOC16 | Type |
|
||||
| ------------------------------------------ | ------------------------ |
|
||||
| `0xfc00` | Leader |
|
||||
| `0xfc01` – `0xfc0f` | DHCPv6 Agent |
|
||||
| `0xfc10` – `0xfc2f` | Service |
|
||||
| `0xfc30` – `0xfc37` | Commissioner |
|
||||
| `0xfc40` – `0xfc4e` | Neighbor Discovery Agent |
|
||||
| `0xfc38` – `0xfc3f`<br>`0xfc4f` – `0xfcff` | Reserved |
|
||||
|
||||
## Recap
|
||||
|
||||
What you've learned:
|
||||
|
||||
* A Thread network consists of three scopes: Link-Local, Mesh-Local, and Global
|
||||
* A Thread device has multiple unicast IPv6 addresses
|
||||
* An RLOC represents a device's location in the Thread network
|
||||
* An ML-EID is unique to a Thread device within a partition and should be used by applications
|
||||
* Thread uses multicast to forward data to groups of nodes and routers
|
||||
* Thread uses anycast when the RLOC of a destination is unknown
|
||||
|
||||
To learn more about Thread's IPv6 addressing, see sections 5.2 and 5.3 of the
|
||||
[Thread Specification](http://threadgroup.org/ThreadSpec).
|
||||
@@ -0,0 +1,292 @@
|
||||
# Network Discovery and Formation
|
||||
|
||||
## Thread networks
|
||||
|
||||
Thread networks are identified by three unique identifiers:
|
||||
|
||||
* 2-byte Personal Area Network ID (PAN ID)
|
||||
* 8-byte Extended Personal Area Network ID (XPAN ID)
|
||||
* A human-readable Network Name
|
||||
|
||||
For example, a Thread network may have the following identifiers:
|
||||
|
||||
Identifier | Value
|
||||
---- | ----
|
||||
PAN ID | `0xBEEF`
|
||||
XPAN ID | `0xBEEF1111CAFE2222`
|
||||
Network Name | `yourThreadCafe`
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-network-active-scan_2x.png"><img src="../images/ot-primer-network-active-scan.png" srcset="../images/ot-primer-network-active-scan.png 1x, ../images/ot-primer-network-active-scan_2x.png 2x" border="0" alt="OT Active Scan" /></a>
|
||||
</figure>
|
||||
|
||||
When creating a new Thread network, or searching for an existing one to join, a
|
||||
Thread device performs an active scan for 802.15.4 networks within radio range:
|
||||
|
||||
1. The device broadcasts an 802.15.4 Beacon Request on a specific Channel.
|
||||
1. In return, any Routers or Router Eligible End Devices (REEDs) in range
|
||||
broadcast a Beacon that contains their Thread network PAN ID, XPAN ID, and
|
||||
Network Name.
|
||||
1. The device repeats the previous two steps for each Channel.
|
||||
|
||||
Once a Thread device has discovered all networks in range, it can either attach
|
||||
to an existing network, or create a new one if no networks are discovered.
|
||||
|
||||
<h2 style="clear:right">Mesh Link Establishment</h2>
|
||||
|
||||
Thread uses the Mesh Link Establishment (MLE) protocol to configure links and
|
||||
disseminate information about the network to Thread devices.
|
||||
|
||||
In link configuration, MLE is used to:
|
||||
|
||||
* Discover links to neighboring devices
|
||||
* Determine the quality of links to neighboring devices
|
||||
* Establish links to neighboring devices
|
||||
* Negotiate link parameters (device type, frame counters, timeout) with peers
|
||||
|
||||
MLE disseminates the following types of information to devices wishing to
|
||||
establish links:
|
||||
|
||||
* Leader data (Leader RLOC, Partition ID, Partition weight)
|
||||
* Network data (on-mesh prefixes, address autoconfiguration, more-specific
|
||||
routes)
|
||||
* Route propagation
|
||||
|
||||
Route propagation in Thread works similar to the Routing Information Protocol
|
||||
(RIP), a distance-vector routing protocol.
|
||||
|
||||
Note: MLE only proceeds once a Thread device has obtained Thread network
|
||||
credentials through Thread Commissioning. Commissioning and Security will be
|
||||
covered in depth later in this Primer. For now, this page assumes that the
|
||||
device has already been commissioned.
|
||||
|
||||
## Create a new network
|
||||
|
||||
If the device elects to create a new network, it selects the least busy Channel
|
||||
and a PAN ID not in use by other networks, then becomes a Router and elects
|
||||
itself the Leader. This device sends MLE Advertisement messages to other
|
||||
802.15.4 devices to inform them of its link state, and responds to Beacon
|
||||
Requests by other Thread devices performing an active scan.
|
||||
|
||||
## Join an existing network
|
||||
|
||||
If the device elects to join an existing network, it configures its Channel, PAN
|
||||
ID, XPAN ID, and Network Name to match that of the target network via Thread
|
||||
Commissioning, then goes through the MLE Attach process to attach as a Child
|
||||
(End Device). This process is used for Child-Parent links.
|
||||
|
||||
Key Point: Every device, router-capable or not, initially attaches to a Thread
|
||||
network as a Child (End Device).
|
||||
|
||||
1. The Child sends a multicast [Parent Request](#1_parent_request) to all
|
||||
neighboring Routers and REEDs in the target network.
|
||||
1. All neighboring Routers and REEDs (if the Parent Request Scan Mask includes
|
||||
REEDs) send [Parent Responses](#2_parent_response) with information about
|
||||
themselves.
|
||||
1. The Child chooses a Parent device and sends a [Child ID
|
||||
Request](#3_child_id_request) to it.
|
||||
1. The Parent sends a [Child ID Response](#4_child_id_response) to confirm link
|
||||
establishment.
|
||||
|
||||
### 1. Parent Request
|
||||
|
||||
A Parent Request is a multicast request from the attaching device that is used
|
||||
to discover neighboring Routers and Router Eligible End Devices (REEDs) in the
|
||||
target network.
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-attach-01_2x.png"><img src="../images/ot-primer-network-mle-attach-01.png" srcset="../images/ot-primer-network-mle-attach-01.png 1x, ../images/ot-primer-network-mle-attach-01_2x.png 2x" width="350" border="0" alt="OT MLE Attach Parent Request" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Parent Request Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Mode</b></td>
|
||||
<td>Describes the attaching device</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Challenge</b></td>
|
||||
<td>Tests the timeliness of the Parent Response to prevent replay
|
||||
attacks</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Scan Mask</b></td>
|
||||
<td>Limits the request to only Routers or to both Routers and REEDs</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 2. Parent Response
|
||||
|
||||
A Parent Response is a unicast response to a Parent Request that provides
|
||||
information about a Router or REED to the attaching device.
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-attach-02_2x.png"><img src="../images/ot-primer-network-mle-attach-02.png" srcset="../images/ot-primer-network-mle-attach-02.png 1x, ../images/ot-primer-network-mle-attach-02_2x.png 2x" width="350" border="0" alt="OT MLE Attach Parent Response" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Parent Response Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Version</b></td>
|
||||
<td>Thread protocol version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Response</b></td>
|
||||
<td>Copy of the Parent Request Challenge</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Link Frame
|
||||
Counter</b></td>
|
||||
<td>802.15.4 Frame Counter on the Router/REED</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>MLE Frame
|
||||
Counter</b></td>
|
||||
<td>MLE Frame Counter on the Router/REED</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Source
|
||||
Address</b></td>
|
||||
<td>RLOC16 of the Router/REED</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Link
|
||||
Margin</b></td>
|
||||
<td>Receive signal quality of the Router/REED</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Connectivity</b></td>
|
||||
<td>Describes the Router/REED’s level of connectivity</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Leader
|
||||
Data</b></td>
|
||||
<td>Information about the Router/REED’s Leader</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Challenge</b></td>
|
||||
<td>Tests the timeliness of the Child ID Request to prevent replay
|
||||
attacks</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 3. Child ID Request
|
||||
|
||||
A Child ID Request is a unicast request from the attaching device (Child) that
|
||||
is sent to the Router or REED (Parent) for the purpose of establishing a
|
||||
Child-Parent link. If the request is sent to a REED, it [upgrades itself to a
|
||||
Router](/guides/thread-primer/router-selection#upgrade_to_a_router) before
|
||||
accepting the request.
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-attach-03_2x.png"><img src="../images/ot-primer-network-mle-attach-03.png" srcset="../images/ot-primer-network-mle-attach-03.png 1x, ../images/ot-primer-network-mle-attach-03_2x.png 2x" width="350" border="0" alt="OT MLE Attach Child ID Request" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Child ID Request Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Version</b></td>
|
||||
<td>Thread protocol version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Response</b></td>
|
||||
<td>Copy of the Parent Response Challenge</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Link Frame
|
||||
Counter</b></td>
|
||||
<td>802.15.4 Frame Counter on the Child</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>MLE Frame
|
||||
Counter</b></td><td>MLE Frame Counter on the Child</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Mode</b></td>
|
||||
<td>Describes the Child</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Timeout</b></td>
|
||||
<td>Inactivity duration before the Parent removes the Child</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Address
|
||||
Registration (MEDs and SEDs only)</b></td>
|
||||
<td>Register IPv6 addresses</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 4. Child ID Response
|
||||
|
||||
A Child ID Response is a unicast response from the Parent that is sent to the
|
||||
Child to confirm that a Child-Parent link has been established.
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-attach-04_2x.png"><img src="../images/ot-primer-network-mle-attach-04.png" srcset="../images/ot-primer-network-mle-attach-04.png 1x, ../images/ot-primer-network-mle-attach-04_2x.png 2x" width="350" border="0" alt="OT MLE Attach Child ID Response" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Child ID Response Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Source
|
||||
Address</b></td>
|
||||
<td>Parent's RLOC16</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Address16</b></td>
|
||||
<td>Child's RLOC16</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Leader
|
||||
Data</b></td>
|
||||
<td>Information about the Parent’s Leader (RLOC, Partition ID, Partition
|
||||
weight)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Network
|
||||
Data</b></td>
|
||||
<td>Information about the Thread network (on-mesh prefixes, address
|
||||
autoconfiguration, more-specific routes)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Route
|
||||
(REED only)</b></td>
|
||||
<td>Route propagation</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Timeout</b></td>
|
||||
<td>Inactivity duration before the Parent removes the Child</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Address
|
||||
Registration (MEDs and SEDs only)</b></td>
|
||||
<td>Confirm registered addresses</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Recap
|
||||
|
||||
What you've learned:
|
||||
|
||||
* A Thread device performs an active scan for existing networks
|
||||
* Thread uses Mesh Link Establishment to configure links and disseminate
|
||||
information about network devices
|
||||
* MLE Advertisement messages inform other Thread devices about a device's
|
||||
network and link state
|
||||
* The MLE Attach process establishes Child-Parent links
|
||||
@@ -0,0 +1,152 @@
|
||||
# Node Roles and Types
|
||||
|
||||
## Forwarding roles
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-roles_2x.png"><img src="../images/ot-primer-roles.png" srcset="../images/ot-primer-roles.png 1x, ../images/ot-primer-roles_2x.png 2x" border="0" alt="OT Node Roles" /></a>
|
||||
</figure>
|
||||
|
||||
In a Thread network, nodes are split into two forwarding roles:
|
||||
|
||||
### Router
|
||||
|
||||
A Router is a node that:
|
||||
|
||||
* forwards packets for network devices
|
||||
* provides secure commissioning services for devices trying to join the network
|
||||
* keeps its transceiver enabled at all times
|
||||
|
||||
### End Device
|
||||
|
||||
An End Device (ED) is a node that:
|
||||
|
||||
* communicates primarily with a single Router
|
||||
* does not forward packets for other network devices
|
||||
* can disable its transceiver to reduce power
|
||||
|
||||
Key Point: The relationship between Router and End Device is a Parent-Child
|
||||
relationship. An End Device attaches to exactly one Router. The Router is always
|
||||
the Parent, the End Device the Child.
|
||||
|
||||
## Device types
|
||||
|
||||
Furthermore, nodes comprise a number of types.
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-taxonomy_2x.png"><img src="../images/ot-primer-taxonomy.png" srcset="../images/ot-primer-taxonomy.png 1x, ../images/ot-primer-taxonomy.png 2x" border="0" alt="OT Device Taxonomy" /></a>
|
||||
</figure>
|
||||
|
||||
### Full Thread Device
|
||||
|
||||
A Full Thread Device (FTD) always has its radio on, subscribes to the
|
||||
all-routers multicast address, and maintains IPv6 address mappings. There are
|
||||
three types of FTDs:
|
||||
|
||||
* Router
|
||||
* Router Eligible End Device (REED) — can be promoted to a Router
|
||||
* Full End Device (FED) — cannot be promoted to a Router
|
||||
|
||||
An FTD can operate as a Router (Parent) or an End Device (Child).
|
||||
|
||||
### Minimal Thread Device
|
||||
|
||||
A Minimal Thread Device does not subscribe to the all-routers
|
||||
multicast address and forwards all messages to its Parent. There are
|
||||
two types of MTDs:
|
||||
|
||||
* Minimal End Device (MED) — transceiver always on, does not need to poll for
|
||||
messages from its parent
|
||||
* Sleepy End Device (SED) — normally disabled, wakes on occasion to poll for
|
||||
messages from its parent
|
||||
|
||||
An MTD can only operate as an End Device (Child).
|
||||
|
||||
### Upgrading and downgrading
|
||||
|
||||
When a REED is the only node in reach of a new End Device wishing to join the
|
||||
Thread network, it can upgrade itself and operate as a Router:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-router-upgrade_2x.png"><img src="../images/ot-primer-router-upgrade.png" srcset="../images/ot-primer-router-upgrade.png 1x, ../images/ot-primer-router-upgrade_2x.png 2x" border="0" width="400" alt="OT End Device to Router" /></a>
|
||||
</figure>
|
||||
|
||||
Conversely, when a Router has no children, it can downgrade itself and operate
|
||||
as an End Device:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-router-downgrade_2x.png"><img src="../images/ot-primer-router-downgrade.png" srcset="../images/ot-primer-router-downgrade.png 1x, ../images/ot-primer-router-downgrade_2x.png 2x" border="0" width="400" alt="OT Router to End Device" /></a>
|
||||
</figure>
|
||||
|
||||
## Other roles and types
|
||||
|
||||
### Thread Leader
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-leader_2x.png"><img src="../images/ot-primer-leader.png" srcset="../images/ot-primer-leader.png 1x, ../images/ot-primer-leader_2x.png 2x" border="0" alt="OT Leader and Border Router" /></a>
|
||||
</figure>
|
||||
|
||||
The Thread Leader is a Router that is responsible for managing the set of
|
||||
Routers in a Thread network. It is dynamically self-elected for fault tolerance,
|
||||
and aggregates and distributes network-wide configuration information.
|
||||
|
||||
Note: There is always a single Leader in each Thread network
|
||||
[partition](#partitions).
|
||||
|
||||
### Border Router
|
||||
|
||||
A Border Router is a device that can forward information between a Thread
|
||||
network and a non-Thread network (for example, Wi-Fi). It also configures a
|
||||
Thread network for external connectivity.
|
||||
|
||||
Any device may serve as a Border Router.
|
||||
|
||||
Note: There can be multiple Border Routers in a Thread network.
|
||||
|
||||
## Partitions
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-partitions_2x.png"><img src="../images/ot-primer-partitions.png" srcset="../images/ot-primer-partitions.png 1x, ../images/ot-primer-partitions_2x.png 2x" border="0" alt="OT Partitions" /></a>
|
||||
</figure>
|
||||
|
||||
A Thread network might be composed of partitions. This occurs when a group of
|
||||
Thread devices can no longer communicate with another group of Thread devices.
|
||||
Each partition logically operates as a distinct Thread network with its own
|
||||
Leader, Router ID assignments, and network data, while retaining the same
|
||||
security credentials for all devices across all partitions.
|
||||
|
||||
Partitions in a Thread network do not have wireless connectivity between each
|
||||
other, and if partitions regain connectivity, they automatically merge into a
|
||||
single partition.
|
||||
|
||||
Key Point: Security credentials define the Thread network. Physical radio
|
||||
connectivity defines partitions within that Thread network.
|
||||
|
||||
Note that the use of "Thread network" in this primer assumes a single partition.
|
||||
Where necessary, key concepts and examples are clarified with the term "partition."
|
||||
Partitions are covered in-depth later in this primer.
|
||||
|
||||
## Device limits
|
||||
|
||||
There are limits to the number of device types a single Thread network supports.
|
||||
|
||||
Role | Limit
|
||||
----|----
|
||||
Leader | 1
|
||||
Router | 32
|
||||
End Device | 511 per Router
|
||||
|
||||
Thread tries to keep the number of Routers between 16 and 23. If a REED attaches
|
||||
as an End Device and the number of Routers in the network is below 16, it
|
||||
automatically promotes itself to a Router.
|
||||
|
||||
## Recap
|
||||
|
||||
What you learned:
|
||||
|
||||
* A Thread device is either a Router (Parent) or an End Device (Child)
|
||||
* A Thread device is either a Full Thread Device (maintains IPv6 address
|
||||
mappings) or a Minimal Thread Device (forwards all messages to its Parent)
|
||||
* A Router Eligible End Device can promote itself to a Router, and vice versa
|
||||
* Every Thread network partition has a Leader to manage Routers
|
||||
* A Border Router is used to connect Thread and non-Thread networks
|
||||
* A Thread network might be composed of multiple partitions
|
||||
@@ -0,0 +1,176 @@
|
||||
# Router Selection
|
||||
|
||||
## Connected Dominating Set
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-cds_2x.png"><img src="../images/ot-primer-cds.png" srcset="../images/ot-primer-cds.png 1x, ../images/ot-primer-cds_2x.png 2x" width="350" border="0" alt="OT Connected Dominating Set" /></a><figcaption style="text-align: center"><i>Example of a Connected Dominating Set</i></figcaption>
|
||||
</figure>
|
||||
|
||||
Routers must form a Connected Dominating Set (CDS), which means:
|
||||
|
||||
1. There is a Router-only path between any two Routers.
|
||||
1. Any one Router in a Thread network can reach any other Router by staying
|
||||
entirely within the set of Routers.
|
||||
1. Every End Device in a Thread network is directly connected to a Router.
|
||||
|
||||
A distributed algorithm maintains the CDS, which ensures a minimum level of
|
||||
redundancy. Every device initially attaches to the network as an End Device
|
||||
(Child). As the state of the Thread network changes, the algorithm adds or
|
||||
removes Routers to maintain the CDS.
|
||||
|
||||
Thread adds Routers to:
|
||||
|
||||
* Increase coverage if the network is below the Router threshold of 16
|
||||
* Increase path diversity
|
||||
* Maintain a minimum level of redundancy
|
||||
* Extend connectivity and support more Children
|
||||
|
||||
Thread removes Routers to:
|
||||
|
||||
* Reduce the Routing state below the maximum of 32 Routers
|
||||
* Allow new Routers in other parts of the network when needed
|
||||
|
||||
## Upgrade to a Router
|
||||
|
||||
After attaching to a Thread network, the Child device may elect to become a
|
||||
Router. Before initiating the MLE Link Request process, the Child sends an
|
||||
Address Solicit message to the Leader, asking for a Router ID. If the Leader
|
||||
accepts, it responds with a Router ID and the Child upgrades itself to a Router.
|
||||
|
||||
The MLE Link Request process is then used to establish bi-directional
|
||||
Router-Router links with neighboring Routers.
|
||||
|
||||
1. The new Router sends a multicast [Link Request](#1_link_request) to
|
||||
neighboring Routers.
|
||||
1. Routers respond with [Link Accept and Request](#2_link_accept_and_request)
|
||||
messages.
|
||||
1. The new Router responds to each Router with a unicast [Link
|
||||
Accept](#3_link_accept) to establish the Router-Router link.
|
||||
|
||||
### 1. Link Request
|
||||
|
||||
A Link Request is a request from the Router to all other Routers in the Thread
|
||||
network. When first becoming a Router, the device sends a multicast Link Request
|
||||
to `ff02::2`. Later, after discovering the other Routers via MLE Advertisements,
|
||||
the devices send unicast Link Requests.
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-link-request-01_2x.png"><img src="../images/ot-primer-network-mle-link-request-01.png" srcset="../images/ot-primer-network-mle-link-request-01.png 1x, ../images/ot-primer-network-mle-link-request-01_2x.png 2x" width="350" border="0" alt="OT MLE Link Request" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Link Request Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Version</b></td>
|
||||
<td>Thread protocol version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Challenge</b></td>
|
||||
<td>Tests the timeliness of the Link Response to prevent replay
|
||||
attacks</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Source
|
||||
Address</b></td>
|
||||
<td>RLOC16 of the sender</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Leader
|
||||
Data</b></td>
|
||||
<td>Information about the Router's Leader, as stored on the sender (RLOC,
|
||||
Partition ID, Partition weight)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 2. Link Accept and Request
|
||||
|
||||
A Link Accept and Request is a combination of the Link Accept and Link Request
|
||||
messages. Thread uses this optimization in the MLE Link Request process to
|
||||
reduce the number of messages from four to three.
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-link-request-02_2x.png"><img src="../images/ot-primer-network-mle-link-request-02.png" srcset="../images/ot-primer-network-mle-link-request-02.png 1x, ../images/ot-primer-network-mle-link-request-02_2x.png 2x" width="350" border="0" alt="OT MLE Link Accept and Request" /></a>
|
||||
</figure>
|
||||
|
||||
### 3. Link Accept
|
||||
|
||||
A Link Accept is a unicast response to a Link Request from a neighboring Router
|
||||
that provides information about itself and accepts the link to the neighboring
|
||||
Router.
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-link-request-03_2x.png"><img src="../images/ot-primer-network-mle-link-request-03.png" srcset="../images/ot-primer-network-mle-link-request-03.png 1x, ../images/ot-primer-network-mle-link-request-03_2x.png 2x" width="350" border="0" alt="OT MLE Link Accept" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Link Accept Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Version</b></td>
|
||||
<td>Thread protocol version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Response</b></td>
|
||||
<td>Tests the timeliness of the Link Response to prevent replay
|
||||
attacks</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Link Frame
|
||||
Counter</b></td>
|
||||
<td>802.15.4 Frame Counter on the sender</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>MLE Frame
|
||||
Counter</b></td>
|
||||
<td>MLE Frame Counter on the sender</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Source
|
||||
Address</b></td>
|
||||
<td>RLOC16 of the sender</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Leader
|
||||
Data</b></td>
|
||||
<td>Information about the Router's Leader, as stored on the sender (RLOC,
|
||||
Partition ID, Partition weight)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Downgrade to a REED
|
||||
|
||||
When a Router downgrades to a REED, its Router-Router links are disconnected,
|
||||
and the device initiates the MLE Attach process to establish a Child-Parent
|
||||
link.
|
||||
|
||||
See [Join an existing
|
||||
network](/guides/thread-primer/network-discovery#join_an_existing_network)
|
||||
for more information on the MLE Attach process.
|
||||
|
||||
## One-way receive links
|
||||
|
||||
In some scenarios, it may be necessary to establish a one-way receive link.
|
||||
|
||||
After a Router reset, neighboring Routers may still have a valid receive link
|
||||
with the reset Router. In this case, the reset Router sends a Link Request
|
||||
message to re-establish the Router-Router link.
|
||||
|
||||
An End Device may also wish to establish a receive link with neighboring
|
||||
non-Parent Routers to improve multicast reliability. We'll learn more about this
|
||||
when we get to Multicast Routing.
|
||||
|
||||
## Recap
|
||||
|
||||
What you've learned:
|
||||
|
||||
* Routers in a Thread network must form a Connected Dominating Set (CDS)
|
||||
* Thread devices are upgraded to Routers or downgraded to End Devices to
|
||||
maintain the CDS
|
||||
* The MLE Link Request process is used to establish Router-Router links
|
||||
@@ -0,0 +1,25 @@
|
||||
# 什么是 Thread?
|
||||
|
||||
<figure class="attempt-right">
|
||||
<img src="../images/ot-logo-thread.png" srcset="../images/ot-logo-thread.png 1x, ../images/ot-logo-thread_2x.png 2x" border="0" alt="Thread" />
|
||||
</figure>
|
||||
|
||||
<a href="http://threadgroup.org/">Thread<sup>®</sup></a> 是一个为低功耗物联网(IEEE 802.15.4-2006 WPAN)设备设计的基于 IPv6 的网络协议。Thread 是一个新的网状网络协议,它并不依赖其它的 802.15 网状网络协议(如 ZigBee、Z-Wave 和 Bluetooth LE)。
|
||||
|
||||
Thread 的主要特性包括:
|
||||
|
||||
* 易于部署和维护 — 安装、启动和操作相对简单
|
||||
* 通信安全 — Thread 网络中的设备都必须通过身份验证,并且所有的通信都经过了加密
|
||||
* 稳定可靠 — 具有自愈能力的网状网络,无单点故障,并且采用扩频技术以提高抗干扰能力
|
||||
* 低功耗 — Thread 低功耗设备可以进入休眠并使用电池供电,通常使用一块电池便能工作数年
|
||||
* 规模可扩展 — Thread 网络的规模可以扩展达数百个设备
|
||||
|
||||
如果你不熟悉 Thread,那么了解基本的 Thread 知识对于你在应用中使用 OpenThread 是至关重要的。本入门教程的目的是解释 Thread 的基本概念和工作原理,并为你提供了 OpenThread 开发的起点。
|
||||
|
||||
本教程假定读者已具备如下的基本知识:
|
||||
|
||||
* IEEE 802.15.4
|
||||
* 网络及路由概念
|
||||
* IPv6
|
||||
|
||||
本入门教程基于 Thread Specification V1.1.1。Thread Specification 可以在 [threadgroup.org](http://threadgroup.org/ThreadSpec) 中获取。
|
||||
@@ -0,0 +1,231 @@
|
||||
# IPv6 寻址
|
||||
|
||||
让我们来看一下 Thread 如何识别网络中的每个设备,以及设备间用何种类型的地址进行相互通信。
|
||||
|
||||
Key Term: 在本入门教程中,术语“接口(interface)”用于标识网络内 Thread 设备的端点。通常,单个 Thread 设备具有单个 Thread 接口。
|
||||
|
||||
## 域
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-scopes_2x.png"><img src="../images/ot-primer-scopes.png" srcset="../images/ot-primer-scopes.png 1x, ../images/ot-primer-scopes_2x.png 2x" border="0" alt="OT Scopes" /></a>
|
||||
</figure>
|
||||
|
||||
Thread 网络中有三种域用于单播寻址:
|
||||
|
||||
* Link-Local — 所有通过单次射频传输可访问的接口
|
||||
* Mesh-Local — 所有在同一 Thread 网络中可访问的接口
|
||||
* Global — 所有从 Thread 网络外部可以访问的接口
|
||||
|
||||
前两个域与 Thread 网络指定的 Prefix(前缀)相对应。Link-Local 的 Prefix 为 `fe80::/16`,Mesh-Local 的 Prefix 为 `fd00::/8`。
|
||||
|
||||
<h2 style="clear:right">单播</h2>
|
||||
|
||||
单个 Thread 设备可以通过多种 IPv6 单播地址来进行标识。每种地址都有不同的功能(基于域和用例)。
|
||||
|
||||
在介绍每种类型之前,让我们先了解一个共同的概念,它叫作 RLOC(Routing Locator)。RLOC 根据 Thread 接口在网络拓扑中的位置来对其进行标识。
|
||||
|
||||
### 如何生成 RLOC
|
||||
|
||||
所有设备都获得一个 Router ID 和一个 Child ID。每个 Router 维护一个包含其所有子节点的表,两个 ID 的组合唯一地标识拓扑中的设备。例如,请参考以下拓扑中高亮的节点,其中 Router(五边形)中的数字是 Router ID,End Device(圆形)中的数字是 Child ID:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc-topology_2x.png"><img src="../images/ot-primer-rloc-topology.png" srcset="../images/ot-primer-rloc-topology.png 1x, ../images/ot-primer-rloc-topology_2x.png 2x" border="0" width="600" alt="OT RLOC Topology" /></a>
|
||||
</figure>
|
||||
|
||||
每个子节点的 Router ID 对应于它的父节点(Router)。因为 Router 不会是子节点,所以 Router 的 Child ID 始终为 0。这些值对于 Thread 网络中的每个设备都是唯一的,并用于创建 RLOC16(代表 RLOC 的后 16 位)。
|
||||
|
||||
例如,以下是左上节点(Router ID = 1,Child ID = 1)的 RLOC16 的计算方法:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc16_2x.png"><img src="../images/ot-primer-rloc16.png" srcset="../images/ot-primer-rloc16.png 1x, ../images/ot-primer-rloc16_2x.png 2x" border="0" width="400" alt="OT RLOC16" /></a>
|
||||
</figure>
|
||||
|
||||
RLOC16 是 IID(Interface Identifier)的一部分,IID 对应的是 IPv6 地址的后 64 位。一些 IID 可用于标识某些类型的 Thread 接口。例如,RLOC 的 IID 始终为 <code>0000:00ff:fe00:<var>RLOC16</var></code> 的形式。
|
||||
|
||||
RLOC 由 Mesh-Local Prefix 和 IID 组成。例如,如果 Mesh-Local Prefix 是 `fde5:8dba:82e1:1::/64`,RLOC16 = `0x401`,那么该节点的 RLOC 就是:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc_2x.png"><img src="../images/ot-primer-rloc.png" srcset="../images/ot-primer-rloc.png 1x, ../images/ot-primer-rloc_2x.png 2x" border="0" width="600" alt="OT RLOC" /></a>
|
||||
</figure>
|
||||
|
||||
可以使用相同的逻辑来确定以上示例拓扑中所有高亮的节点的 RLOC:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc-topology-address_2x.png"><img src="../images/ot-primer-rloc-topology-address.png" srcset="../images/ot-primer-rloc-topology-address.png 1x, ../images/ot-primer-rloc-topology-address_2x.png 2x" border="0" width="600" alt="OT Topology w/ Address" /></a>
|
||||
</figure>
|
||||
|
||||
但是,因为 RLOC 是基于节点在拓扑中的位置的,所以节点的 RLOC 会随着拓扑的变化而改变。
|
||||
|
||||
例如,如果 Thread 网络中的 `0x400` 节点离开了网络,那么它的子节点 `0x401` 和 `0x402` 会与其它的 Router 建立新连接,从而获得新的 RLOC16 和 RLOC:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-rloc-topology-change_2x.png"><img src="../images/ot-primer-rloc-topology-change.png" srcset="../images/ot-primer-rloc-topology-change.png 1x, ../images/ot-primer-rloc-topology-change_2x.png 2x" border="0" width="600" alt="OT Topology after Change" /></a>
|
||||
</figure>
|
||||
|
||||
## 单播地址类型
|
||||
|
||||
RLOC 只是 Thread 设备可以获得的多种 IPv6 单播地址之一。另一类用于在 Thread 网络分区内标识唯一的 Thread 接口的地址称为 EID(Endpoint Identifier)。EID 与 Thread 网络拓扑无关。
|
||||
|
||||
常见的单播类型如下。
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Link-Local Address (LLA)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">一种用于标识单次射频传输可访问的 Thread 接口的 EID。</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>示例</b></td><td><code>fe80::54db:881c:3845:57f4</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td>基于 802.15.4 Extended Address</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>域</b></td><td>Link-Local</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>详情</b></td><td><ul><li>用于发现邻居、配置链路和交换路由信息</li><li>非可路由地址</li><li>总是带 <code>fe80::/16</code> Prefix</li></ul></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Mesh-Local EID (ML-EID)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">一种用于标识 Thread 接口的 EID,其与网络拓扑无关。用于访问同一 Thread 分区内的 Thread 接口。也称为 ULA(Unique Local Address)。</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>示例</b></td><td><code>fde5:8dba:82e1:1:416:993c:8399:35ab</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td>在 commissioning 完成后随机生成</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>域</b></td><td>Mesh-Local</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>详情</b></td><td><ul><li>不会随拓扑变化而变化</li><li>应由应用程序使用</li><li>总是带 <code>fd00::/8</code> Prefix</li></ul></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Routing Locator (RLOC)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">根据 Thread 接口在网络拓扑中的位置来对其进行标识。</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>示例</b></td><td><code>fde5:8dba:82e1:1::ff:fe00:1001</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td><code>0000:00ff:fe00:<var>RLOC16</var></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>域</b></td><td>Mesh-Local</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>详情</b></td><td><ul><li>在设备连接到网络后生成</li><li>用于在 Thread 网络中传递 IPv6 数据报</li><li>随拓扑变化而变化</li><li>通常不会由应用程序使用</li></ul></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Anycast Locator (ALOC)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">用于标识 Thread 网络分区中一个或多个 Thread 接口的位置。如果始发者不知道目的地的 RLOC,则使用 ALOC 进行查找。</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>示例</b></td><td><code>fde5:8dba:82e1:1::ff:fe00:fc01</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td><code>0000:00ff:fe00:fc<var>XX</var></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>域</b></td><td>Mesh-Local</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>详情</b></td><td><ul><li><code>fc<var>XX</var></code> = <a href="#anycast">ALOC 目的地址</a>,用于查询对应的 RLOC</li><li>通常不会由应用程序使用</li></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2><h3>Global Unicast Address (GUA)</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="background-color:rgb(238, 241, 242)">一个EID,用于标识除 Thread 网络外的全局范围内的 Thread 接口。</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>示例</b></td><td><code>2000::54db:881c:3845:57f4</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>IID</b></td><td><ul><li>SLAAC — 由设备自身随机分配</li><li>DHCP — 由 DHCPv6 服务器分配</li><li>Manual — 由应用层分配</li></ul></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>域</b></td><td>Global</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>详情</b></td><td><ul><li>一个公开的 IPv6 地址</li><li>总是带 <code>2000::/3</code> Prefix</li></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 多播
|
||||
|
||||
多播用于一次将信息传达给多个设备。Thread 网络中保留了特定的地址,以提供给不同分组的设备在多播时使用。
|
||||
|
||||
| IPv6 地址 | 域 | 传递给 |
|
||||
| --------- | ---------- | --------------- |
|
||||
| `ff02::1` | Link-Local | 所有 FTD 和 MED |
|
||||
| `ff02::2` | Link-Local | 所有 FTD |
|
||||
| `ff03::1` | Mesh-Local | 所有 FTD 和 MED |
|
||||
| `ff03::2` | Mesh-Local | 所有 FTD |
|
||||
|
||||
Key Point: FTD 和 MTD 之间的主要区别在于 FTD 订阅了 `ff03::2` 多播地址。而 MTD 没有订阅。
|
||||
|
||||
你可能会注意到,上面的多播表中没有将 SED 作为接收者包括在内。Thread 为所有 Thread 节点(包括 SED)定义了(link-local 和 realm-local 域)基于单播 prefix 的 IPv6 多播地址。这些多播地址基于单播 Mesh-Local prefix 构成,因 Thread 网络而异。(有关基于单播 prefix 的 IPv6 多播地址的详情,请参阅 [RFC 3306](https://tools.ietf.org/html/rfc3306))。
|
||||
|
||||
Thread 设备还支持除表中所列举域之外的任意域。
|
||||
|
||||
## 任播
|
||||
|
||||
当目的地的 RLOC 未知时,可以使用任播将流量路由到 Thread 接口。ALOC(Anycast Locator)标识 Thread 分区内多个接口的位置。ALOC 的后 16 位,称为 ALOC16,其格式为 <code>0xfc<var>XX</var></code>,表示 ALOC 的类型。
|
||||
|
||||
例如,`0xfc01` 和 `0xfc0f` 之间的 ALOC16 保留给了 DHCPv6 Agent。如果特定的 DHCPv6 Agent RLOC 是未知的(可能是因为网络拓扑已更改),则可以将消息发送到 DHCPv6 Agent ALOC 以获取 RLOC。
|
||||
|
||||
Thread 定义了以下 ALOC16 值:
|
||||
|
||||
| ALOC16 | 类型 |
|
||||
| ------------------------------------------ | ------------------------ |
|
||||
| `0xfc00` | Leader |
|
||||
| `0xfc01` – `0xfc0f` | DHCPv6 Agent |
|
||||
| `0xfc10` – `0xfc2f` | Service |
|
||||
| `0xfc30` – `0xfc37` | Commissioner |
|
||||
| `0xfc40` – `0xfc4e` | Neighbor Discovery Agent |
|
||||
| `0xfc38` – `0xfc3f`<br>`0xfc4f` – `0xfcff` | Reserved |
|
||||
|
||||
## 回顾
|
||||
|
||||
你应该学到了:
|
||||
|
||||
* Thread 网络包含三个域:Link-Local、Mesh-Local 和 Global
|
||||
* Thread 设备具有多种单播 IPv6 地址
|
||||
* RLOC 表示设备在 Thread 网络中的位置
|
||||
* ML-EID 对于分区内的 Thread 设备是唯一的,并且应由应用程序使用
|
||||
* Thread 使用多播将数据转发到节点组和 Router 组
|
||||
* 当目的地的 RLOC 未知时,Thread 可以使用任播
|
||||
|
||||
要了解有关 Thread 的 IPv6 寻址的更多信息,请参阅 [Thread Specification](http://threadgroup.org/ThreadSpec) 的 5.2 和 5.3 节。
|
||||
@@ -0,0 +1,254 @@
|
||||
# 网络发现与形成
|
||||
|
||||
## Thread 网络
|
||||
|
||||
Thread 网络由三个唯一的标识符标识:
|
||||
|
||||
* 2 字节的 PAN ID(Personal Area Network ID,个域网标识符)
|
||||
* 8 字节的 XPAN ID(Extended Personal Area Network ID,扩展个域网标识符)
|
||||
* 方便人类阅读的 Network Name(网络名称)
|
||||
|
||||
例如,一个 Thread 网络可能具有以下标识符:
|
||||
|
||||
| 标识符 | 值 |
|
||||
| ------------ | -------------------- |
|
||||
| PAN ID | `0xBEEF` |
|
||||
| XPAN ID | `0xBEEF1111CAFE2222` |
|
||||
| Network Name | `yourThreadCafe` |
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-network-active-scan_2x.png"><img src="../images/ot-primer-network-active-scan.png" srcset="../images/ot-primer-network-active-scan.png 1x, ../images/ot-primer-network-active-scan_2x.png 2x" border="0" alt="OT Active Scan" /></a>
|
||||
</figure>
|
||||
|
||||
在创建新的 Thread 网络或搜索现有的网络时,Thread 设备会主动扫描射频范围内的 802.15.4 网络:
|
||||
|
||||
1. 设备在特定 Channel 上广播 802.15.4 信标请求(Beacon Request)。
|
||||
2. 范围内的所有 Router 或 REED 都会广播包含其 Thread 网络 PAN ID、XPAN ID 和 Network Name 的信标(Beacon),以作为回应。
|
||||
3. 设备为每个 Channel 重复前两个步骤。
|
||||
|
||||
Thread 设备发现范围内的所有网络后,可以选择连接到现有的网络,也可以在未发现任何网络的情况下创建新的网络。
|
||||
|
||||
<h2 style="clear:right">Mesh Link Establishment</h2>
|
||||
|
||||
Thread 使用 MLE(Mesh Link Establishment)协议来配置链路并将网络的相关信息传播到 Thread 设备。
|
||||
|
||||
在链路配置中,MLE 用于:
|
||||
|
||||
* 发现相邻设备的链路
|
||||
* 确认到相邻设备的链路质量
|
||||
* 建立到相邻设备的链路
|
||||
* 与对端协商链路参数(设备类型、帧计数器、超时)
|
||||
|
||||
MLE 将以下类型的信息传播给希望建立链路的设备:
|
||||
|
||||
* Leader data(Leader RLOC, Partition ID(分区标识符), Partition weight(分区权重))
|
||||
* Network data(on-mesh prefixes, address autoconfiguration(地址自动配置), more-specific routes(具体路由))
|
||||
* Route propagation(路由传播)
|
||||
|
||||
Thread 中路由传播的工作原理类似于 RIP(Routing Information Protocol,路由信息协议),RIP 是一种距离矢量路由协议。
|
||||
|
||||
Note: 仅当 Thread 设备通过 Thread Commissioning 获得 Thread 网络凭据后,才会继续进行 MLE 过程。Commissioning 和安全性将在本教程的后续部分中深入介绍。目前,假定设备已通过 Commissioning。
|
||||
|
||||
## 创建新网络
|
||||
|
||||
如果设备选择创建新网络,它将选择最不繁忙的 Channel 和其他网络未使用的 PAN ID,然后成为 Router 并选举自己为 Leader。该设备将 MLE Advertisement 消息发送到其他 802.15.4 设备,以通知其链路状态,并响应其他执行主动扫描的 Thread 设备所发出的信标请求。
|
||||
|
||||
## 加入现有网络
|
||||
|
||||
如果设备选择加入到现有的网络,则会通过 Thread Commissioning 将其 Channel、PAN ID、XPAN ID 和 Network Name 配置为与目标网络相同,然后进行 MLE Attach 过程以作为子节点(End Device)进行加入。此过程用于“父子链路(Child-Parent link)”。
|
||||
|
||||
Key Point: 每个设备(无论是否具有充当 Router 的能力),最初都作为子设备(End Device)连接到 Thread 网络。
|
||||
|
||||
1. 子节点向目标网络中的所有相邻的 Router 和 REED 发送多播 [Parent Request](#1-Parent-Request)。
|
||||
2. 所有相邻的 Router 和 REED(如果 Parent Request Scan Mask(父节点请求扫描掩码)包括了 REED)都应发送 [Parent Response](#2-Parent-Response) 以将其自身的信息告诉给子节点。
|
||||
3. 子节点选择一个父节点,并向其发送 [Child ID Request](#3-Child-ID-Request)。
|
||||
4. 父节点发送 [Child ID Response](#4-Child-ID-Response) 以确认链路建立。
|
||||
|
||||
### 1. Parent Request
|
||||
|
||||
Parent Request 是来自待连接设备的多播请求,用于发现目标网络中的相邻的 Router 和 REED。
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-attach-01_2x.png"><img src="../images/ot-primer-network-mle-attach-01.png" srcset="../images/ot-primer-network-mle-attach-01.png 1x, ../images/ot-primer-network-mle-attach-01_2x.png 2x" width="350" border="0" alt="OT MLE Attach Parent Request" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Parent Request Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Mode</b></td>
|
||||
<td>描述待连接设备</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Challenge</b></td>
|
||||
<td>测试 Parent Response 的时效性,以防止重放攻击</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Scan Mask</b></td>
|
||||
<td>将请求限制为仅 Router 或 Router 和 REED</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 2. Parent Response
|
||||
|
||||
Parent Response 是对 Parent Request 的单播响应,它向待连接设备提供有关 Router 或 REED 的信息。
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-attach-02_2x.png"><img src="../images/ot-primer-network-mle-attach-02.png" srcset="../images/ot-primer-network-mle-attach-02.png 1x, ../images/ot-primer-network-mle-attach-02_2x.png 2x" width="350" border="0" alt="OT MLE Attach Parent Response" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Parent Response Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Version</b></td>
|
||||
<td>Thread 协议版本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Response</b></td>
|
||||
<td>Parent Request Challenge 的副本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Link Frame
|
||||
Counter</b></td>
|
||||
<td>Router/REED 上的 802.15.4 帧计数器</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>MLE Frame
|
||||
Counter</b></td>
|
||||
<td>Router/REED 上的 MLE 帧计数器</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Source
|
||||
Address</b></td>
|
||||
<td>Router/REED 的 RLOC16</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Link
|
||||
Margin</b></td>
|
||||
<td>Router/REED 的接收信号质量</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Connectivity</b></td>
|
||||
<td>描述 Router/REED 的连通性</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Leader
|
||||
Data</b></td>
|
||||
<td>有关 Router/REED 的 Leader 的信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Challenge</b></td>
|
||||
<td>测试 Child ID Request 的时效性,以防止重放攻击</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 3. Child ID Request
|
||||
|
||||
Child ID Request 是来自待连接设备(子)的单播请求,该单播请求被发送到 Router(父)或 REED(父),目的是建立父子链路。如果将请求发送到 REED,则 REED 会在接受请求之前将自身升级为 Router。
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-attach-03_2x.png"><img src="../images/ot-primer-network-mle-attach-03.png" srcset="../images/ot-primer-network-mle-attach-03.png 1x, ../images/ot-primer-network-mle-attach-03_2x.png 2x" width="350" border="0" alt="OT MLE Attach Child ID Request" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Child ID Request Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Version</b></td>
|
||||
<td>Thread 协议版本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Response</b></td>
|
||||
<td>Parent Response Challenge 的副本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Link Frame
|
||||
Counter</b></td>
|
||||
<td>Child 上的 802.15.4 帧计数器</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>MLE Frame
|
||||
Counter</b></td><td>Child 上的 MLE 帧计数器</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Mode</b></td>
|
||||
<td>描述子节点</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Timeout</b></td>
|
||||
<td>父节点移除子节点之前的闲置时间</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Address
|
||||
Registration (MEDs and SEDs only)</b></td>
|
||||
<td>注册 IPv6 地址</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 4. Child ID Response
|
||||
|
||||
Child ID Response 是父节点对 Child ID Request 的单播响应,该响应发送给对应的子节点以确认父子链路的建立。
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-attach-04_2x.png"><img src="../images/ot-primer-network-mle-attach-04.png" srcset="../images/ot-primer-network-mle-attach-04.png 1x, ../images/ot-primer-network-mle-attach-04_2x.png 2x" width="350" border="0" alt="OT MLE Attach Child ID Response" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Child ID Response Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Source
|
||||
Address</b></td>
|
||||
<td>父节点的 RLOC16</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Address16</b></td>
|
||||
<td>子节点的 RLOC16</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Leader
|
||||
Data</b></td>
|
||||
<td>父节点的 Leader 的相关信息(RLOC, Partition ID, Partition weight)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Network
|
||||
Data</b></td>
|
||||
<td>Thread 网络的相关信息(on-mesh prefixes, address autoconfiguration, more-specific routes)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Route
|
||||
(REED only)</b></td>
|
||||
<td>路由传播</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Timeout</b></td>
|
||||
<td>父节点移除子节点之前的闲置时间</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Address
|
||||
Registration (MEDs and SEDs only)</b></td>
|
||||
<td>确认已注册地址</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 回顾
|
||||
|
||||
你应该学到了:
|
||||
|
||||
* Thread 设备通过主动扫描发现现有网络
|
||||
* Thread 使用 MLE 来配置链路并分发有关网络设备的信息
|
||||
* MLE Advertisement 消息通知其他 Thread 设备有关设备的网络和链路状态
|
||||
* MLE Attach 过程建立了父子链路
|
||||
@@ -0,0 +1,125 @@
|
||||
# 节点角色和类型
|
||||
|
||||
## 转发角色
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-roles_2x.png"><img src="../images/ot-primer-roles.png" srcset="../images/ot-primer-roles.png 1x, ../images/ot-primer-roles_2x.png 2x" border="0" alt="OT Node Roles" /></a>
|
||||
</figure>
|
||||
|
||||
在 Thread 网络中,节点分成两种转发角色:Router 和 End Device。
|
||||
|
||||
### Router
|
||||
|
||||
Router 节点的行为如下:
|
||||
|
||||
* 为网络设备转发数据包
|
||||
* 为尝试加入网络的设备提供安全的 commissioning 服务
|
||||
* 始终打开它的收发器
|
||||
|
||||
### End Device
|
||||
|
||||
End Device 节点的行为如下:
|
||||
|
||||
* 主要与单个 Router 进行通信
|
||||
* 不会为其他网络设备转发数据包
|
||||
* 可以关闭它的收发器来降低功耗
|
||||
|
||||
Key Point: Router 和 End Device 之间的关系称为父子关系。End Device 正确地依附到一个 Router 上,其中 Router 始终作为父节点,End Device 则始终是子节点。
|
||||
|
||||
## 设备类型
|
||||
|
||||
此外,节点有许多种类型。
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-taxonomy_2x.png"><img src="../images/ot-primer-taxonomy.png" srcset="../images/ot-primer-taxonomy.png 1x, ../images/ot-primer-taxonomy.png 2x" border="0" alt="OT Device Taxonomy" /></a>
|
||||
</figure>
|
||||
|
||||
### Full Thread Device
|
||||
|
||||
一个 FTD(Full Thread Device)总是打开它的射频收发器,它订阅所有 Router 的多播地址,并维护 IPv6 地址映射。FTD 有三种类型:
|
||||
|
||||
* Router
|
||||
* REED(Router Eligible End Device)— 可以升级为 Router
|
||||
* FED(Full End Device)— 无法升级为 Router
|
||||
|
||||
FTD 可以作为 Router(父)或 End Device(子)。
|
||||
|
||||
### Minimal Thread Device
|
||||
|
||||
MTD(Minimal Thread Device)不会订阅 all-routers 多播地址,并且它会将它的所有消息发送给它的父节点。MTD 有两种类型:
|
||||
|
||||
* MED(Minimal End Device)— 始终打开自身的收发器,无需从父节点中轮询消息
|
||||
* SED(Sleepy End Device)— 通常会关闭自身的收发器(睡眠),偶然会打开收发器(唤醒)以从父节点中轮询消息
|
||||
|
||||
MTD 只能作为 End Device(子)。
|
||||
|
||||
### 升级和降级
|
||||
|
||||
当待加入设备仅能与某个 REED 通信时, 则该 REED 可以升级成为 Router:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-router-upgrade_2x.png"><img src="../images/ot-primer-router-upgrade.png" srcset="../images/ot-primer-router-upgrade.png 1x, ../images/ot-primer-router-upgrade_2x.png 2x" border="0" width="400" alt="OT End Device to Router" /></a>
|
||||
</figure>
|
||||
|
||||
相反,当一个 Router 没有子节点时,它可以降级成 End Device:
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-router-downgrade_2x.png"><img src="../images/ot-primer-router-downgrade.png" srcset="../images/ot-primer-router-downgrade.png 1x, ../images/ot-primer-router-downgrade_2x.png 2x" border="0" width="400" alt="OT Router to End Device" /></a>
|
||||
</figure>
|
||||
|
||||
## 其他角色和类型
|
||||
|
||||
### Thread Leader
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-leader_2x.png"><img src="../images/ot-primer-leader.png" srcset="../images/ot-primer-leader.png 1x, ../images/ot-primer-leader_2x.png 2x" border="0" alt="OT Leader and Border Router" /></a>
|
||||
</figure>
|
||||
|
||||
Thread Leader 是一个 Router,它负责管理 Thread 网络中的 Router。Thread Leader 是动态自选的(提高容错率),它负责汇总和分发全网络的配置信息。
|
||||
|
||||
Note: 每个 Thread 网络[分区](#分区)中总是只有一个 Leader。
|
||||
|
||||
### Border Router
|
||||
|
||||
Border Router 是一种可以在 Thread 网络和其他网络(如 Wi-Fi)之间转发信息的设备。它还为外部连接配置 Thread 网络。
|
||||
|
||||
任何设备都可以充当 Border Router。
|
||||
|
||||
Note: 一个 Thread 网络中可以有多个 Border Router。
|
||||
|
||||
## 分区
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-partitions_2x.png"><img src="../images/ot-primer-partitions.png" srcset="../images/ot-primer-partitions.png 1x, ../images/ot-primer-partitions_2x.png 2x" border="0" alt="OT Partitions" /></a>
|
||||
</figure>
|
||||
|
||||
一个 Thread 网络可能由多个分区组成。当一组 Thread 设备不能再与另一组 Thread 设备通信时,会发生这种情况。每个分区在逻辑上均作为独立的 Thread 网络来运行,它们具有各自的 Leader、Router ID 分配和网络数据,同时分区前相同的安全凭证都将被保留下来。
|
||||
|
||||
当分区之间可以连通时,它们会自动合并。
|
||||
|
||||
Key Point: 安全凭证(security credentials)定义了 Thread 网络。物理无线电的连通性定义了该 Thread 网络中的分区。
|
||||
|
||||
请注意,在本入门教程中一般将 Thread 网络假定成单个分区。在必要时,将使用“分区”一词来阐明关键概念和示例。本教程稍后将详细介绍分区。
|
||||
|
||||
## 设备限制
|
||||
|
||||
单个 Thread 网络所支持的设备类型数量是有限制的。
|
||||
|
||||
| 角色 | 限制 |
|
||||
| ---------- | ------------------ |
|
||||
| Leader | 1 |
|
||||
| Router | 32 |
|
||||
| End Device | 511(每个 Router) |
|
||||
|
||||
Thread 会尝试将 Router 的数量保持在 16 ~ 23 之间。如果一个 REED 作为 End Device 加入,并且网络中的 Router 数量低于 16,那么它将自动升级为 Router。
|
||||
|
||||
## 回顾
|
||||
|
||||
你应该学到了:
|
||||
|
||||
* Thread 设备可以是 Router(父)或 End Device(子)
|
||||
* Thread 设备可以是 FTD(维护 IPv6 地址映射),也可以是 MTD(将所有消息发送给其父节点)
|
||||
* REED 可以升级为 Router,Router 也可以降级为 REED
|
||||
* 每个 Thread 网络分区都有一个 Leader 来管理 Router
|
||||
* Border Router 用于连接 Thread 和其他网络
|
||||
* 一个 Thread 网络可能由多个分区组成
|
||||
@@ -0,0 +1,145 @@
|
||||
# Router 选择
|
||||
|
||||
## Connected Dominating Set
|
||||
|
||||
<figure class="attempt-right">
|
||||
<a href="../images/ot-primer-cds_2x.png"><img src="../images/ot-primer-cds.png" srcset="../images/ot-primer-cds.png 1x, ../images/ot-primer-cds_2x.png 2x" width="350" border="0" alt="OT Connected Dominating Set" /></a><figcaption style="text-align: center"><i>Example of a Connected Dominating Set</i></figcaption>
|
||||
</figure>
|
||||
|
||||
Router 必须形成一个 CDS(Connected Dominating Set,连接支配集),这意味着:
|
||||
|
||||
1. 在任何两个 Router 之间都有一个 Router-only 的路径。
|
||||
2. Thread 网络中的任何一个 Router 都可以通过完全位于 Router 集中而到达其他任何 Router。
|
||||
3. Thread 网络中的每个 End Device 都直接连接到 Router。
|
||||
|
||||
Thread 使用分布式算法维护 CDS,从而确保最低程度的冗余。每个设备最初都作为 End Device(子)连接到网络。随着 Thread 网络状态的更改,算法会增添或移除 Router 以维护 CDS。
|
||||
|
||||
Thread 在下列情况下将会增添 Router:
|
||||
|
||||
* 如果网络低于 Router 阈值(16) —— 为了增加覆盖范围
|
||||
* 增加路径多样性
|
||||
* 保持最低程度的冗余
|
||||
* 扩展连接并支持更多子节点
|
||||
|
||||
Thread 在下列情况下将会移除 Router:
|
||||
|
||||
* 将路由状态减少到最多 32 个 Router 以下
|
||||
* 必要时允许在网络的其他部分使用新 Router
|
||||
|
||||
## 升级成 Router
|
||||
|
||||
子设备连接到 Thread 网络后,可以选择成为 Router。在开始 MLE Link Request 过程之前,子设备会向 Leader 发送 Address Solicit 消息,以请求一个 Router ID。如果 Leader 同意该请求,则它将响应一个 Router ID 给子设备,并且子设备会将自身升级为 Router。
|
||||
|
||||
然后,MLE Link Request 过程用于与相邻的 Router 建立双向 Router-Router 链路。
|
||||
|
||||
1. 新 Router 将发送一个多播 [Link Request](#1-Link-Request) 到相邻的 Router。
|
||||
2. Router 使用 [Link Accept and Request](#2-Link-Accept-and-Request) 消息进行响应。
|
||||
3. 新 Router 使用单播的 [Link Accept](#3-Link-Accept) 响应每个 Router,以建立 Router-Router 链路。
|
||||
|
||||
### 1. Link Request
|
||||
|
||||
Link Request 是从 Router 到 Thread 网络中所有其他 Router 的请求。首次成为 Router 时,设备会发送一个多播 Link Request 到 `ff02::2`。稍后,在通过 MLE Advertisement 发现其他 Router 后,设备将发送单播的 Link Request。
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-link-request-01_2x.png"><img src="../images/ot-primer-network-mle-link-request-01.png" srcset="../images/ot-primer-network-mle-link-request-01.png 1x, ../images/ot-primer-network-mle-link-request-01_2x.png 2x" width="350" border="0" alt="OT MLE Link Request" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Link Request Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Version</b></td>
|
||||
<td>Thread 协议版本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Challenge</b></td>
|
||||
<td>测试 Link Response 的及时性,以防止重放攻击</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Source
|
||||
Address</b></td>
|
||||
<td>发送者的 RLOC16</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Leader
|
||||
Data</b></td>
|
||||
<td>Router 的 Leader 的相关信息(RLOC, Partition ID, Partition weight)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 2. Link Accept and Request
|
||||
|
||||
Link Accept and Request 是 Link Accept 和 Link Request 消息的组合。Thread 在 MLE Link Request 过程中使用此优化将消息的数量从四减少到三。
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-link-request-02_2x.png"><img src="../images/ot-primer-network-mle-link-request-02.png" srcset="../images/ot-primer-network-mle-link-request-02.png 1x, ../images/ot-primer-network-mle-link-request-02_2x.png 2x" width="350" border="0" alt="OT MLE Link Accept and Request" /></a>
|
||||
</figure>
|
||||
|
||||
### 3. Link Accept
|
||||
|
||||
Link Accept 是对来自相邻 Router 的 Link Request 的单播响应,该响应提供有关自身的信息并接受到相邻 Router 的链路。
|
||||
|
||||
<figure>
|
||||
<a href="../images/ot-primer-network-mle-link-request-03_2x.png"><img src="../images/ot-primer-network-mle-link-request-03.png" srcset="../images/ot-primer-network-mle-link-request-03.png 1x, ../images/ot-primer-network-mle-link-request-03_2x.png 2x" width="350" border="0" alt="OT MLE Link Accept" /></a>
|
||||
</figure>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=2>Link Accept Message Contents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Version</b></td>
|
||||
<td>Thread 协议版本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Response</b></td>
|
||||
<td>测试 Link Response 的及时性,以防止重放攻击</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Link Frame
|
||||
Counter</b></td>
|
||||
<td>发送者上的 802.15.4 帧计数器</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>MLE Frame
|
||||
Counter</b></td>
|
||||
<td>发送者上的 MLE 帧计数器</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Source
|
||||
Address</b></td>
|
||||
<td>发送者的 RLOC16</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="background-color:rgb(238, 241, 242)"><b>Leader
|
||||
Data</b></td>
|
||||
<td>Router 的 Leader 的相关信息(RLOC, Partition ID, Partition weight)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 降级成 REED
|
||||
|
||||
当 Router 降级成 REED 时,其 Router-Router 链路断开,并且设备开始 MLE Attach 过程以建立父子链路。
|
||||
|
||||
有关 MLE Attach 过程的更多信息,请参阅 [加入现有网络](/guides/thread-primer/network-discovery#加入现有网络)。
|
||||
|
||||
## 单向接收链路
|
||||
|
||||
在某些情况下,建立单向接收链路是有必要的。
|
||||
|
||||
在 Router 重置后,相邻 Router 可能仍具有与重置的 Router 的有效接收链路。在这种情况下,重置的 Router 发送 Link Request 消息以重新建立 Router-Router 链路。
|
||||
|
||||
End Device 也可能希望与相邻的 Router(非父节点)建立接收链路,以提高多播可靠性。当我们进入多播路由时,我们将学习更多与此相关的内容。
|
||||
|
||||
## 回顾
|
||||
|
||||
你应该学到了:
|
||||
|
||||
* Thread 网络中的 Router 必须形成 CDS
|
||||
* Thread 设备将升级成 Router 或降级成 REED 以维护 CDS
|
||||
* MLE Link Request 过程用于建立 Router-Router 链路
|
||||
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
configure_file(${PROJECT_SOURCE_DIR}/etc/cmake/openthread-config-generic.h.in ${PROJECT_BINARY_DIR}/etc/cmake/openthread-config-generic.h)
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# Get a list of the available platforms and output as a list to the 'arg_platforms' argument
|
||||
function(ot_get_platforms arg_platforms)
|
||||
list(APPEND result "NO" "posix")
|
||||
set(platforms_dir "${PROJECT_SOURCE_DIR}/examples/platforms")
|
||||
file(GLOB platforms RELATIVE "${platforms_dir}" "${platforms_dir}/*")
|
||||
foreach(platform IN LISTS platforms)
|
||||
if(IS_DIRECTORY "${platforms_dir}/${platform}")
|
||||
list(APPEND result "${platform}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_ITEM result utils)
|
||||
list(SORT result)
|
||||
set(${arg_platforms} "${result}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
@@ -0,0 +1,277 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
option(OT_APP_CLI "enable CLI app" ON)
|
||||
option(OT_APP_NCP "enable NCP app" ON)
|
||||
option(OT_APP_RCP "enable RCP app" ON)
|
||||
|
||||
option(OT_ASSERT "enable assert function OT_ASSERT()" ON)
|
||||
if(OT_ASSERT)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ASSERT_ENABLE=1")
|
||||
else()
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ASSERT_ENABLE=0")
|
||||
endif()
|
||||
|
||||
option(OT_BACKBONE_ROUTER "enable backbone router functionality")
|
||||
if(OT_BACKBONE_ROUTER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_BORDER_AGENT "enable border agent support")
|
||||
if(OT_BORDER_AGENT)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_BORDER_ROUTER "enable border router support")
|
||||
if(OT_BORDER_ROUTER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
if(NOT OT_EXTERNAL_MBEDTLS)
|
||||
set(OT_MBEDTLS mbedtls)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=1")
|
||||
else()
|
||||
set(OT_MBEDTLS ${OT_EXTERNAL_MBEDTLS})
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0")
|
||||
endif()
|
||||
|
||||
option(OT_BUILTIN_MBEDTLS_MANAGEMENT "enable builtin mbedtls management" ON)
|
||||
if(OT_BUILTIN_MBEDTLS_MANAGEMENT)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=1")
|
||||
else()
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=0")
|
||||
endif()
|
||||
|
||||
option(OT_CHANNEL_MANAGER "enable channel manager support")
|
||||
if(OT_CHANNEL_MANAGER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_CHANNEL_MONITOR "enable channel monitor support")
|
||||
if(OT_CHANNEL_MONITOR)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_CHILD_SUPERVISION "enable child supervision support")
|
||||
if(OT_CHILD_SUPERVISION)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_COAP "enable coap api support")
|
||||
if(OT_COAP)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_COAP_API_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_COAPS "enable secure coap api support")
|
||||
if(OT_COAPS)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_COAP_OBSERVE "enable coap observe (RFC7641) api support")
|
||||
if(OT_COAP_OBSERVE)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_COMMISSIONER "enable commissioner support")
|
||||
if(OT_COMMISSIONER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_CSL_RECEIVER "enable csl receiver")
|
||||
if(OT_CSL_RECEIVER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DHCP6_CLIENT "enable DHCP6 client support")
|
||||
if(OT_DHCP6_CLIENT)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DHCP6_SERVER "enable DHCP6 server support")
|
||||
if(OT_DHCP6_SERVER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DIAGNOSTIC "enable diagnostic support")
|
||||
if(OT_DIAGNOSTIC)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DIAG_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DNS_CLIENT "enable DNS client support")
|
||||
if(OT_DNS_CLIENT)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_ECDSA "enable ECDSA support")
|
||||
if(OT_ECDSA)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ECDSA_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DUA "enable Domain Unicast Address feature for Thread 1.2")
|
||||
if(OT_DUA)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DUA_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MLR "enable Multicast Listener Registration feature for Thread 1.2")
|
||||
if(OT_MLR)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MLR_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_EXTERNAL_HEAP "enable external heap support")
|
||||
if(OT_EXTERNAL_HEAP)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_IP6_FRAGM "enable ipv6 fragmentation support")
|
||||
if(OT_IP6_FRAGM)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_JAM_DETECTION "enable jam detection support")
|
||||
if(OT_JAM_DETECTION)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_JOINER "enable joiner support")
|
||||
if(OT_JOINER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_JOINER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LEGACY "enable legacy network support")
|
||||
if(OT_LEGACY)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LEGACY_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LINK_RAW "enable link raw service")
|
||||
if(OT_LINK_RAW)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LINK_RAW_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LOG_LEVEL_DYNAMIC "enable dynamic log level control")
|
||||
if(OT_LOG_LEVEL_DYNAMIC)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MAC_FILTER "enable mac filter support")
|
||||
if(OT_MAC_FILTER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MLE_LONG_ROUTES "enable MLE long routes extension (experimental, breaks Thread conformance)")
|
||||
if(OT_MLE_LONG_ROUTES)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MTD_NETDIAG "enable TMF network diagnostics on MTDs")
|
||||
if(OT_MTD_NETDIAG)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MULTIPLE_INSTANCE "enable multiple instances")
|
||||
if(OT_MULTIPLE_INSTANCE)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_PLATFORM_NETIF "enable platform netif support")
|
||||
if(OT_PLATFORM_NETIF)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_PLATFORM_UDP "enable platform UDP support")
|
||||
if(OT_PLATFORM_UDP)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_REFERENCE_DEVICE "enable Thread Test Harness reference device support")
|
||||
if(OT_REFERENCE_DEVICE)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_SERVICE "enable support for injecting Service entries into the Thread Network Data")
|
||||
if(OT_SERVICE)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_SETTINGS_RAM "enable volatile-only storage of settings")
|
||||
if(OT_SETTINGS_RAM)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_SETTINGS_RAM=1")
|
||||
endif()
|
||||
|
||||
option(OT_SLAAC "enable support for adding of auto-configured SLAAC addresses by OpenThread")
|
||||
if(OT_SLAAC)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_SNTP_CLIENT "enable SNTP Client support")
|
||||
if(OT_SNTP_CLIENT)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_TIME_SYNC "enable the time synchronization service feature")
|
||||
if(OT_TIME_SYNC)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_UDP_FORWARD "enable UDP forward support")
|
||||
if(OT_UDP_FORWARD)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_FULL_LOGS "enable full logs")
|
||||
if(OT_FULL_LOGS)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_API=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_ARP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_BBR=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_CLI=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_COAP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_DUA=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_ICMP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_IP6=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MAC=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MEM=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MESHCOP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MLR=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_NETDATA=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_NETDIAG=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PKT_DUMP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PLATFORM=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PREPEND_REGION=1")
|
||||
endif()
|
||||
|
||||
option(OT_OTNS "enable OTNS support")
|
||||
if(OT_OTNS)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_OTNS_ENABLE=1")
|
||||
endif()
|
||||
|
||||
# Checks
|
||||
if(OT_PLATFORM_UDP AND OT_UDP_FORWARD)
|
||||
message(FATAL_ERROR "OT_PLATFORM_UDP and OT_UDP_FORWARD are exclusive")
|
||||
endif()
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
|
||||
VERSION=0.1
|
||||
|
||||
all: arm32v7_linux x86_linux sim
|
||||
all: arm32v7_linux x86_linux simulation
|
||||
|
||||
arm32v7_linux: arm32v7_ubuntu_wpantund
|
||||
docker build -t openthread/wpantund_arm32v7_linux arm32v7_ubuntu_wpantund && \
|
||||
@@ -15,11 +15,11 @@ x86_linux: x86_ubuntu_wpantund
|
||||
docker tag openthread/wpantund_amd64_linux openthread/wpantund_amd64_linux:$(VERSION) && \
|
||||
docker push openthread/wpantund_amd64_linux:$(VERSION)
|
||||
|
||||
sim: ot_sim
|
||||
docker build -t openthread/sim ot_sim && \
|
||||
docker push openthread/sim && \
|
||||
docker tag openthread/sim openthread/sim:$(VERSION) && \
|
||||
docker push openthread/sim:$(VERSION)
|
||||
simulation: ot_simulation
|
||||
docker build -t openthread/simulation ot_sim && \
|
||||
docker push openthread/simulation && \
|
||||
docker tag openthread/simulation openthread/simulation:$(VERSION) && \
|
||||
docker push openthread/simulation:$(VERSION)
|
||||
|
||||
publish_manifest:
|
||||
docker manifest create openthread/wpantund openthread/wpantund_arm32v7_linux openthread/wpantund_amd64_linux
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
|
||||
## Running wpantund from a Docker container:
|
||||
|
||||
For a device that has a Thread radio attached to port `/dev/ttyUSB0`, start `wpantund` as follows:
|
||||
|
||||
```
|
||||
docker run --rm --detach -e "OPENTHREAD_DEVICE_PORT=/dev/ttyUSB0" --cap-add=NET_ADMIN --device=/dev/ttyUSB0 --name=wpantund openthread/wpantund
|
||||
```
|
||||
|
||||
Once `wpantund` is running, one can control the Thread interface with `wpanctl` as follows:
|
||||
|
||||
```
|
||||
docker exec -it wpantund wpanctl
|
||||
```
|
||||
|
||||
|
||||
## Content
|
||||
|
||||
arm32v7_ubuntu_wpantund
|
||||
- `wpantund` running on ARMv7 (e.g. Raspberry Pi)
|
||||
|
||||
x86_ubuntu_wpantund
|
||||
- `wpantund` running on x86
|
||||
|
||||
ot_sim
|
||||
- OpenThread POSIX simulator
|
||||
|
||||
codelab_otsim
|
||||
- For use with the [Docker Simulation Codelab](https://codelabs.developers.google.com/codelabs/openthread-simulation/), contains the OpenThread POSIX example and `wpantund` pre-built and ready to use.
|
||||
|
||||
environment
|
||||
- Development environment with the GNU toolchain and all required OpenThread dependencies installed. OpenThread is not built in this image.
|
||||
|
||||
Images built from these Dockerfiles are available to pull from [Docker Hub](https://hub.docker.com/u/openthread/). See [Docker Support on openthread.io](https://openthread.io/guides#docker_support) for more information.
|
||||
@@ -0,0 +1,105 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
#
|
||||
# Ubuntu 14.04 with tools required to run OpenThread Android check
|
||||
#
|
||||
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV ANDROID_JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64
|
||||
ENV OPT_BIN=/opt/bin
|
||||
ENV PATH=$OPT_BIN:$PATH
|
||||
ENV ANDROID_NDK_PATH=/opt/ndk-bundle
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN apt-get -y update && apt-get --no-install-recommends install -y \
|
||||
gcc-multilib \
|
||||
g++-multilib \
|
||||
git \
|
||||
make \
|
||||
python \
|
||||
unzip \
|
||||
wget
|
||||
|
||||
RUN wget https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip \
|
||||
&& unzip android-ndk-r17c-linux-x86_64.zip > /dev/null \
|
||||
&& mv android-ndk-r17c $ANDROID_NDK_PATH \
|
||||
&& rm android-ndk-r17c-linux-x86_64.zip
|
||||
|
||||
# Android build system
|
||||
RUN mkdir build && cd build && git init && git pull --depth 1 https://android.googlesource.com/platform/build 2db32730e79cafcf13e1f898a7bee7f82b0449d6
|
||||
RUN ln -s build/core/main.mk Makefile
|
||||
|
||||
RUN mkdir /opt/bin
|
||||
|
||||
# Workarounds for java checking
|
||||
RUN printf '#!/bin/sh\n\
|
||||
echo java version \\"1.6\\"'\
|
||||
> $OPT_BIN/java \
|
||||
&& printf '#!/bin/sh\n\
|
||||
echo javac \\"1.6\\"'\
|
||||
> $OPT_BIN/javac \
|
||||
&& chmod a+x $OPT_BIN/java $OPT_BIN/javac \
|
||||
&& mkdir -p /usr/lib/jvm/java-6-openjdk-amd64/lib/ \
|
||||
&& touch /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar
|
||||
|
||||
# Files for building ndk
|
||||
# The default libstdc++.so does not contain full stl implementation, see https://developer.android.com/ndk/guides/cpp-support
|
||||
RUN mkdir -p system/core/include/arch/linux-arm \
|
||||
&& touch system/core/include/arch/linux-arm/AndroidConfig.h \
|
||||
&& mkdir -p system/core/include/arch/linux-x86 \
|
||||
&& touch system/core/include/arch/linux-x86/AndroidConfig.h \
|
||||
&& mkdir -p bionic/libc/ \
|
||||
&& cp -r "$ANDROID_NDK_PATH"/sysroot/usr/include bionic/libc/include \
|
||||
&& mv bionic/libc/include/arm-linux-androideabi/asm bionic/libc/include/asm \
|
||||
&& mkdir -p out/target/product/generic/obj/ \
|
||||
&& cp -r "$ANDROID_NDK_PATH"/platforms/android-27/arch-arm/usr/lib out/target/product/generic/obj/ \
|
||||
&& mkdir -p bionic/libstdc++ \
|
||||
&& cp -r "$ANDROID_NDK_PATH"/sources/cxx-stl/gnu-libstdc++/4.9/include bionic/libstdc++ \
|
||||
&& cp -r "$ANDROID_NDK_PATH"/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include/* bionic/libstdc++/include \
|
||||
&& cp "$ANDROID_NDK_PATH"/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so out/target/product/generic/obj/lib/libstdc++.so \
|
||||
&& printf "TARGET_PRODUCT := generic\n\
|
||||
TARGET_BUILD_VARIANT := eng\n\
|
||||
TARGET_BUILD_TYPE := release\n\
|
||||
TARGET_TOOLS_PREFIX := $ANDROID_NDK_PATH/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"\
|
||||
> buildspec.mk
|
||||
|
||||
RUN rm -rf "$ANDROID_NDK_PATH"/platforms
|
||||
RUN rm -rf "$ANDROID_NDK_PATH"/prebuilt
|
||||
RUN rm -rf "$ANDROID_NDK_PATH"/shader-tools
|
||||
RUN rm -rf "$ANDROID_NDK_PATH"/sources
|
||||
RUN rm -rf "$ANDROID_NDK_PATH"/sysroot
|
||||
RUN rm -rf "$ANDROID_NDK_PATH"/simpleperf
|
||||
RUN cd "$ANDROID_NDK_PATH"/toolchains && rm -rf aarch64-linux-android-4.9 llvm mips64el-linux-android-4.9 mipsel-linux-android-4.9 x86-4.9 x86_64-4.9
|
||||
RUN apt-get purge -y unzip wget git && apt-get -y autoremove && apt-get -y clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
CMD ["bash"]
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# Ubuntu image with tools required to build OpenThread
|
||||
FROM arm32v7/ubuntu:18.04 as wpantund-dev
|
||||
|
||||
LABEL maintainer="Marcin K Szczodrak"
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y apt-utils
|
||||
RUN apt-get install -y build-essential git make autoconf autoconf-archive \
|
||||
automake dbus libtool gcc g++ libreadline-dev libdbus-1-dev libboost-dev
|
||||
|
||||
# wpantund
|
||||
RUN mkdir -p ~/src && \
|
||||
cd ~/src && \
|
||||
git clone --recursive https://github.com/openthread/wpantund.git && \
|
||||
cd wpantund && \
|
||||
git checkout full/master && \
|
||||
./configure --sysconfdir=/etc --enable-shared=no && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
#FROM debian:stretch-slim
|
||||
FROM arm32v7/ubuntu:18.04
|
||||
|
||||
LABEL maintainer="Marcin K Szczodrak"
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get install -y libdbus-1-3 libreadline-dev net-tools
|
||||
|
||||
RUN mkdir -p /dev/net && \
|
||||
mknod /dev/net/tun c 10 200 && \
|
||||
chmod 600 /dev/net/tun
|
||||
|
||||
COPY --from=wpantund-dev /usr/local/share/man/man1/wpanctl.1 /usr/local/share/man/man1/wpanctl.1
|
||||
COPY --from=wpantund-dev /usr/local/share/man/man1/wpantund.1 /usr/local/share/man/man1/wpantund.1
|
||||
COPY --from=wpantund-dev /usr/local/share/wpantund /usr/local/share/wpantund
|
||||
COPY --from=wpantund-dev /usr/local/include/wpantund /usr/local/include/wpantund
|
||||
COPY --from=wpantund-dev /usr/local/bin/wpanctl /usr/local/bin/wpanctl
|
||||
COPY --from=wpantund-dev /usr/local/sbin/wpantund /usr/local/sbin/wpantund
|
||||
COPY --from=wpantund-dev /etc/dbus-1/system.d/wpantund.conf /etc/dbus-1/system.d/wpantund.conf
|
||||
COPY --from=wpantund-dev /etc/wpantund.conf /etc/wpantund.conf
|
||||
|
||||
ENTRYPOINT mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun && \
|
||||
service dbus start && \
|
||||
start-stop-daemon --start --background --quiet --exe /usr/local/sbin/wpantund -- -s $OPENTHREAD_DEVICE_PORT && \
|
||||
tail -F /dev/null
|
||||
|
||||
@@ -6,34 +6,19 @@ ENV DEBIAN_FRONTEND noninteractive
|
||||
# Install dependencies:
|
||||
RUN apt-get update -qq
|
||||
|
||||
# Install packages needed for wpantund build and runtime:
|
||||
RUN apt-get install -y build-essential git make autoconf \
|
||||
autoconf-archive automake dbus libtool gcc \
|
||||
g++ gperf flex bison texinfo ncurses-dev \
|
||||
libexpat-dev python sed python-pip gawk \
|
||||
libreadline6-dev libdbus-1-dev \
|
||||
libboost-dev inetutils-ping
|
||||
|
||||
RUN apt-get install -y --force-yes gcc-arm-none-eabi
|
||||
RUN pip install pexpect
|
||||
|
||||
# Install wpantund:
|
||||
RUN mkdir -p ~/src && \
|
||||
cd ~/src && \
|
||||
git clone --recursive https://github.com/openthread/wpantund.git && \
|
||||
cd wpantund && \
|
||||
git checkout full/master && \
|
||||
./configure --sysconfdir=/etc && \
|
||||
make && make install
|
||||
|
||||
RUN mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun
|
||||
|
||||
# Restart dbus
|
||||
RUN service dbus restart
|
||||
# Install packages needed for build and runtime:
|
||||
RUN apt-get --no-install-recommends install -y git sudo software-properties-common \
|
||||
ca-certificates \
|
||||
&& update-ca-certificates
|
||||
|
||||
# Install OpenThread
|
||||
RUN cd ~/src && \
|
||||
RUN mkdir -p ~/src && \
|
||||
cd ~/src && \
|
||||
git clone --recursive https://github.com/openthread/openthread.git && \
|
||||
cd openthread && \
|
||||
./script/bootstrap && \
|
||||
./bootstrap && \
|
||||
make -f examples/Makefile-posix
|
||||
make -f examples/Makefile-simulation
|
||||
|
||||
# Install OpenThread Daemon and ot-ctl
|
||||
RUN cd ~/src/openthread && make -f src/posix/Makefile-posix DAEMON=1
|
||||
|
||||
@@ -2,26 +2,30 @@
|
||||
FROM ubuntu:18.04
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV LANG en_US.UTF-8
|
||||
|
||||
RUN apt-get -y update
|
||||
RUN apt-get install -y git software-properties-common sudo
|
||||
RUN apt-get install -y iproute2 psmisc rsyslog
|
||||
RUN set -x \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y locales \
|
||||
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
|
||||
&& apt-get --no-install-recommends install -fy \
|
||||
git \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
software-properties-common \
|
||||
sudo \
|
||||
&& python3 -m pip install -U cmake \
|
||||
&& python3 -m pip install wheel
|
||||
|
||||
# setup openthread
|
||||
WORKDIR /
|
||||
COPY . openthread
|
||||
WORKDIR /openthread
|
||||
RUN git reset --hard && git clean -xfd
|
||||
RUN ./script/bootstrap
|
||||
|
||||
# setup wpantund
|
||||
WORKDIR /
|
||||
RUN git clone https://github.com/openthread/wpantund.git
|
||||
WORKDIR /wpantund
|
||||
RUN ./script/bootstrap && ./bootstrap.sh && ./configure && sudo make -j8 && sudo make install
|
||||
|
||||
# entrypoint
|
||||
WORKDIR /
|
||||
COPY etc/docker/environment/docker-entrypoint.sh /
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["bash"]
|
||||
RUN set -x \
|
||||
&& cd openthread \
|
||||
&& ./script/bootstrap \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake -GNinja -DOT_PLATFORM=simulation .. \
|
||||
&& ninja
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
FROM alpine:3.6 as openthread-dev
|
||||
LABEL maintainer="Marcin K Szczodrak"
|
||||
|
||||
RUN apk add -U autoconf automake ca-certificates flex git g++ libtool linux-headers make
|
||||
|
||||
# openthread
|
||||
RUN git clone --recursive https://github.com/openthread/openthread.git && \
|
||||
cd /openthread && \
|
||||
./bootstrap && \
|
||||
make -f examples/Makefile-posix
|
||||
|
||||
|
||||
FROM alpine:3.6
|
||||
LABEL maintainer="Marcin K Szczodrak"
|
||||
|
||||
RUN apk add --no-cache libstdc++
|
||||
COPY --from=openthread-dev /openthread/output/x86_64-unknown-linux-gnu/bin/ot-cli-ftd /bin/ot-cli-ftd
|
||||
COPY --from=openthread-dev /openthread/output/x86_64-unknown-linux-gnu/bin/ot-cli-mtd /bin/ot-cli-mtd
|
||||
RUN ln -s /bin/ot-cli-ftd /bin/node
|
||||
@@ -1,36 +0,0 @@
|
||||
|
||||
## Starting simulator
|
||||
|
||||
To start the OpenThread simulator, run:
|
||||
```
|
||||
docker run --rm -d --name otsim openthread/sim tail -F /dev/null
|
||||
```
|
||||
or
|
||||
```
|
||||
./start_sim
|
||||
```
|
||||
This runs in background a docker container with environment setup to simulate OpenThread nodes.
|
||||
|
||||
## Adding a Thread node
|
||||
|
||||
To start simulating an OpenThread node #1, run:
|
||||
```
|
||||
docker exec -it otsim node 1
|
||||
```
|
||||
or
|
||||
```
|
||||
./add_node 1
|
||||
```
|
||||
This runs a program called node, which is an OpenThread FTD binary, inside the docker container's simulator environment.
|
||||
|
||||
## Stopping simulator
|
||||
|
||||
To stop the OpenThread simualtor, run:
|
||||
```
|
||||
docker stop otsim
|
||||
```
|
||||
or
|
||||
```
|
||||
./stop_sim
|
||||
```
|
||||
This stop the docker daemon process.
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
docker exec -it otsim node $1
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
docker run --rm -d --name otsim openthread/sim tail -F /dev/null
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
docker stop otsim
|
||||
@@ -1,50 +0,0 @@
|
||||
# Ubuntu image with tools required to build OpenThread
|
||||
FROM ubuntu:18.04 as wpantund-dev
|
||||
|
||||
LABEL maintainer="Marcin K Szczodrak"
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y apt-utils
|
||||
RUN apt-get install -y build-essential git make autoconf autoconf-archive \
|
||||
automake dbus libtool gcc g++ libreadline-dev libdbus-1-dev libboost-dev
|
||||
|
||||
# wpantund
|
||||
RUN mkdir -p ~/src && \
|
||||
cd ~/src && \
|
||||
git clone --recursive https://github.com/openthread/wpantund.git && \
|
||||
cd wpantund && \
|
||||
git checkout full/master && \
|
||||
./configure --sysconfdir=/etc --enable-shared=no && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
#FROM debian:stretch-slim
|
||||
FROM ubuntu:18.04
|
||||
|
||||
LABEL maintainer="Marcin K Szczodrak"
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get install -y libdbus-1-3 libreadline7 net-tools
|
||||
|
||||
RUN mkdir -p /dev/net && \
|
||||
mknod /dev/net/tun c 10 200 && \
|
||||
chmod 600 /dev/net/tun
|
||||
|
||||
COPY --from=wpantund-dev /usr/local/share/man/man1/wpanctl.1 /usr/local/share/man/man1/wpanctl.1
|
||||
COPY --from=wpantund-dev /usr/local/share/man/man1/wpantund.1 /usr/local/share/man/man1/wpantund.1
|
||||
COPY --from=wpantund-dev /usr/local/share/wpantund /usr/local/share/wpantund
|
||||
COPY --from=wpantund-dev /usr/local/include/wpantund /usr/local/include/wpantund
|
||||
COPY --from=wpantund-dev /usr/local/bin/wpanctl /usr/local/bin/wpanctl
|
||||
COPY --from=wpantund-dev /usr/local/sbin/wpantund /usr/local/sbin/wpantund
|
||||
COPY --from=wpantund-dev /etc/dbus-1/system.d/wpantund.conf /etc/dbus-1/system.d/wpantund.conf
|
||||
COPY --from=wpantund-dev /etc/wpantund.conf /etc/wpantund.conf
|
||||
|
||||
ENTRYPOINT mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun && \
|
||||
service dbus start && \
|
||||
start-stop-daemon --start --background --quiet --exe /usr/local/sbin/wpantund -- -s $OPENTHREAD_DEVICE_PORT && \
|
||||
tail -F /dev/null
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE]
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
_openthread_config_file = ""
|
||||
if (current_os == "fuchsia") {
|
||||
_openthread_config_file = "<openthread-config-android.h>"
|
||||
}
|
||||
|
||||
declare_args() {
|
||||
# OpenThread config header.
|
||||
openthread_config_file = _openthread_config_file
|
||||
|
||||
# Extra deps for OpenThread configuration.
|
||||
openthread_config_deps = []
|
||||
|
||||
# Include directories for project specific configs.
|
||||
openthread_project_include_dirs = []
|
||||
|
||||
# OpenThread project-specific core config header
|
||||
openthread_project_core_config_file = ""
|
||||
|
||||
# OpenThread platform-specific config check header
|
||||
openthread_core_config_platform_check_file = ""
|
||||
|
||||
# Extra deps for OpenThread core configuration.
|
||||
openthread_core_config_deps = []
|
||||
|
||||
# Use external platform.
|
||||
openthread_external_platform = ""
|
||||
|
||||
# Use external mbedtls. If blank, internal mbedtls will be used.
|
||||
openthread_external_mbedtls = ""
|
||||
|
||||
# Package name for OpenThread.
|
||||
openthread_package_name = "OPENTHREAD"
|
||||
|
||||
# Package version for OpenThread.
|
||||
openthread_package_version = "1.0.0"
|
||||
}
|
||||
|
||||
declare_args() {
|
||||
# Configure OpenThread via GN arguments.
|
||||
openthread_enable_core_config_args = openthread_project_core_config_file == ""
|
||||
}
|
||||
|
||||
if (openthread_enable_core_config_args) {
|
||||
declare_args() {
|
||||
# Thread version: 1.1, 1.2
|
||||
openthread_config_thread_version = ""
|
||||
|
||||
# Log output: none, debug_uart, app, platform
|
||||
openthread_config_log_output = ""
|
||||
|
||||
# Enable assertions.
|
||||
openthread_config_assert_enable = true
|
||||
|
||||
# Enable backbone router functionality
|
||||
openthread_config_backbone_router_enable = false
|
||||
|
||||
# Enable border agent support
|
||||
openthread_config_border_agent_enable = false
|
||||
|
||||
# Enable border router support
|
||||
openthread_config_border_router_enable = false
|
||||
|
||||
# Enable channel manager support
|
||||
openthread_config_channel_manager_enable = false
|
||||
|
||||
# Enable channel monitor support
|
||||
openthread_config_channel_monitor_enable = false
|
||||
|
||||
# Enable child supervision support
|
||||
openthread_config_child_supervision_enable = false
|
||||
|
||||
# Enable coap api support
|
||||
openthread_config_coap_api_enable = false
|
||||
|
||||
# Enable secure coap api support
|
||||
openthread_config_coap_secure_api_enable = false
|
||||
|
||||
# Enable coap observe (RFC7641) api support
|
||||
openthread_config_coap_observe_api_enable = false
|
||||
|
||||
# Enable commissioner support
|
||||
openthread_config_commissioner_enable = false
|
||||
|
||||
# Enable csl receiver
|
||||
openthread_config_mac_csl_receiver_enable = false
|
||||
|
||||
# Enable DHCP6 client support
|
||||
openthread_config_dhcp6_client_enable = false
|
||||
|
||||
# Enable DHCP6 server support
|
||||
openthread_config_dhcp6_server_enable = false
|
||||
|
||||
# Enable diagnostic support
|
||||
openthread_config_diag_enable = false
|
||||
|
||||
# Enable DNS client support
|
||||
openthread_config_dns_client_enable = false
|
||||
|
||||
# Enable ECDSA support
|
||||
openthread_config_ecdsa_enable = false
|
||||
|
||||
# Enable Domain Unicast Address feature for Thread 1.2
|
||||
openthread_config_dua_enable = false
|
||||
|
||||
# Enable Multicast Listener Registration feature for Thread 1.2
|
||||
openthread_config_mlr_enable = false
|
||||
|
||||
# Enable external heap support
|
||||
openthread_config_heap_external_enable = false
|
||||
|
||||
# Enable ipv6 fragmentation support
|
||||
openthread_config_ip6_fragmentation_enable = false
|
||||
|
||||
# Enable jam detection support
|
||||
openthread_config_jam_detection_enable = false
|
||||
|
||||
# Enable joiner support
|
||||
openthread_config_joiner_enable = false
|
||||
|
||||
# Enable legacy network support
|
||||
openthread_config_legacy_enable = false
|
||||
|
||||
# Enable link raw service
|
||||
openthread_config_link_raw_enable = false
|
||||
|
||||
# Enable dynamic log level control
|
||||
openthread_config_log_level_dynamic_enable = false
|
||||
|
||||
# Enable mac filter support
|
||||
openthread_config_mac_filter_enable = false
|
||||
|
||||
# Enable MLE long routes extension (experimental, breaks Thread conformance]
|
||||
openthread_config_mle_long_routes_enable = false
|
||||
|
||||
# Enable TMF network diagnostics on MTDs
|
||||
openthread_config_tmf_network_diag_mtd_enable = false
|
||||
|
||||
# Enable multiple instances
|
||||
openthread_config_multiple_instance_enable = false
|
||||
|
||||
# Enable platform netif support
|
||||
openthread_config_platform_netif_enable = false
|
||||
|
||||
# Enable platform UDP support
|
||||
openthread_config_platform_udp_enable = false
|
||||
|
||||
# Enable Thread Test Harness reference device support
|
||||
openthread_config_reference_device_enable = false
|
||||
|
||||
# Enable support for injecting Service entries into the Thread Network Data
|
||||
openthread_config_tmf_netdata_service_enable = false
|
||||
|
||||
# Enable volatile-only storage of settings
|
||||
openthread_settings_ram = false
|
||||
|
||||
# Enable support for adding of auto-configured SLAAC addresses by OpenThread
|
||||
openthread_config_ip6_slaac_enable = false
|
||||
|
||||
# Enable SNTP Client support
|
||||
openthread_config_sntp_client_enable = false
|
||||
|
||||
# Enable the time synchronization service feature
|
||||
openthread_config_time_sync_enable = false
|
||||
|
||||
# Enable UDP forward support
|
||||
openthread_config_udp_forward_enable = false
|
||||
|
||||
# Enable full logs
|
||||
openthread_config_full_logs = false
|
||||
|
||||
# Enable OTNS support
|
||||
openthread_config_otns_enable = false
|
||||
|
||||
# Enable NCP SPI support
|
||||
openthread_config_ncp_spi_enable = false
|
||||
|
||||
# Enable NCP UART support
|
||||
openthread_config_ncp_uart_enable = false
|
||||
|
||||
# Enable builtin mbedtls management
|
||||
openthread_config_enable_builtin_mbedtls_management =
|
||||
openthread_external_mbedtls == ""
|
||||
}
|
||||
}
|
||||
|
||||
if (openthread_external_mbedtls != "") {
|
||||
mbedtls_target = openthread_external_mbedtls
|
||||
} else {
|
||||
mbedtls_target = "../../third_party/mbedtls"
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
add_subdirectory(platforms)
|
||||
|
||||
if(OT_BUILD_EXECUTABLES)
|
||||
add_subdirectory(apps)
|
||||
endif()
|
||||
@@ -0,0 +1,309 @@
|
||||
#
|
||||
# Copyright (c) 2017, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = arm-none-eabi-as
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--enable-linker-map \
|
||||
--with-examples=efr32mg1 \
|
||||
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)"
|
||||
endif
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
|
||||
#
|
||||
# Differentiate between boards
|
||||
#
|
||||
ifeq ($(BOARD),BRD4151A)
|
||||
MCU = EFR32MG1P232F256GM48
|
||||
else
|
||||
$(error Please provide a value for BOARD variable e.g BOARD= BRD4151A (currently supported BRD4151A))
|
||||
endif
|
||||
|
||||
EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"efr32-mbedtls-config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32mg1/crypto
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/util/third_party/mbedtls/configs
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/util/third_party/mbedtls/sl_crypto/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/Device/SiliconLabs/EFR32MG1P/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/radio/rail_lib/chip/efr32/efr32xg1x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
|
||||
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/efr32mg1/
|
||||
HAL_CONF_DIR = $(CONFIG_FILE_PATH)/$(shell echo $(BOARD) | tr A-Z a-z)
|
||||
|
||||
EFR32MG1_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-efr32-config.h\"'
|
||||
EFR32MG1_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-efr32-config-check.h\"'
|
||||
EFR32MG1_CONFIG_FILE_CPPFLAGS += -I$(CONFIG_FILE_PATH)
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
-I$(HAL_CONF_DIR) \
|
||||
-D__START=main \
|
||||
-D$(MCU) \
|
||||
$(EFR32MG1_CONFIG_FILE_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
#
|
||||
# Platform-Specific switches
|
||||
#
|
||||
|
||||
DMP ?= 0
|
||||
RADIODEBUG ?= 0
|
||||
|
||||
ifeq ($(DMP),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DMP_SUPPORT=1
|
||||
endif
|
||||
|
||||
ifeq ($(RADIODEBUG),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DEBUG_COUNTERS_SUPPORT=1
|
||||
endif
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-nostartfiles \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = efr32mg1
|
||||
|
||||
ARCHS = cortex-m4
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# cortex-m4
|
||||
#
|
||||
|
||||
cortex-m4_target_ABI = cortex-m4
|
||||
cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
@@ -89,12 +89,12 @@ EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"efr32-mbedtls-config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32mg12/crypto
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/util/third_party/mbedtls/configs
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/util/third_party/mbedtls/sl_crypto/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/platform/Device/SiliconLabs/EFR32MG12P/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/platform/radio/rail_lib/chip/efr32/efr32xg1x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/util/third_party/mbedtls/configs
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/util/third_party/mbedtls/sl_crypto/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/Device/SiliconLabs/EFR32MG12P/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/radio/rail_lib/chip/efr32/efr32xg1x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = arm-none-eabi-as
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--enable-linker-map \
|
||||
--with-examples=efr32mg13 \
|
||||
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)"
|
||||
endif
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
|
||||
#
|
||||
# Differentiate between boards
|
||||
# - BRD4168A / SLWSTK6000B / MGM13P Module / 2.4GHz@19dBm
|
||||
#
|
||||
ifeq ($(BOARD),BRD4168A)
|
||||
MCU = EFR32MG13P732F512GM48
|
||||
else
|
||||
$(error Please provide a value for BOARD variable e.g BOARD=BRD4168A (currently supported BRD4168A))
|
||||
endif
|
||||
|
||||
EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"efr32-mbedtls-config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32mg13/crypto
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/util/third_party/mbedtls/configs
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/util/third_party/mbedtls/sl_crypto/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/Device/SiliconLabs/EFR32MG13P/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/radio/rail_lib/chip/efr32/efr32xg1x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
|
||||
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/efr32mg13/
|
||||
HAL_CONF_DIR = $(CONFIG_FILE_PATH)/$(shell echo $(BOARD) | tr A-Z a-z)
|
||||
|
||||
EFR32MG13_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-efr32-config.h\"'
|
||||
EFR32MG13_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-efr32-config-check.h\"'
|
||||
EFR32MG13_CONFIG_FILE_CPPFLAGS += -I$(CONFIG_FILE_PATH)
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
-I$(HAL_CONF_DIR) \
|
||||
-D__START=main \
|
||||
-D$(MCU) \
|
||||
$(EFR32MG13_CONFIG_FILE_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
#
|
||||
# Platform-Specific switches
|
||||
#
|
||||
|
||||
DMP ?= 0
|
||||
RADIODEBUG ?= 0
|
||||
|
||||
ifeq ($(DMP),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DMP_SUPPORT=1
|
||||
endif
|
||||
|
||||
ifeq ($(RADIODEBUG),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DEBUG_COUNTERS_SUPPORT=1
|
||||
endif
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-nostartfiles \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = efr32mg13
|
||||
|
||||
ARCHS = cortex-m4
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# cortex-m4
|
||||
#
|
||||
|
||||
cortex-m4_target_ABI = cortex-m4
|
||||
cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
@@ -74,16 +74,18 @@ EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"efr32-mbedtls-config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32mg21/crypto
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/util/third_party/mbedtls/configs
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/util/third_party/mbedtls/sl_crypto/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/platform/Device/SiliconLabs/EFR32MG21/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/platform/radio/rail_lib/chip/efr32/efr32xg2x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.6/hardware/kit/common/drivers
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/util/third_party/mbedtls/configs
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/util/third_party/mbedtls/sl_crypto/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/Device/SiliconLabs/EFR32MG21/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/platform/radio/rail_lib/chip/efr32/efr32xg2x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v2.7/hardware/kit/common/drivers
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -Wno-unused-function
|
||||
EFR32_MBEDTLS_CPPFLAGS += -Wno-unused-parameter
|
||||
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/efr32mg21/
|
||||
HAL_CONF_DIR = $(CONFIG_FILE_PATH)/$(shell echo $(BOARD) | tr A-Z a-z)
|
||||
|
||||
@@ -81,6 +81,8 @@ CPPFLAGS += \
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
-D_BSD_SOURCE=1 \
|
||||
-D_DEFAULT_SOURCE=1 \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
Executable
+295
@@ -0,0 +1,295 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = arm-none-eabi-as
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--with-ncp-bus=uart \
|
||||
--enable-radio-only \
|
||||
--enable-linker-map \
|
||||
--with-examples=jn5189 \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += MBEDTLS_CPPFLAGS="$(JN5189_MBEDTLS_CPPFLAGS)"
|
||||
endif
|
||||
|
||||
JN5189_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||
JN5189_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"jn5189-mbedtls-config.h\"'
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/include/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/devices/JN5189
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/middleware/mbedtls/port/ksdk/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/devices/JN5189/drivers/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/devices/JN5189/utilities/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/devices/JN5189/utilities/debug-console/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/devices/JN5189/utilities/str/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/drivers/components/serial_manager/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/drivers/components/uart/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/JN5189DK6/CMSIS/Include/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/
|
||||
JN5189_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls/
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-jn5189-config.h\"'
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/k32w/jn5189/
|
||||
SIGN_IMAGE_PATH = $(AbsTopSourceDir)/third_party/nxp/JN5189DK6/tools/imagetool/
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
-DCPU_JN518X \
|
||||
-DCPU_JN518X_REV=2 \
|
||||
-DJENNIC_CHIP_FAMILY_JN518x \
|
||||
-DJENNIC_CHIP_FAMILY_NAME=_JN518x \
|
||||
-DSDK_DEBUGCONSOLE=0 \
|
||||
-D$(CONFIG_FILE) \
|
||||
-DUSE_RTOS=0 \
|
||||
-I$(CONFIG_FILE_PATH) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = jn5189
|
||||
|
||||
ARCHS = cortex-m4
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
TopTargetBinDir = $(TopResultDir)/$(TargetTuple)/bin
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# cortex-m4
|
||||
#
|
||||
|
||||
cortex-m4_target_ABI = cortex-m4
|
||||
cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage post-build-step
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
post-build-step:
|
||||
$(SIGN_IMAGE_PATH)/sign_images.sh $(TopTargetBinDir)
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
Executable
+298
@@ -0,0 +1,298 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = arm-none-eabi-as
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--with-ncp-bus=uart \
|
||||
--enable-radio-only \
|
||||
--enable-linker-map \
|
||||
--with-examples=k32w061 \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += MBEDTLS_CPPFLAGS="$(K32W061_MBEDTLS_CPPFLAGS)"
|
||||
endif
|
||||
|
||||
K32W061_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||
K32W061_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"k32w061-mbedtls-config.h\"'
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/include/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/devices/K32W061
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/middleware/mbedtls/port/ksdk/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/devices/K32W061/drivers/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/devices/K32W061/utilities/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/devices/K32W061/utilities/debug-console/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/devices/K32W061/utilities/str/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/drivers/components/serial_manager/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/drivers/components/uart/
|
||||
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/nxp/K32W061DK6/CMSIS/Include/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/
|
||||
K32W061_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls/
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-k32w061-config.h\"'
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/k32w/k32w061/
|
||||
SIGN_IMAGE_PATH = $(AbsTopSourceDir)/third_party/nxp/K32W061DK6/tools/imagetool/
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
-DCPU_K32W061HN \
|
||||
-DCPU_JN518X \
|
||||
-DCPU_JN518X_REV=2 \
|
||||
-DJENNIC_CHIP_FAMILY_JN518x \
|
||||
-DJENNIC_CHIP_FAMILY_NAME=_JN518x \
|
||||
-DSDK_DEBUGCONSOLE=0 \
|
||||
-D$(CONFIG_FILE) \
|
||||
-DUSE_RTOS=0 \
|
||||
-I$(CONFIG_FILE_PATH) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = k32w061
|
||||
|
||||
ARCHS = cortex-m4
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
TopTargetBinDir = $(TopResultDir)/$(TargetTuple)/bin
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# cortex-m4
|
||||
#
|
||||
|
||||
cortex-m4_target_ABI = cortex-m4
|
||||
cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage post-build-step
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
post-build-step:
|
||||
$(SIGN_IMAGE_PATH)/sign_images.sh $(TopTargetBinDir)
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
@@ -60,7 +60,6 @@ NRF52811_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"nrf52811-mbedtls-conf
|
||||
NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
|
||||
NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
|
||||
NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
|
||||
NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/crypto
|
||||
NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config
|
||||
NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/nrfx/mdk
|
||||
NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/cmsis
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = $(CCPREFIX) arm-none-eabi-gcc
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = $(CCPREFIX) arm-none-eabi-gcc
|
||||
CXX = $(CCPREFIX) arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.`)
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-linker-map \
|
||||
--with-examples=nrf52833 \
|
||||
MBEDTLS_CPPFLAGS="$(NRF52833_MBEDTLS_CPPFLAGS)" \
|
||||
$(NULL)
|
||||
|
||||
ifdef SRC_PATH
|
||||
configure_OPTIONS += --srcdir="$(SRC_PATH)"
|
||||
endif
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
NRF52833_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"'
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"nrf52833-mbedtls-config.h\"'
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/nrfx/mdk
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/cmsis
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -DNRF52833_XXAA
|
||||
|
||||
NRF52833_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-nrf52833-config.h\"'
|
||||
NRF52833_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-nrf52833-config-check.h\"'
|
||||
NRF52833_CONFIG_FILE_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52833
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
$(NRF52833_CONFIG_FILE_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
ifeq ($(BOOTLOADER),1)
|
||||
$(info Warning: BOOTLOADER=1 switch is deprecated. Defaulting to BOOTLOADER=USB.)
|
||||
override BOOTLOADER = USB
|
||||
endif
|
||||
|
||||
ifeq ($(BOOTLOADER),USB)
|
||||
configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_usb.ld
|
||||
COMMONCFLAGS += -DAPP_USBD_NRF_DFU_TRIGGER_ENABLED=1
|
||||
endif
|
||||
|
||||
ifeq ($(BOOTLOADER),UART)
|
||||
configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_uart.ld
|
||||
endif
|
||||
|
||||
ifeq ($(BOOTLOADER),BLE)
|
||||
configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_ble.ld
|
||||
endif
|
||||
|
||||
#
|
||||
# Select transport which CLI, NCP and RCP examples will use to communicate.
|
||||
# To disable all transports use the DISABLE_TRANSPORTS switch. This will disable
|
||||
# the build of all above examples.
|
||||
# If NCP_SPI switch is set, only NCP and RCP examples will be built.
|
||||
# Otherwise the user can select USB transport. If no transports were selected,
|
||||
# the default serial transport is UART.
|
||||
#
|
||||
ifndef DISABLE_TRANSPORTS
|
||||
configure_OPTIONS += --enable-ncp
|
||||
configure_OPTIONS += --enable-radio-only
|
||||
ifeq ($(NCP_SPI),1)
|
||||
COMMONCFLAGS += -DSPIS_AS_SERIAL_TRANSPORT=1
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1
|
||||
else
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1
|
||||
configure_OPTIONS += --enable-cli
|
||||
ifeq ($(USB),1)
|
||||
COMMONCFLAGS += -DUSB_CDC_AS_SERIAL_TRANSPORT=1
|
||||
else
|
||||
COMMONCFLAGS += -DUART_AS_SERIAL_TRANSPORT=1
|
||||
endif # USB == 1
|
||||
endif # NCP_SPI == 1
|
||||
endif # DISABLE_TRANSPORTS
|
||||
|
||||
NRF52833_MBEDTLS_CPPFLAGS += -DDISABLE_CC310=1
|
||||
|
||||
ifeq ($(shell expr $(GCCVersion) \>= 7), 1)
|
||||
COMMONCFLAGS += -Wno-expansion-to-defined
|
||||
endif
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
CCASFLAGS += \
|
||||
$(COMMONCCASFLAGS) \
|
||||
$(target_CCASFLAGS) \
|
||||
-x \
|
||||
assembler-with-cpp \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = nrf52833
|
||||
|
||||
ARCHS = cortex-m4
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" CCAS="$(CCAS)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CCASFLAGS="$(CCASFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
configure-$(1): target_CCASFLAGS=$($(1)_target_CCASFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# Cortex-m4
|
||||
#
|
||||
|
||||
cortex-m4_target_ABI = cortex-m4
|
||||
cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs
|
||||
cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs
|
||||
cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs
|
||||
cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Flashing / Debugging
|
||||
#
|
||||
|
||||
TARGET_APP ?= ot-cli-ftd
|
||||
APP_FILE_NAME = $(TopResultDir)/$(TargetTuple)/bin/$(TARGET_APP)
|
||||
APP_FILE_HEX = $(TopResultDir)/$(TargetTuple)/bin/$(TARGET_APP).hex
|
||||
|
||||
nrfjprog: $(APP_FILE_NAME)
|
||||
arm-none-eabi-objcopy -O ihex $(<) $(APP_FILE_HEX)
|
||||
nrfjprog -f NRF52 --sectorerase --reset --program $(APP_FILE_HEX)
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
@@ -38,6 +38,7 @@ DEBUG ?= 0
|
||||
BORDER_AGENT ?= 1
|
||||
BORDER_ROUTER ?= 1
|
||||
COAP ?= 1
|
||||
COAP_OBSERVE ?= 1
|
||||
COAPS ?= 1
|
||||
COMMISSIONER ?= 1
|
||||
CHANNEL_MANAGER ?= 1
|
||||
@@ -73,7 +74,7 @@ configure_OPTIONS = \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--with-examples=posix \
|
||||
--with-examples=simulation \
|
||||
$(NULL)
|
||||
|
||||
# Platform specific switches
|
||||
@@ -90,12 +91,16 @@ else
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1
|
||||
endif # NCP_SPI == 1
|
||||
|
||||
ifeq ($(OTNS),1)
|
||||
VIRTUAL_TIME ?= 1
|
||||
endif
|
||||
|
||||
ifeq ($(VIRTUAL_TIME),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_POSIX_VIRTUAL_TIME=1
|
||||
COMMONCFLAGS += -DOPENTHREAD_SIMULATION_VIRTUAL_TIME=1
|
||||
endif
|
||||
|
||||
ifeq ($(VIRTUAL_TIME_UART),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_POSIX_VIRTUAL_TIME_UART=1
|
||||
COMMONCFLAGS += -DOPENTHREAD_SIMULATION_VIRTUAL_TIME_UART=1
|
||||
endif
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
@@ -103,8 +108,8 @@ include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-posix-config.h\"'
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/posix/
|
||||
CONFIG_FILE = OPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-simulation-config.h\"'
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/simulation/
|
||||
COMMONCFLAGS += \
|
||||
-D$(CONFIG_FILE) \
|
||||
-I$(CONFIG_FILE_PATH) \
|
||||
@@ -47,11 +47,4 @@ SUBDIRS += \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
# Always pretty (e.g. for 'make pretty') these subdirectories.
|
||||
|
||||
PRETTY_SUBDIRS = \
|
||||
platforms \
|
||||
apps \
|
||||
$(NULL)
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if(OT_APP_CLI)
|
||||
add_subdirectory(cli)
|
||||
endif()
|
||||
|
||||
add_subdirectory(ncp)
|
||||
@@ -50,11 +50,4 @@ SUBDIRS += ncp
|
||||
endif
|
||||
endif
|
||||
|
||||
# Always pretty (e.g. for 'make pretty') these subdirectories.
|
||||
|
||||
PRETTY_SUBDIRS = \
|
||||
cli \
|
||||
ncp \
|
||||
$(NULL)
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
add_executable(ot-cli-ftd
|
||||
main.c
|
||||
)
|
||||
|
||||
add_executable(ot-cli-mtd
|
||||
main.c
|
||||
)
|
||||
|
||||
set(COMMON_INCLUDES
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
${PROJECT_SOURCE_DIR}/examples/platforms
|
||||
${PROJECT_SOURCE_DIR}/src/core
|
||||
)
|
||||
|
||||
target_include_directories(ot-cli-ftd PRIVATE ${COMMON_INCLUDES})
|
||||
target_include_directories(ot-cli-mtd PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
target_link_libraries(ot-cli-ftd PRIVATE
|
||||
openthread-cli-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
mbedcrypto
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(ot-cli-mtd PRIVATE
|
||||
openthread-cli-mtd
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-mtd
|
||||
${OT_PLATFORM_LIB}
|
||||
mbedcrypto
|
||||
ot-config
|
||||
)
|
||||
|
||||
install(TARGETS ot-cli-ftd ot-cli-mtd
|
||||
DESTINATION bin)
|
||||
@@ -34,6 +34,7 @@ bin_PROGRAMS = \
|
||||
|
||||
CPPFLAGS_COMMON += \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
$(NULL)
|
||||
|
||||
@@ -7,7 +7,7 @@ This example application exposes OpenThread configuration and management APIs vi
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
$ make -f examples/Makefile-posix
|
||||
$ make -f examples/Makefile-simulation
|
||||
```
|
||||
|
||||
## 2. Start node 1
|
||||
@@ -27,9 +27,9 @@ Done
|
||||
> dataset
|
||||
Active Timestamp: 1
|
||||
Channel: 13
|
||||
Channel Mask: 07fff800
|
||||
Channel Mask: 0x07fff800
|
||||
Ext PAN ID: d63e8e3e495ebbc3
|
||||
Mesh Local Prefix: fd3d:b50b:f96d:722d/64
|
||||
Mesh Local Prefix: fd3d:b50b:f96d:722d::/64
|
||||
Master Key: dfd34f0f05cad978ec4e32b0413038ff
|
||||
Network Name: OpenThread-8f28
|
||||
PAN ID: 0x8f28
|
||||
|
||||
@@ -36,8 +36,9 @@
|
||||
#include <openthread/platform/logging.h>
|
||||
|
||||
#include "openthread-system.h"
|
||||
#include "cli/cli_config.h"
|
||||
|
||||
#if OPENTHREAD_EXAMPLES_POSIX
|
||||
#if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
#include <setjmp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -46,6 +47,10 @@ jmp_buf gResetJump;
|
||||
void __gcov_flush();
|
||||
#endif
|
||||
|
||||
#ifndef OPENTHREAD_ENABLE_COVERAGE
|
||||
#define OPENTHREAD_ENABLE_COVERAGE 0
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
@@ -67,7 +72,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
otInstance *instance;
|
||||
|
||||
#if OPENTHREAD_EXAMPLES_POSIX
|
||||
#if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
if (setjmp(gResetJump))
|
||||
{
|
||||
alarm(0);
|
||||
@@ -102,7 +107,9 @@ pseudo_reset:
|
||||
#endif
|
||||
assert(instance);
|
||||
|
||||
#if OPENTHREAD_CONFIG_CLI_TRANSPORT == OT_CLI_TRANSPORT_UART
|
||||
otCliUartInit(instance);
|
||||
#endif
|
||||
|
||||
while (!otSysPseudoResetWasRequested())
|
||||
{
|
||||
|
||||
Executable → Regular
+11
-44
@@ -1,4 +1,3 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
@@ -27,48 +26,16 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set -e -x -o pipefail
|
||||
set(COMMON_INCLUDES
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
${PROJECT_SOURCE_DIR}/examples/platforms
|
||||
${PROJECT_SOURCE_DIR}/src/core
|
||||
)
|
||||
|
||||
setup_python()
|
||||
{
|
||||
python -m pip install flake8
|
||||
}
|
||||
if(OT_APP_NCP)
|
||||
include(ncp.cmake)
|
||||
endif()
|
||||
|
||||
check_python()
|
||||
{
|
||||
flake8 --config=script/pystyle.cfg tests tools
|
||||
}
|
||||
|
||||
check_clang()
|
||||
{
|
||||
clang-format --version
|
||||
./bootstrap
|
||||
./configure
|
||||
make pretty-check
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
case $1 in
|
||||
setup)
|
||||
setup_python
|
||||
;;
|
||||
python)
|
||||
check_python
|
||||
;;
|
||||
clang)
|
||||
check_cpp
|
||||
;;
|
||||
'')
|
||||
setup_python
|
||||
check_python
|
||||
check_clang
|
||||
;;
|
||||
*)
|
||||
echo "USAGE: $0 [setup|python|clang]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
if(OT_APP_RCP)
|
||||
include(rcp.cmake)
|
||||
endif()
|
||||
@@ -54,6 +54,9 @@ SOURCES_COMMON += \
|
||||
LDADD_MBEDTLS = \
|
||||
$(NULL)
|
||||
|
||||
LDADD_MBEDTLS_RADIO = \
|
||||
$(NULL)
|
||||
|
||||
LDADD_DIAG = \
|
||||
$(NULL)
|
||||
|
||||
@@ -61,6 +64,10 @@ if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||
LDADD_MBEDTLS += \
|
||||
$(top_builddir)/third_party/mbedtls/libmbedcrypto.a \
|
||||
$(NULL)
|
||||
|
||||
LDADD_MBEDTLS_RADIO += \
|
||||
$(top_builddir)/third_party/mbedtls/libmbedcrypto-radio.a \
|
||||
$(NULL)
|
||||
endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||
|
||||
if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
|
||||
@@ -151,8 +158,10 @@ ot_rcp_LDADD = \
|
||||
$(top_builddir)/src/ncp/libopenthread-rcp.a \
|
||||
$(top_builddir)/src/core/libopenthread-radio.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(LDADD_MBEDTLS_RADIO) \
|
||||
$(top_builddir)/src/core/libopenthread-radio.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(LDADD_MBEDTLS_RADIO) \
|
||||
$(NULL)
|
||||
|
||||
ot_rcp_LDFLAGS = \
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "openthread-system.h"
|
||||
|
||||
#if OPENTHREAD_EXAMPLES_POSIX
|
||||
#if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
#include <setjmp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -45,6 +45,10 @@ jmp_buf gResetJump;
|
||||
void __gcov_flush();
|
||||
#endif
|
||||
|
||||
#ifndef OPENTHREAD_ENABLE_COVERAGE
|
||||
#define OPENTHREAD_ENABLE_COVERAGE 0
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
@@ -66,7 +70,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
otInstance *instance;
|
||||
|
||||
#if OPENTHREAD_EXAMPLES_POSIX
|
||||
#if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
if (setjmp(gResetJump))
|
||||
{
|
||||
alarm(0);
|
||||
@@ -118,16 +122,3 @@ pseudo_reset:
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_APP)
|
||||
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, aFormat);
|
||||
otNcpPlatLogv(aLogLevel, aLogRegion, aFormat, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
add_executable(ot-ncp-ftd
|
||||
main.c
|
||||
)
|
||||
|
||||
add_executable(ot-ncp-mtd
|
||||
main.c
|
||||
)
|
||||
|
||||
target_include_directories(ot-ncp-ftd PRIVATE ${COMMON_INCLUDES})
|
||||
target_include_directories(ot-ncp-mtd PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
target_link_libraries(ot-ncp-ftd PRIVATE
|
||||
openthread-ncp-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
mbedcrypto
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(ot-ncp-mtd PRIVATE
|
||||
openthread-ncp-mtd
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-mtd
|
||||
${OT_PLATFORM_LIB}
|
||||
mbedcrypto
|
||||
ot-config
|
||||
)
|
||||
|
||||
install(TARGETS ot-ncp-ftd ot-ncp-mtd DESTINATION bin)
|
||||
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
add_executable(ot-rcp
|
||||
main.c
|
||||
)
|
||||
|
||||
target_include_directories(ot-rcp PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
target_link_libraries(ot-rcp PRIVATE
|
||||
openthread-rcp
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-radio
|
||||
${OT_PLATFORM_LIB}
|
||||
ot-config
|
||||
)
|
||||
|
||||
install(TARGETS ot-rcp DESTINATION bin)
|
||||
@@ -28,22 +28,28 @@
|
||||
|
||||
# OpenThread Features (Makefile default configuration).
|
||||
|
||||
BACKBONE_ROUTER ?= 0
|
||||
BIG_ENDIAN ?= 0
|
||||
BORDER_AGENT ?= 0
|
||||
BORDER_ROUTER ?= 0
|
||||
COAP ?= 0
|
||||
COAP_OBSERVE ?= 0
|
||||
COAPS ?= 0
|
||||
COMMISSIONER ?= 0
|
||||
COVERAGE ?= 0
|
||||
CHANNEL_MANAGER ?= 0
|
||||
CHANNEL_MONITOR ?= 0
|
||||
CHILD_SUPERVISION ?= 0
|
||||
CLI_TRANSPORT ?= UART
|
||||
DEBUG ?= 0
|
||||
DHCP6_CLIENT ?= 0
|
||||
DHCP6_SERVER ?= 0
|
||||
DIAGNOSTIC ?= 0
|
||||
DISABLE_DOC ?= 0
|
||||
DISABLE_TOOLS ?= 0
|
||||
DNS_CLIENT ?= 0
|
||||
DUA ?= 0
|
||||
DYNAMIC_LOG_LEVEL ?= 0
|
||||
ECDSA ?= 0
|
||||
EXTERNAL_HEAP ?= 0
|
||||
IP6_FRAGM ?= 0
|
||||
@@ -55,7 +61,11 @@ LOG_OUTPUT ?= APP
|
||||
endif
|
||||
LINK_RAW ?= 0
|
||||
MAC_FILTER ?= 0
|
||||
MLE_LONG_ROUTES ?= 0
|
||||
MLR ?= 0
|
||||
MTD_NETDIAG ?= 0
|
||||
MULTIPLE_INSTANCE ?= 0
|
||||
OTNS ?= 0
|
||||
PLATFORM_UDP ?= 0
|
||||
REFERENCE_DEVICE ?= 0
|
||||
SERVICE ?= 0
|
||||
@@ -63,10 +73,15 @@ SETTINGS_RAM ?= 0
|
||||
# SLAAC is enabled by default
|
||||
SLAAC ?= 1
|
||||
SNTP_CLIENT ?= 0
|
||||
THREAD_VERSION ?= 1.1
|
||||
TIME_SYNC ?= 0
|
||||
UDP_FORWARD ?= 0
|
||||
|
||||
|
||||
ifeq ($(BACKBONE_ROUTER),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_ENDIAN),1)
|
||||
COMMONCFLAGS += -DBYTE_ORDER_BIG_ENDIAN=1
|
||||
endif
|
||||
@@ -87,6 +102,10 @@ ifeq ($(COAPS),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(COAP_OBSERVE),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(COMMISSIONER),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1
|
||||
endif
|
||||
@@ -107,6 +126,14 @@ ifeq ($(CHILD_SUPERVISION),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1
|
||||
endif
|
||||
|
||||
ifneq ($(CLI_TRANSPORT),)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_$(CLI_TRANSPORT)
|
||||
endif
|
||||
|
||||
ifeq ($(CSL_RECEIVER),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
configure_OPTIONS += --enable-debug --disable-optimization
|
||||
endif
|
||||
@@ -127,10 +154,22 @@ ifeq ($(DISABLE_DOC),1)
|
||||
configure_OPTIONS += --disable-docs
|
||||
endif
|
||||
|
||||
ifeq ($(DISABLE_TOOLS),1)
|
||||
configure_OPTIONS += --disable-tools
|
||||
endif
|
||||
|
||||
ifeq ($(DNS_CLIENT),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(DUA),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_DUA_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(DYNAMIC_LOG_LEVEL),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(ECDSA),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_ECDSA_ENABLE=1
|
||||
endif
|
||||
@@ -167,10 +206,23 @@ ifeq ($(MAC_FILTER),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1
|
||||
endif
|
||||
|
||||
# Enable MLE long routes extension (experimental, breaks Thread conformance)
|
||||
ifeq ($(MLE_LONG_ROUTES),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(MLR),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_MLR_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(MTD_NETDIAG),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(MULTIPLE_INSTANCE),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM_UDP),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1
|
||||
endif
|
||||
@@ -192,8 +244,14 @@ ifeq ($(SNTP_CLIENT),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(THREAD_VERSION),1.1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_THREAD_VERSION=2
|
||||
else ifeq ($(THREAD_VERSION),1.2)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_THREAD_VERSION=3
|
||||
endif
|
||||
|
||||
ifeq ($(TIME_SYNC),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 -DOPENTHREAD_MAC_CONFIG_HEADER_IE_SUPPORT=1
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 -DOPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT=1
|
||||
endif
|
||||
|
||||
ifeq ($(UDP_FORWARD),1)
|
||||
@@ -204,6 +262,10 @@ ifeq ($(DISABLE_BUILTIN_MBEDTLS),1)
|
||||
configure_OPTIONS += --disable-builtin-mbedtls
|
||||
endif
|
||||
|
||||
ifneq ($(BUILTIN_MBEDTLS_MANAGEMENT),)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=$(BUILTIN_MBEDTLS_MANAGEMENT)
|
||||
endif
|
||||
|
||||
ifeq ($(DISABLE_EXECUTABLE),1)
|
||||
configure_OPTIONS += --enable-executable=no
|
||||
endif
|
||||
@@ -222,18 +284,30 @@ ifeq ($(SETTINGS_RAM),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_SETTINGS_RAM=1
|
||||
endif
|
||||
|
||||
ifeq ($(OTNS),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_OTNS_ENABLE=1
|
||||
endif
|
||||
|
||||
ifneq ($(SPINEL_ENCRYPTER_LIBS),)
|
||||
configure_OPTIONS += --with-ncp-spinel-encrypter-libs=$(SPINEL_ENCRYPTER_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(FULL_LOGS),1)
|
||||
# HINT: Add more here, or comment out ones you do not need/want
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_API=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_ARP=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_BBR=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_CLI=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_COAP=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_DUA=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_ICMP=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_IP6=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MAC=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MEM=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MESHCOP=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MLE=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MLR=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_NETDATA=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_NETDIAG=1
|
||||
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_PKT_DUMP=1
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
add_subdirectory(utils)
|
||||
@@ -35,12 +35,15 @@ DIST_SUBDIRS = \
|
||||
cc2538 \
|
||||
cc2650 \
|
||||
cc2652 \
|
||||
efr32mg1 \
|
||||
efr32mg12 \
|
||||
efr32mg13 \
|
||||
efr32mg21 \
|
||||
gp712 \
|
||||
k32w \
|
||||
kw41z \
|
||||
nrf528xx \
|
||||
posix \
|
||||
simulation \
|
||||
qpg6095 \
|
||||
samr21 \
|
||||
utils \
|
||||
@@ -52,51 +55,63 @@ SUBDIRS = \
|
||||
utils \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_EXAMPLES_CC1352
|
||||
if OPENTHREAD_PLATFORM_CC1352
|
||||
SUBDIRS += cc1352
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_CC2538
|
||||
if OPENTHREAD_PLATFORM_CC2538
|
||||
SUBDIRS += cc2538
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_CC2650
|
||||
if OPENTHREAD_PLATFORM_CC2650
|
||||
SUBDIRS += cc2650
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_CC2652
|
||||
if OPENTHREAD_PLATFORM_CC2652
|
||||
SUBDIRS += cc2652
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG12
|
||||
if OPENTHREAD_PLATFORM_EFR32MG1
|
||||
SUBDIRS += efr32mg1
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_EFR32MG12
|
||||
SUBDIRS += efr32mg12
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG21
|
||||
if OPENTHREAD_PLATFORM_EFR32MG13
|
||||
SUBDIRS += efr32mg13
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_EFR32MG21
|
||||
SUBDIRS += efr32mg21
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_GP712
|
||||
if OPENTHREAD_PLATFORM_GP712
|
||||
SUBDIRS += gp712
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_KW41Z
|
||||
if OPENTHREAD_PLATFORM_K32W
|
||||
SUBDIRS += k32w
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_KW41Z
|
||||
SUBDIRS += kw41z
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_NRF528XX
|
||||
if OPENTHREAD_PLATFORM_NRF528XX
|
||||
SUBDIRS += nrf528xx
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_POSIX
|
||||
SUBDIRS += posix
|
||||
if OPENTHREAD_PLATFORM_SIMULATION
|
||||
SUBDIRS += simulation
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_QPG6095
|
||||
if OPENTHREAD_PLATFORM_QPG6095
|
||||
SUBDIRS += qpg6095
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_SAMR21
|
||||
if OPENTHREAD_PLATFORM_SAMR21
|
||||
SUBDIRS += samr21
|
||||
endif
|
||||
|
||||
@@ -104,22 +119,4 @@ noinst_HEADERS = \
|
||||
openthread-system.h \
|
||||
$(NULL)
|
||||
|
||||
# Always pretty (e.g. for 'make pretty') these subdirectories.
|
||||
|
||||
PRETTY_SUBDIRS = \
|
||||
cc1352 \
|
||||
cc2538 \
|
||||
cc2650 \
|
||||
cc2652 \
|
||||
efr32mg12 \
|
||||
efr32mg21 \
|
||||
gp712 \
|
||||
kw41z \
|
||||
nrf528xx \
|
||||
posix \
|
||||
qpg6095 \
|
||||
samr21 \
|
||||
utils \
|
||||
$(NULL)
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
|
||||
@@ -57,10 +57,18 @@ if OPENTHREAD_EXAMPLES_CC2652
|
||||
include $(top_srcdir)/examples/platforms/cc2652/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG1
|
||||
include $(top_srcdir)/examples/platforms/efr32mg1/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG12
|
||||
include $(top_srcdir)/examples/platforms/efr32mg12/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG13
|
||||
include $(top_srcdir)/examples/platforms/efr32mg13/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG21
|
||||
include $(top_srcdir)/examples/platforms/efr32mg21/Makefile.platform.am
|
||||
endif
|
||||
@@ -69,6 +77,14 @@ if OPENTHREAD_EXAMPLES_GP712
|
||||
include $(top_srcdir)/examples/platforms/gp712/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_JN5189
|
||||
include $(top_srcdir)/examples/platforms/k32w/jn5189/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_K32W061
|
||||
include $(top_srcdir)/examples/platforms/k32w/k32w061/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_KW41Z
|
||||
include $(top_srcdir)/examples/platforms/kw41z/Makefile.platform.am
|
||||
endif
|
||||
@@ -77,6 +93,10 @@ if OPENTHREAD_EXAMPLES_NRF52811
|
||||
include $(top_srcdir)/examples/platforms/nrf528xx/nrf52811/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_NRF52833
|
||||
include $(top_srcdir)/examples/platforms/nrf528xx/nrf52833/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_NRF52840
|
||||
include $(top_srcdir)/examples/platforms/nrf528xx/nrf52840/Makefile.platform.am
|
||||
endif
|
||||
@@ -89,6 +109,6 @@ if OPENTHREAD_EXAMPLES_SAMR21
|
||||
include $(top_srcdir)/examples/platforms/samr21/Makefile.platform.am
|
||||
endif # OPENTHREAD_EXAMPLES_SAMR21
|
||||
|
||||
if OPENTHREAD_EXAMPLES_POSIX
|
||||
include $(top_srcdir)/examples/platforms/posix/Makefile.platform.am
|
||||
if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
include $(top_srcdir)/examples/platforms/simulation/Makefile.platform.am
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(OT_PLATFORM_LIB "openthread-cc1352" PARENT_SCOPE)
|
||||
|
||||
if(NOT OT_CONFIG)
|
||||
set(OT_CONFIG "openthread-core-cc1352-config.h")
|
||||
set(OT_CONFIG ${OT_CONFIG} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES
|
||||
"OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\"openthread-core-cc1352-config-check.h\""
|
||||
)
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
target_compile_definitions(ot-config INTERFACE "MBEDTLS_USER_CONFIG_FILE=\"cc1352-mbedtls-config.h\"")
|
||||
|
||||
list(APPEND OT_PUBLIC_INCLUDES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/crypto"
|
||||
"${PROJECT_SOURCE_DIR}/third_party/ti/devices/cc13x2_cc26x2"
|
||||
)
|
||||
set(OT_PUBLIC_INCLUDES ${OT_PUBLIC_INCLUDES} PARENT_SCOPE)
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"")
|
||||
|
||||
add_library(openthread-cc1352
|
||||
alarm.c
|
||||
diag.c
|
||||
entropy.c
|
||||
flash.c
|
||||
logging.c
|
||||
misc.c
|
||||
radio.c
|
||||
system.c
|
||||
uart.c
|
||||
crypto/aes_alt.c
|
||||
cc1352_ccfg.c
|
||||
cc1352_startup.c
|
||||
cxx_helpers.c
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
openthread-cc1352
|
||||
PROPERTIES
|
||||
C_STANDARD 99
|
||||
CXX_STANDARD 11
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-cc1352
|
||||
PUBLIC
|
||||
cc13x2-cc26x2-driver
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_options(openthread-cc1352
|
||||
PUBLIC
|
||||
-Wl,--gc-sections
|
||||
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-cc1352
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-cc1352 PRIVATE ${OT_CFLAGS})
|
||||
|
||||
target_include_directories(openthread-cc1352
|
||||
PRIVATE
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
${PROJECT_SOURCE_DIR}/src/core
|
||||
${PROJECT_SOURCE_DIR}/examples/platforms
|
||||
)
|
||||
@@ -28,11 +28,11 @@
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
|
||||
lib_LIBRARIES = libopenthread-cc1352.a
|
||||
# Do not enable -Wcast-align for this platform
|
||||
override CFLAGS := $(filter-out -Wcast-align,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wcast-align,$(CXXFLAGS))
|
||||
|
||||
# Do not enable -pedantic-errors for cc13xx driverlib
|
||||
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
|
||||
lib_LIBRARIES = libopenthread-cc1352.a
|
||||
|
||||
libopenthread_cc1352_a_CPPFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
@@ -73,10 +73,6 @@ libopenthread_cc1352_a_DEPENDENCIES
|
||||
$(top_srcdir)/third_party/ti/devices/cc13x2_cc26x2/driverlib/bin/gcc/driverlib.a \
|
||||
$(NULL)
|
||||
|
||||
PRETTY_FILES = \
|
||||
$(PLATFORM_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
Dash = -
|
||||
libopenthread_cc1352_a_LIBADD = \
|
||||
$(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o")
|
||||
|
||||
@@ -1,34 +1,24 @@
|
||||
# OpenThread on CC1352 Example
|
||||
|
||||
This directory contains example platform drivers for the [Texas Instruments
|
||||
CC1352R1][cc1352r1].
|
||||
This directory contains example platform drivers for the [Texas Instruments CC1352R1][cc1352r1].
|
||||
|
||||
The example platform drivers are intended to present the minimal code necessary
|
||||
to support OpenThread. As a result, the example platform drivers do not
|
||||
necessarily highlight the platform's full capabilities. Consult the [SimpleLink
|
||||
CC26X2R1 SDK][cc26x2r1-sdk] for more development option. The platform drivers
|
||||
were built for the [CC1352R1 LAUNCHXL][cc1352r1-launchxl], usage on other
|
||||
boards with a cc1352r1 may require changes to the peripheral drivers.
|
||||
The example platform drivers are intended to present the minimal code necessary to support OpenThread. As a result, the example platform drivers do not necessarily highlight the platform's full capabilities. Consult the [SimpleLink CC26X2R1 SDK][cc26x2r1-sdk] for more development option. The platform drivers were built for the [CC1352R1 LAUNCHXL][cc1352r1-launchxl], usage on other boards with a cc1352r1 may require changes to the peripheral drivers.
|
||||
|
||||
[cc1352r1-launchxl]: http://www.ti.com/tool/launchxl-cc26x2r1
|
||||
[cc26x2r1-sdk]: http://www.ti.com/tool/simplelink-cc26x2-sdk
|
||||
|
||||
<!---
|
||||
TODO: Update link when cc1352 product page is live
|
||||
[cc1352r1]: http://www.ti.com/product/cc1352r1
|
||||
-->
|
||||
|
||||
[cc1352r1]: http://www.ti.com/tool/launchxl-cc26x2r1
|
||||
|
||||
## Toolchain
|
||||
|
||||
Building the examples for the cc1352 requires [GNU AutoConf][gnu-autoconf],
|
||||
[GNU AutoMake][gnu-automake], [Python][python], and the [ARM gcc
|
||||
toolchain][arm-toolchain].
|
||||
Building the examples for the cc1352 requires [GNU AutoConf][gnu-autoconf], [GNU AutoMake][gnu-automake], [Python][python], and the [ARM gcc toolchain][arm-toolchain].
|
||||
|
||||
With the exception of the arm toolchain, most of these tools are installed by
|
||||
default on modern Posix systems. It is recommended to setup a Linux virtual
|
||||
machine for building on a Windows host system. For help setting up VirtualBox
|
||||
with Ubuntu, consult this [community help wiki
|
||||
article][ubuntu-wiki-virtualbox].
|
||||
With the exception of the arm toolchain, most of these tools are installed by default on modern Posix systems. It is recommended to setup a Linux virtual machine for building on a Windows host system. For help setting up VirtualBox with Ubuntu, consult this [community help wiki article][ubuntu-wiki-virtualbox].
|
||||
|
||||
[gnu-autoconf]: https://www.gnu.org/software/autoconf
|
||||
[gnu-automake]: https://www.gnu.org/software/automake
|
||||
@@ -38,8 +28,7 @@ article][ubuntu-wiki-virtualbox].
|
||||
[mingw]: http://www.mingw.org
|
||||
[ubuntu-wiki-virtualbox]: https://help.ubuntu.com/community/VirtualBox
|
||||
|
||||
In a Bash terminal, follow these instructions to install the GNU toolchain and
|
||||
other dependencies.
|
||||
In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
@@ -58,11 +47,9 @@ $ make -f examples/Makefile-cc1352
|
||||
|
||||
## Flash Binaries
|
||||
|
||||
If the build completed successfully, the `elf` files may be found in
|
||||
`<path-to-openthread>/output/cc1352/bin`.
|
||||
If the build completed successfully, the `elf` files may be found in `<path-to-openthread>/output/cc1352/bin`.
|
||||
|
||||
Flash the images with [Uniflash][uniflash]. Make sure to deselect the binary
|
||||
check-box, Uniflash assumes a file without an extension is a binary file.
|
||||
Flash the images with [Uniflash][uniflash]. Make sure to deselect the binary check-box, Uniflash assumes a file without an extension is a binary file.
|
||||
|
||||
[uniflash]: http://www.ti.com/tool/uniflash
|
||||
|
||||
@@ -70,15 +57,13 @@ check-box, Uniflash assumes a file without an extension is a binary file.
|
||||
|
||||
### CLI example
|
||||
|
||||
1. With a terminal client (PuTTY, minicom, etc.) open the com port associated
|
||||
with the cc1352 UART. The serial port settings are:
|
||||
* 115200 baud
|
||||
* 8 data bits
|
||||
* no parity bit
|
||||
* 1 stop bit
|
||||
1. With a terminal client (PuTTY, minicom, etc.) open the com port associated with the cc1352 UART. The serial port settings are:
|
||||
- 115200 baud
|
||||
- 8 data bits
|
||||
- no parity bit
|
||||
- 1 stop bit
|
||||
2. Type `help` for a list of commands.
|
||||
3. Follow the instructions in the [CLI README][cli-readme] for instructions on
|
||||
setting up a network.
|
||||
3. Follow the instructions in the [CLI README][cli-readme] for instructions on setting up a network.
|
||||
|
||||
[cli-readme]: ../../../src/cli/README.md
|
||||
|
||||
@@ -114,7 +99,6 @@ whitelist
|
||||
|
||||
### NCP example
|
||||
|
||||
Refer to the documentation in the [wpantund][wpantund] project for build
|
||||
instructions and usage information.
|
||||
Refer to the documentation in the [wpantund][wpantund] project for build instructions and usage information.
|
||||
|
||||
[wpantund]: https://github.com/openthread/wpantund
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM)
|
||||
|
||||
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
|
||||
set(CMAKE_RANLIB arm-none-eabi-ranlib)
|
||||
|
||||
set(COMMON_C_FLAGS "-mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -fdata-sections -ffunction-sections")
|
||||
|
||||
set(CMAKE_C_FLAGS "${COMMON_C_FLAGS} -std=gnu99")
|
||||
set(CMAKE_CXX_FLAGS "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
|
||||
set(CMAKE_ASM_FLAGS "${COMMON_C_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -nostartfiles -specs=nano.specs -specs=nosys.specs")
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_ASM_FLAGS_DEBUG "-g")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_ASM_FLAGS_RELEASE "")
|
||||
@@ -71,8 +71,7 @@ void mbedtls_aes_free(mbedtls_aes_context *ctx);
|
||||
* @retval 0 If successful
|
||||
* @retval MBEDTLS_ERR_AES_INVALID_KEY_LENGTH If keybits was not 128
|
||||
*/
|
||||
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||
unsigned int keybits);
|
||||
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits);
|
||||
|
||||
/**
|
||||
* @brief AES key schedule (decryption)
|
||||
@@ -84,8 +83,7 @@ int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||
* @retval 0 If successful
|
||||
* @retval MBEDTLS_ERR_AES_INVALID_KEY_LENGTH If keybits was not 128
|
||||
*/
|
||||
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||
unsigned int keybits);
|
||||
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits);
|
||||
|
||||
/**
|
||||
* \brief AES-ECB block encryption/decryption
|
||||
@@ -99,8 +97,7 @@ int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||
* @retval 0 If successful
|
||||
* @retval AES_KEYSTORE_READ_ERROR If the indicated keystore ram could not be read
|
||||
*/
|
||||
int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx, int mode, const unsigned char input[16],
|
||||
unsigned char output[16]);
|
||||
int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx, int mode, const unsigned char input[16], unsigned char output[16]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -46,17 +46,6 @@
|
||||
*/
|
||||
static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
// Add more platform specific diagnostics features here.
|
||||
if (argc > 1)
|
||||
{
|
||||
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||
}
|
||||
}
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
{
|
||||
sDiagMode = aMode;
|
||||
|
||||
@@ -28,43 +28,21 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <openthread/instance.h>
|
||||
|
||||
#include <driverlib/aon_batmon.h>
|
||||
#include <driverlib/flash.h>
|
||||
#include <driverlib/interrupt.h>
|
||||
#include <driverlib/vims.h>
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
|
||||
#include <utils/code_utils.h>
|
||||
|
||||
#include "platform-cc1352.h"
|
||||
|
||||
/*
|
||||
* The settings configuration base address *MUST* be defined in the core config
|
||||
* file. The base address *MUST* be aligned on an 8K page boundary or the flash
|
||||
* program calls will fail.
|
||||
*/
|
||||
#ifndef SETTINGS_CONFIG_BASE_ADDRESS
|
||||
#error "SETTINGS_CONFIG_BASE_ADDRESS not defined in the OpenThread Core Config"
|
||||
#endif /* SETTINGS_CONFIG_BASE_ADDRESS */
|
||||
|
||||
/*
|
||||
* The settings configuration page size *MUST* be defined in the core config
|
||||
* file. The page size *MUST* be 8K or the flash program calls will fail.
|
||||
*/
|
||||
#if (SETTINGS_CONFIG_PAGE_SIZE != 0x2000)
|
||||
#error "SETTINGS_CONFIG_PAGE_SIZE must be defined in OpenThread Core Config"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The settings configuration page number _SHOULD_ be defined in the core
|
||||
* config file.
|
||||
*/
|
||||
#ifndef SETTINGS_CONFIG_PAGE_NUM
|
||||
#warn "SETTINGS_CONFIG_PAGE_NUM not defined in the OpenThread Core Config"
|
||||
#endif /* SETTINGS_CONFIG_PAGE_NUM */
|
||||
#define FLASH_BASE_ADDRESS 0x52000
|
||||
#define FLASH_PAGE_SIZE 0x2000
|
||||
#define FLASH_PAGE_NUM 2 /* must be a multiple of 2 */
|
||||
#define FLASH_SWAP_SIZE (FLASH_PAGE_SIZE * (FLASH_PAGE_NUM / 2))
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -158,117 +136,87 @@ static void restoreFlashCache(uint32_t mode)
|
||||
VIMSLineBufEnable(VIMS_BASE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate the errors from the Flash programming FSM to OpenThread error
|
||||
* codes.
|
||||
*
|
||||
* @param [in] error Return from the Flash programming function.
|
||||
*
|
||||
* @return The corresponding OpenThread @ref otError value.
|
||||
*/
|
||||
static otError fsmErrorToOtError(uint32_t error)
|
||||
static uint32_t mapAddress(uint8_t aSwapIndex, uint32_t aOffset)
|
||||
{
|
||||
otError ret = OT_ERROR_GENERIC;
|
||||
uint32_t address = FLASH_BASE_ADDRESS + aOffset;
|
||||
|
||||
switch (error)
|
||||
if (aSwapIndex)
|
||||
{
|
||||
case FAPI_STATUS_SUCCESS:
|
||||
ret = OT_ERROR_NONE;
|
||||
break;
|
||||
|
||||
case FAPI_STATUS_INCORRECT_DATABUFFER_LENGTH:
|
||||
ret = OT_ERROR_INVALID_ARGS;
|
||||
break;
|
||||
|
||||
case FAPI_STATUS_FSM_ERROR:
|
||||
ret = OT_ERROR_FAILED;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
address += FLASH_SWAP_SIZE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platforms/utils/flash.h
|
||||
*/
|
||||
otError utilsFlashInit(void)
|
||||
void otPlatFlashInit(otInstance *aInstance)
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platforms/utils/flash.h
|
||||
*/
|
||||
uint32_t utilsFlashGetSize(void)
|
||||
uint32_t otPlatFlashGetSwapSize(otInstance *aInstance)
|
||||
{
|
||||
return FlashSizeGet();
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return FLASH_SWAP_SIZE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platforms/utils/flash.h
|
||||
*/
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
void otPlatFlashErase(otInstance *aInstance, uint8_t aSwapIndex)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
uint32_t mode;
|
||||
uint32_t fsmRet;
|
||||
otError ret;
|
||||
|
||||
otEXPECT_ACTION(checkVoltage(), ret = OT_ERROR_FAILED);
|
||||
|
||||
mode = disableFlashCache();
|
||||
|
||||
fsmRet = FlashSectorErase(aAddress);
|
||||
|
||||
restoreFlashCache(mode);
|
||||
|
||||
ret = fsmErrorToOtError(fsmRet);
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platforms/utils/flash.h
|
||||
*/
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
uint32_t start = otPlatAlarmMilliGetNow();
|
||||
otError ret = OT_ERROR_BUSY;
|
||||
|
||||
while ((otPlatAlarmMilliGetNow() - start) < aTimeout)
|
||||
{
|
||||
if (FlashCheckFsmForReady() == FAPI_STATUS_FSM_READY)
|
||||
{
|
||||
ret = OT_ERROR_NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platforms/utils/flash.h
|
||||
*/
|
||||
uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
{
|
||||
uint32_t mode;
|
||||
uint32_t written = 0;
|
||||
|
||||
otEXPECT(checkVoltage());
|
||||
|
||||
mode = disableFlashCache();
|
||||
|
||||
for (uint8_t page = 0; page < FLASH_PAGE_NUM; page++)
|
||||
{
|
||||
FlashSectorErase(mapAddress(aSwapIndex, (page * FLASH_PAGE_SIZE)));
|
||||
}
|
||||
|
||||
restoreFlashCache(mode);
|
||||
|
||||
while (FlashCheckFsmForReady() != FAPI_STATUS_FSM_READY)
|
||||
{
|
||||
}
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platforms/utils/flash.h
|
||||
*/
|
||||
void otPlatFlashWrite(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffset, const void *aData, uint32_t aSize)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
uint32_t mode;
|
||||
uint32_t written = 0;
|
||||
uint32_t address;
|
||||
|
||||
otEXPECT(checkVoltage());
|
||||
|
||||
mode = disableFlashCache();
|
||||
|
||||
address = mapAddress(aSwapIndex, aOffset);
|
||||
|
||||
while (written < aSize)
|
||||
{
|
||||
uint32_t toWrite = aSize - written;
|
||||
uint8_t *data = aData + written;
|
||||
uint32_t address = aAddress + written;
|
||||
uint32_t fsmRet;
|
||||
bool interruptsWereDisabled;
|
||||
uint32_t toWrite = aSize - written;
|
||||
const uint8_t *data = (uint8_t *)aData + written;
|
||||
uint32_t fsmRet;
|
||||
bool interruptsWereDisabled;
|
||||
|
||||
if (toWrite > MAX_WRITE_INCREMENT)
|
||||
{
|
||||
@@ -281,7 +229,7 @@ uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
*/
|
||||
interruptsWereDisabled = IntMasterDisable();
|
||||
|
||||
fsmRet = FlashProgram(data, address, toWrite);
|
||||
fsmRet = FlashProgram((uint8_t *)data, address + written, toWrite);
|
||||
|
||||
if (!interruptsWereDisabled)
|
||||
{
|
||||
@@ -299,15 +247,15 @@ uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
restoreFlashCache(mode);
|
||||
|
||||
exit:
|
||||
return written;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platforms/utils/flash.h
|
||||
*/
|
||||
uint32_t utilsFlashRead(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
void otPlatFlashRead(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffset, void *aData, uint32_t aSize)
|
||||
{
|
||||
memcpy(aData, (void *)aAddress, (size_t)aSize);
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return aSize;
|
||||
memcpy(aData, (void *)mapAddress(aSwapIndex, aOffset), (size_t)aSize);
|
||||
}
|
||||
|
||||
@@ -36,8 +36,7 @@
|
||||
#include <openthread/platform/logging.h>
|
||||
#include <openthread/platform/toolchain.h>
|
||||
|
||||
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) || \
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
|
||||
@@ -38,27 +38,14 @@
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_INFO "CC1352"
|
||||
|
||||
/**
|
||||
* @def SETTINGS_CONFIG_BASE_ADDRESS
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||
*
|
||||
* Define to 1 to enable otPlatFlash* APIs to support non-volatile storage.
|
||||
*
|
||||
* When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs.
|
||||
*
|
||||
* The base address of the pages to be used for non-volatile-settings storage.
|
||||
*/
|
||||
#define SETTINGS_CONFIG_BASE_ADDRESS (0x52000)
|
||||
|
||||
/**
|
||||
* @def SETTINGS_CONFIG_PAGE_SIZE
|
||||
*
|
||||
* The size in bytes of a page for the cc26x2 platform.
|
||||
*
|
||||
* @note *MUST BE* 8K.
|
||||
*/
|
||||
#define SETTINGS_CONFIG_PAGE_SIZE (0x2000)
|
||||
|
||||
/**
|
||||
* @def SETTINGS_CONFIG_PAGE_NUM
|
||||
*
|
||||
* The number of flash pages to use for non-volatile settings storage.
|
||||
*/
|
||||
#define SETTINGS_CONFIG_PAGE_NUM (2)
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NCP_UART_ENABLE
|
||||
|
||||
@@ -32,10 +32,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
#include <openthread/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <utils/code_utils.h>
|
||||
#include <utils/encoding.h>
|
||||
#include <openthread/random_noncrypto.h> /* to seed the CSMA-CA funciton */
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
#include <openthread/platform/diag.h>
|
||||
@@ -456,7 +458,7 @@ static uint_fast8_t rfCoreModifySourceMatchEntry(uint8_t aEntryNo, cc1352_addres
|
||||
* @return The index where the address was found.
|
||||
* @retval CC1352_SRC_MATCH_NONE The address was not found.
|
||||
*/
|
||||
static uint8_t rfCoreFindShortSrcMatchIdx(const uint16_t aAddress)
|
||||
static uint8_t rfCoreFindShortSrcMatchIdx(uint16_t aAddress)
|
||||
{
|
||||
uint8_t i;
|
||||
uint8_t ret = CC1352_SRC_MATCH_NONE;
|
||||
@@ -1507,7 +1509,7 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, uint16_t aShortAddress)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
@@ -1541,7 +1543,7 @@ exit:
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, uint16_t aShortAddress)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
@@ -1575,14 +1577,15 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress);
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint64_t extAddress = otEncodingReadUint64Le(aExtAddress->m8);
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx(&extAddress);
|
||||
|
||||
if (idx == CC1352_SRC_MATCH_NONE)
|
||||
{
|
||||
/* the entry does not exist already, add it */
|
||||
otEXPECT_ACTION((idx = rfCoreFindEmptyExtSrcMatchIdx()) != CC1352_SRC_MATCH_NONE, error = OT_ERROR_NO_BUFS);
|
||||
sSrcMatchExtData.extAddrEnt[idx] = *((uint64_t *)aExtAddress);
|
||||
sSrcMatchExtData.extAddrEnt[idx] = extAddress;
|
||||
}
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
@@ -1608,10 +1611,11 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint8_t idx;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint64_t extAddress = otEncodingReadUint64Le(aExtAddress->m8);
|
||||
uint8_t idx;
|
||||
|
||||
otEXPECT_ACTION((idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress)) != CC1352_SRC_MATCH_NONE,
|
||||
otEXPECT_ACTION((idx = rfCoreFindExtSrcMatchIdx(&extAddress)) != CC1352_SRC_MATCH_NONE,
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
@@ -1809,7 +1813,7 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aA
|
||||
if (sState == cc1352_stateReceive)
|
||||
{
|
||||
otEXPECT(rfCoreExecuteAbortCmd() == CMDSTA_Done);
|
||||
sReceiveCmd.localExtAddr = *((uint64_t *)(aAddress));
|
||||
sReceiveCmd.localExtAddr = otEncodingReadUint64Le(aAddress->m8);
|
||||
otEXPECT(rfCoreClearReceiveQueue(&sRxDataQueue) == CMDSTA_Done);
|
||||
otEXPECT(rfCoreSendReceiveCmd() == CMDSTA_Done);
|
||||
/* the interrupt from abort changed our state to sleep */
|
||||
@@ -1817,7 +1821,7 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aA
|
||||
}
|
||||
else if (sState != cc1352_stateTransmit)
|
||||
{
|
||||
sReceiveCmd.localExtAddr = *((uint64_t *)(aAddress));
|
||||
sReceiveCmd.localExtAddr = otEncodingReadUint64Le(aAddress->m8);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(OT_PLATFORM_LIB "openthread-cc2538" PARENT_SCOPE)
|
||||
|
||||
if(NOT OT_CONFIG)
|
||||
set(OT_CONFIG "openthread-core-cc2538-config.h")
|
||||
set(OT_CONFIG ${OT_CONFIG} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES
|
||||
"OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\"openthread-core-cc2538-config-check.h\""
|
||||
"OPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
|
||||
)
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"")
|
||||
|
||||
add_library(openthread-cc2538
|
||||
alarm.c
|
||||
diag.c
|
||||
entropy.c
|
||||
flash.c
|
||||
misc.c
|
||||
radio.c
|
||||
startup-gcc.c
|
||||
system.c
|
||||
logging.c
|
||||
uart.c
|
||||
$<TARGET_OBJECTS:openthread-platform-utils>
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
openthread-cc2538
|
||||
PROPERTIES
|
||||
C_STANDARD 99
|
||||
CXX_STANDARD 11
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-cc2538 PRIVATE openthread-platform-utils ot-config)
|
||||
target_link_options(openthread-cc2538 PUBLIC -T${PROJECT_SOURCE_DIR}/examples/platforms/cc2538/cc2538.ld)
|
||||
target_link_options(openthread-cc2538 PUBLIC -Wl,--gc-sections -Wl,-Map=$<TARGET_PROPERTY:NAME>.map)
|
||||
|
||||
target_compile_definitions(openthread-cc2538
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-cc2538 PRIVATE
|
||||
${OT_CFLAGS}
|
||||
)
|
||||
|
||||
target_include_directories(openthread-cc2538 PRIVATE
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
${PROJECT_SOURCE_DIR}/examples/platforms
|
||||
${PROJECT_SOURCE_DIR}/src/core
|
||||
)
|
||||
@@ -28,6 +28,10 @@
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
|
||||
# Do not enable -Wcast-align for this platform
|
||||
override CFLAGS := $(filter-out -Wcast-align,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wcast-align,$(CXXFLAGS))
|
||||
|
||||
lib_LIBRARIES = libopenthread-cc2538.a
|
||||
|
||||
libopenthread_cc2538_a_CPPFLAGS = \
|
||||
@@ -58,10 +62,6 @@ libopenthread_cc2538_a_SOURCES = \
|
||||
$(PLATFORM_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
PRETTY_FILES = \
|
||||
$(PLATFORM_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
Dash = -
|
||||
libopenthread_cc2538_a_LIBADD = \
|
||||
$(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user