Skip to content

Commit a88bd92

Browse files
committed
Added possibility to use discovery from other platforms
1 parent b10d52d commit a88bd92

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

RFCs/0002-pluggable-discovery.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,39 @@ discovery.teensy.pattern="{runtime.tools.teensy_ports.path}/hardware/tools/teens
247247

248248
in this case the platform provides a new `teensy` discovery and the command line tool named `teensy_ports` is launched with the `-J2` parameter to start the discovery tool.
249249

250+
#### Using a discovery made by a 3rd party
251+
252+
A platform may opt to depend on a discovery developed by a 3rd party instead of writing and maintaining his own. Since writing a good-quality cross-platform discovery is very hard and time consuming, we expect this option to be used by the majority of developers.
253+
254+
To depend on a 3rd party discovery the platform must add the following directive in the `platform.txt` file:
255+
256+
```
257+
discovery.required=PLATFORM:ARCHITECTURE:DISCOVERY_ID
258+
```
259+
260+
or if the platform needs more discoveries:
261+
262+
```
263+
discovery.required.0=PLATFORM:ARCHITECTURE:DISCOVERY_ID_1
264+
discovery.required.1=PLATFORM:ARCHITECTURE:DISCOVERY_ID_2
265+
...
266+
```
267+
268+
The `PACKAGER:ARCHITECTURE:DISCOVERY_ID` field represents a unique identifier to a 3rd party discovery in particular the `PACKAGER:ARCHITECTURE:...` part is the same as in the FQBN for the boards.
269+
270+
For example if a platform needs the `network` discovery from the Arduino AVR platform it may specify it with:
271+
272+
```
273+
discovery.required=arduino:avr:network
274+
```
275+
250276
#### Duplicate discoveries
251277

252278
It may happen that different 3rd party platforms provides the same discovery or different versions of the same discovery or, worse, different version of the same discovery launched with different parameters.
253279

254280
We can partially handle this if the `DISCOVERY_ID` field in `platform.txt` is well defined: from the CLI we could group together the platforms that requires the same discovery and launch the latest version available just once. How the different 3rd party will agree on the `DISCOVERY_ID` value population is TBD.
255281

256-
In case different discoveries provide conflicting information (for example if two discoveries provide different information for the same port address) we could partially mitigate the issue by giving priority to the discovery that is bundled with the package of the selected board.
282+
In case different discoveries provide conflicting information (for example if two discoveries provide different information for the same port address) we could partially mitigate the issue by giving priority to the discovery that is used by the package of the selected board.
257283

258284
#### Board identification
259285

0 commit comments

Comments
 (0)