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
////! This file contains code used to [de]serialize calibration
////! points (etc) into byte arrays, for use with storing on
////! flash chips etc.
//
//use crate::{CalPt, OrpCalPt, EcCalPt};
//
//impl CalPt {
// pub fn to_bytes(&self) -> [u8; 37] {
// let mut r = [0; 37];
//
// let mut addr = 0;
//
// // todo: DRY
// for byte in &float_to_bytes(self.ph_cal.0.V) {
// r[addr] = *byte;
// addr += 1;
// }
// for byte in &float_to_bytes(self.ph_cal.0.pH) {
// r[addr] = *byte;
// addr += 1;
// }
// for byte in &float_to_bytes(self.ph_cal.0.T) {
// r[addr] = *byte;
// addr += 1;
// }
//
// for byte in &float_to_bytes(self.ph_cal.1.V) {
// r[addr] = *byte;
// addr += 1;
// }
// for byte in &float_to_bytes(self.ph_cal.1.pH) {
// r[addr] = *byte;
// addr += 1;
// }
// for byte in &float_to_bytes(self.ph_cal.1.T) {
// r[addr] = *byte;
// addr += 1;
// }
//
// match self.ph_cal.2 {
// Some(c) => {
// r[addr] = 1;
// addr += 1;
//
// for byte in &float_to_bytes(c.V) {
// r[addr] = *byte;
// addr += 1;
// }
// for byte in &float_to_bytes(c.pH) {
// r[addr] = *byte;
// addr += 1;
// }
// for byte in &float_to_bytes(c.T) {
// r[addr] = *byte;
// addr += 1;
// }
// }
// None => {
// r[addr] = 0;
// addr += 13;
// }
// }
//
// r
// }
//
//}