1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Brew coffee from the command-line!
//!
//! # Details
//!
//! Longshot is an API and command-line application to brew coffee from the command-line (or whatever
//! front-end is built). At this time it supports DeLonghi ECAM-based Bluetooth-Low-Energy devices, and has only been tested on the
//! Dinamica Plus over Bluetooth.
//!
//! The protocol for status and monitoring has been mostly decoded, but at this time is only available in
//! source form.
//!
//! # Command-Line Examples
//!
//! Monitor the given device (will continue until you press Ctrl+C):
//!
//! ```console
//! $ longshot monitor --device-name (device)
//! Dispensing... [###############################===========]
//! ```
//!
//! Get the brew information for a given beverage:
//!
//! ```console
//! $ longshot brew --device-name (device) --beverage regularcoffee
//! ...
//! ```
//!
//! Brew a beverage:
//!
//! ```console
//! $ longshot brew --device-name (device) --beverage regularcoffee --coffee 180 --taste strong
//! Fetching recipe for RegularCoffee...
//! Fetching recipes...
//! Brewing RegularCoffee...
//! ```
//!
//! # API Examples
//!
//! Brew a long coffee with 250 impulses of water (approximately the size of an average North American coffee mug, or slightly more).
//!
//! ```no_run
//! # use longshot::{ecam::*, protocol::*};
//! # let _ = async {
//! # let device_id = EcamId::Name("00000000-0000-0000-0000-000000000000".into());
//! let ecam = ecam_lookup(&device_id, false).await?;
//! let req = Request::BeverageDispensingMode(
//! EcamBeverageId::LongCoffee.into(),
//! EcamOperationTrigger::Start.into(),
//! vec![RecipeInfo::new(EcamIngredients::Coffee, 250)],
//! EcamBeverageTasteType::Prepare.into(),
//! );
//! ecam.write_request(req).await?;
//! # Result::<(), EcamError>::Ok(())
//! # };
//! ```
//!
//! # Demo
//!
//! 