@@ -49,82 +49,86 @@ static void psmove_dump_calibration(const reports::ps_move_calibration_blob& cal
49
49
50
50
const u8* data = calibration.data .data ();
51
51
52
+ std::string msg;
53
+
52
54
switch (device.model )
53
55
{
54
56
case ps_move_model::ZCM1:
55
57
t = psmove_calibration_decode_12bits (data, 0x02 );
56
- move_log. error ( " Temperature: 0x%04X" , t);
58
+ fmt::append (msg, " Temperature: 0x%04X\n " , t);
57
59
for (int orientation = 0 ; orientation < 6 ; orientation++)
58
60
{
59
61
x = psmove_calibration_decode_16bit_unsigned (data, 0x04 + 6 * orientation);
60
62
y = psmove_calibration_decode_16bit_unsigned (data, 0x04 + 6 * orientation + 2 );
61
63
z = psmove_calibration_decode_16bit_unsigned (data, 0x04 + 6 * orientation + 4 );
62
- move_log. error ( " Orientation #%d: (%5d | %5d | %5d)" , orientation, x, y, z);
64
+ fmt::append (msg, " Orientation #%d: (%5d | %5d | %5d)\n " , orientation, x, y, z);
63
65
}
64
66
65
67
t = psmove_calibration_decode_12bits (data, 0x42 );
66
- move_log. error ( " Temperature: 0x%04X" , t);
68
+ fmt::append (msg, " Temperature: 0x%04X\n " , t);
67
69
for (int orientation = 0 ; orientation < 3 ; orientation++)
68
70
{
69
71
x = psmove_calibration_decode_16bit_unsigned (data, 0x46 + 8 * orientation);
70
72
y = psmove_calibration_decode_16bit_unsigned (data, 0x46 + 8 * orientation + 2 );
71
73
z = psmove_calibration_decode_16bit_unsigned (data, 0x46 + 8 * orientation + 4 );
72
- move_log. error ( " Gyro %c, 80 rpm: (%5d | %5d | %5d)" , " XYZ" [orientation], x, y, z);
74
+ fmt::append (msg, " Gyro %c, 80 rpm: (%5d | %5d | %5d)\n " , " XYZ" [orientation], x, y, z);
73
75
}
74
76
75
77
t = psmove_calibration_decode_12bits (data, 0x28 );
76
78
x = psmove_calibration_decode_16bit_unsigned (data, 0x2a );
77
79
y = psmove_calibration_decode_16bit_unsigned (data, 0x2a + 2 );
78
80
z = psmove_calibration_decode_16bit_unsigned (data, 0x2a + 4 );
79
- move_log. error ( " Temperature: 0x%04X" , t);
80
- move_log. error ( " Gyro, 0 rpm (@0x2a): (%5d | %5d | %5d)" , x, y, z);
81
+ fmt::append (msg, " Temperature: 0x%04X\n " , t);
82
+ fmt::append (msg, " Gyro, 0 rpm (@0x2a): (%5d | %5d | %5d)\n " , x, y, z);
81
83
82
84
t = psmove_calibration_decode_12bits (data, 0x30 );
83
85
x = psmove_calibration_decode_16bit_unsigned (data, 0x32 );
84
86
y = psmove_calibration_decode_16bit_unsigned (data, 0x32 + 2 );
85
87
z = psmove_calibration_decode_16bit_unsigned (data, 0x32 + 4 );
86
- move_log. error ( " Temperature: 0x%04X" , t);
87
- move_log. error ( " Gyro, 0 rpm (@0x32): (%5d | %5d | %5d)" , x, y, z);
88
+ fmt::append (msg, " Temperature: 0x%04X\n " , t);
89
+ fmt::append (msg, " Gyro, 0 rpm (@0x32): (%5d | %5d | %5d)\n " , x, y, z);
88
90
89
91
t = psmove_calibration_decode_12bits (data, 0x5c );
90
92
fx = psmove_calibration_decode_float (data, 0x5e );
91
93
fy = psmove_calibration_decode_float (data, 0x5e + 4 );
92
94
fz = psmove_calibration_decode_float (data, 0x5e + 8 );
93
- move_log. error ( " Temperature: 0x%04X" , t);
94
- move_log. error ( " Vector @0x5e: (%f | %f | %f)" , fx, fy, fz);
95
+ fmt::append (msg, " Temperature: 0x%04X\n " , t);
96
+ fmt::append (msg, " Vector @0x5e: (%f | %f | %f)\n " , fx, fy, fz);
95
97
96
98
fx = psmove_calibration_decode_float (data, 0x6a );
97
99
fy = psmove_calibration_decode_float (data, 0x6a + 4 );
98
100
fz = psmove_calibration_decode_float (data, 0x6a + 8 );
99
- move_log. error ( " Vector @0x6a: (%f | %f | %f)" , fx, fy, fz);
101
+ fmt::append (msg, " Vector @0x6a: (%f | %f | %f)\n " , fx, fy, fz);
100
102
101
- move_log. error ( " byte @0x3f: 0x%02x" , static_cast <u8>(data[0x3f ]));
102
- move_log. error ( " float @0x76: %f" , psmove_calibration_decode_float (data, 0x76 ));
103
- move_log. error ( " float @0x7a: %f" , psmove_calibration_decode_float (data, 0x7a ));
103
+ fmt::append (msg, " byte @0x3f: 0x%02x\n " , static_cast <u8>(data[0x3f ]));
104
+ fmt::append (msg, " float @0x76: %f\n " , psmove_calibration_decode_float (data, 0x76 ));
105
+ fmt::append (msg, " float @0x7a: %f\n " , psmove_calibration_decode_float (data, 0x7a ));
104
106
break ;
105
107
case ps_move_model::ZCM2:
106
108
for (int orientation = 0 ; orientation < 6 ; orientation++)
107
109
{
108
110
x = psmove_calibration_decode_16bit_signed (data, 0x04 + 6 * orientation);
109
111
y = psmove_calibration_decode_16bit_signed (data, 0x04 + 6 * orientation + 2 );
110
112
z = psmove_calibration_decode_16bit_signed (data, 0x04 + 6 * orientation + 4 );
111
- move_log. error ( " Orientation #%d: (%5d | %5d | %5d)" , orientation, x, y, z);
113
+ fmt::append (msg, " Orientation #%d: (%5d | %5d | %5d)\n " , orientation, x, y, z);
112
114
}
113
115
114
116
x = psmove_calibration_decode_16bit_signed (data, 0x26 );
115
117
y = psmove_calibration_decode_16bit_signed (data, 0x26 + 2 );
116
118
z = psmove_calibration_decode_16bit_signed (data, 0x26 + 4 );
117
- move_log. error ( " Gyro Bias?, 0 rpm (@0x26): (%5d | %5d | %5d)" , x, y, z);
119
+ fmt::append (msg, " Gyro Bias?, 0 rpm (@0x26): (%5d | %5d | %5d)\n " , x, y, z);
118
120
119
121
for (int orientation = 0 ; orientation < 6 ; orientation++)
120
122
{
121
123
x = psmove_calibration_decode_16bit_signed (data, 0x30 + 6 * orientation);
122
124
y = psmove_calibration_decode_16bit_signed (data, 0x30 + 6 * orientation + 2 );
123
125
z = psmove_calibration_decode_16bit_signed (data, 0x30 + 6 * orientation + 4 );
124
- move_log. error ( " Gyro %c, 90 rpm: (%5d | %5d | %5d)" , " XYZXYZ" [orientation], x, y, z);
126
+ fmt::append (msg, " Gyro %c, 90 rpm: (%5d | %5d | %5d)\n " , " XYZXYZ" [orientation], x, y, z);
125
127
}
126
128
break ;
127
129
}
130
+
131
+ move_log.notice (" Calibration:\n %s" , msg);
128
132
}
129
133
130
134
void psmove_calibration_get_usb_accel_values (const reports::ps_move_calibration_blob& calibration, ps_move_device& device)
0 commit comments