Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed Nov 3, 2023
1 parent f2e9a8c commit 6900a19
Showing 1 changed file with 44 additions and 33 deletions.
77 changes: 44 additions & 33 deletions src/tools/interop/idt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,43 +256,13 @@ options:
Collect contextually relevant networking info from the local environment and provide artifacts.
## Extending functionality
Ecosystem and Platform implementations are dynamically loaded.
For each package in `capture/ecosystem`, the ecosystem loader expects a module
name matching the package name.
This module must contain a single class which is a subclass of
`capture.base.EcosystemCapture`.
`/capture/ecosystem/play_services_user` contains a minimal example
implementation.
As another example, link `/res/plugin_demo/ecosystem/demo_ext_ecosystem`.
```
$ idt_go && ln -s $PWD/idt/res/plugin_demo/ecosystem/demo_ext_ecosystem/ idt/capture/ecosystem
$ idt capture -h
usage: idt capture [-h] [--platform {Android}] [--ecosystem {DemoExtEcosystem...
```
> **IMPORTANT:** Note the following runtime expectations of ecosystems:
> `analyze_capture` must be async aware and not interact with stdin
The platform loader functions the same as `capture/ecosystem`.
For each package in `capture/platform`, the platform loader expects a module
name matching the package name.
This module must contain a single class which is a subclass of
`capture.base.PlatformLogStreamer`.
## Project overview
- The entry point is in `idt.py` which contains simple CLI parsing with
`argparse`.
- `log` contains logging utilities used by everything in the project.
For capture:
### `capture`
- `base` contains the base classes for ecosystems and platforms.
- `factory` contains the ecosystem and platform producer and controller
Expand All @@ -301,15 +271,17 @@ For capture:
- `utils/shell` contains a simple helper class for background and foreground
Bash commands.
- `utils/artifact` contains helper functions for managing artifacts.
- `/platform` and `/ecosystem` contain one package for each platform and ecosystem, which should each contain
one implementation of the respective base classs.
For discovery:
### `discovery`
- `matter_ble` provides a simple ble scanner that shows matter devices being
discovered and lost, as well as their VID/PID, RSSI, etc.
- `matter_dnssd` provides a simple DNS-SD browser that searches for matter
devices and thread border routers.
For probe:
### `probe`
- `probe` contains the base class for (`idt`'s) host platform specific implementation.
- Reuses the dnssd discovery implementation to build probe targets
Expand Down Expand Up @@ -338,3 +310,42 @@ For probe:
to `False`.
- Wireless `adb` may fail to connect indefinitely depending on network
configuration.
- `idt_clean_child` will kill any stray `tcpdump` and `adb` commands.
- `idt_check_child` will look for leftover processes.
- Not expected to be needed outside of development scenarios.
## Extending functionality
### Capture
Ecosystem and Platform implementations are dynamically loaded.
For each package in `capture/ecosystem`, the ecosystem loader expects a module
name matching the package name.
This module must contain a single class which is a subclass of
`capture.base.EcosystemCapture`.
`/capture/ecosystem/play_services_user` contains a minimal example
implementation.
As another example, link `/res/plugin_demo/ecosystem/demo_ext_ecosystem`.
```
$ idt_go && ln -s $PWD/idt/res/plugin_demo/ecosystem/demo_ext_ecosystem/ idt/capture/ecosystem
$ idt capture -h
usage: idt capture [-h] [--platform {Android}] [--ecosystem {DemoExtEcosystem...
```
> **IMPORTANT:** Note the following runtime expectations of ecosystems:
> `analyze_capture` must be async aware and not interact with stdin
The platform loader functions the same as `capture/ecosystem`.
For each package in `capture/platform`, the platform loader expects a module
name matching the package name.
This module must contain a single class which is a subclass of
`capture.base.PlatformLogStreamer`.
### Probe
Simply add host platform specific `run_command()` calls in the functions of the host platform implementations.

0 comments on commit 6900a19

Please sign in to comment.