asic_rs/data/
board.rs

1use super::hashrate::HashRate;
2use super::serialize::{serialize_frequency, serialize_temperature, serialize_voltage};
3use measurements::{Frequency, Temperature, Voltage};
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
7pub struct ChipData {
8    /// The position of the chip on the board, indexed from 0
9    pub position: u16,
10    /// The current hashrate of the chip
11    pub hashrate: Option<HashRate>,
12    /// The current chip temperature
13    #[serde(serialize_with = "serialize_temperature")]
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub temperature: Option<Temperature>,
16    /// The voltage set point for this chip
17    #[serde(serialize_with = "serialize_voltage")]
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub voltage: Option<Voltage>,
20    /// The frequency set point for this chip
21    #[serde(serialize_with = "serialize_frequency")]
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub frequency: Option<Frequency>,
24    /// Whether this chip is tuned and optimizations have completed
25    pub tuned: Option<bool>,
26    /// Whether this chip is working and actively mining
27    pub working: Option<bool>,
28}
29
30#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
31pub struct BoardData {
32    /// The board position in the miner, indexed from 0
33    pub position: u8,
34    /// The current hashrate of the board
35    pub hashrate: Option<HashRate>,
36    /// The expected or factory hashrate of the board
37    pub expected_hashrate: Option<HashRate>,
38    /// The board temperature, also sometimes called PCB temperature
39    #[serde(serialize_with = "serialize_temperature")]
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub board_temperature: Option<Temperature>,
42    /// The temperature of the chips at the intake, usually from the first sensor on the board
43    #[serde(serialize_with = "serialize_temperature")]
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub intake_temperature: Option<Temperature>,
46    /// The temperature of the chips at the outlet, usually from the last sensor on the board
47    #[serde(serialize_with = "serialize_temperature")]
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub outlet_temperature: Option<Temperature>,
50    /// The expected number of chips on this board
51    pub expected_chips: Option<u16>,
52    /// The number of working chips on this board
53    pub working_chips: Option<u16>,
54    /// The serial number of this board
55    pub serial_number: Option<String>,
56    /// Chip level information for this board
57    /// May be empty, most machines do not provide this level of in depth information
58    pub chips: Vec<ChipData>,
59    /// The average voltage or voltage set point of this board
60    #[serde(serialize_with = "serialize_voltage")]
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub voltage: Option<Voltage>,
63    /// The average frequency or frequency set point of this board
64    #[serde(serialize_with = "serialize_frequency")]
65    #[serde(skip_serializing_if = "Option::is_none")]
66    pub frequency: Option<Frequency>,
67    /// Whether this board has been tuned and optimizations have completed
68    pub tuned: Option<bool>,
69    /// Whether this board is enabled and actively mining
70    pub active: Option<bool>,
71}