cat-dev
A library used for interacting with CAT-DEV
also sometimes referred to as the "cat-dev bridge". A CAT-DEV is actually two
pieces under the hood, a "Host Bridge" which is what we actually interact with,
and the actual "Cafe Main Board" (if you have a legal copy of the Cafe SDK
v2.12.13 -- you can look at the doc page at
/system/docs/man/en_us/dev/catdev/prerequisite/DevelopmentEnvironment.html
to find an image explaining this flow).
Stability
This crate is currently pre-1.0. We will do our best to minimize breaking changes to the library, but there is still many parts of the cat-dev we have not fully figured out. As such we're very hesitant to make any promises about the stability of these APIs, or that we'll follow SEM-VER until we've at the very least figured all of that out. If you are ever affected by this, or concerned about this please reach out on our github repository. We do want to try, and make it as smooth as possible.
"Probably Don't Want Functions"
Please double check the documentation before using functions
Because this library is developed in close relation to re-implementations of very old, very buggy CLI tools there are some functions that exist for the sole purpose of recreating these buggy, or poorly displaying CLIs. These functions will be marked in their documentation.
One key thing to watch out for: _with_logging_hooks
these functions don't
magically enable logging, they simply allow hooks for running println!
, and
print!
's completely outside of the logging infrastructure. For tool
reimplementations that need to match their output EXACTLY and thus can't use
the normal logging infrastructure.
Usage
Here are some basic use cases, this not all encompassing but may be helpful for you.
findbridge
-esque style discovery
You can discover all the bridges on your host in the following fashion:
#
use discover_bridges;
/// Fetching detailed fields grabs a few extra bits of information, these are
/// all prefixed with `detailed_` in the returned info structures, but for
/// completeness sake the fields are:
///
/// - `detailed_sdk_version`
/// - `detailed_boot_type`
/// - `detailed_is_cafe_on`
///
/// These all return options that will only be populated if
/// `fetch_detailed_fields` is marked as true.
#
async
getbridge
-esque style finding a specific bridge
You can get information about a specific bridge like so:
#
use ;
#
use Duration;
#
async
Getting the Systems Default Bridge information
Chances are if your interacting with a system you probably have a "default bridge", which you want to use by default if no name was provided. You can get this bridges information from the host state.
#
use BridgeHostState;
#
async