@@ -2086,7 +2086,11 @@ scpi_result_t scpi_cmd_systemSlotLabel(scpi_t *context) {
2086
2086
return SCPI_RES_ERR;
2087
2087
}
2088
2088
2089
- module->setLabel (label, labelLength);
2089
+ auto err = module->setLabel (label, labelLength);
2090
+ if (err != SCPI_RES_OK) {
2091
+ SCPI_ErrorPush (context, err);
2092
+ return SCPI_RES_ERR;
2093
+ }
2090
2094
2091
2095
#if OPTION_DISPLAY
2092
2096
refreshScreen ();
@@ -2101,8 +2105,18 @@ scpi_result_t scpi_cmd_systemSlotLabelQ(scpi_t *context) {
2101
2105
return SCPI_RES_ERR;
2102
2106
}
2103
2107
2104
- const char *label = module->getLabelOrDefault ();
2105
- SCPI_ResultText (context, label);
2108
+ const char *label;
2109
+ auto err = module->getLabel (label);
2110
+ if (err != SCPI_RES_OK) {
2111
+ SCPI_ErrorPush (context, err);
2112
+ return SCPI_RES_ERR;
2113
+ }
2114
+
2115
+ if (*label) {
2116
+ SCPI_ResultText (context, label);
2117
+ } else {
2118
+ SCPI_ResultText (context, module->getDefaultLabel ());
2119
+ }
2106
2120
2107
2121
return SCPI_RES_OK;
2108
2122
}
@@ -2131,7 +2145,11 @@ scpi_result_t scpi_cmd_systemSlotColor(scpi_t *context) {
2131
2145
return SCPI_RES_ERR;
2132
2146
}
2133
2147
2134
- module->setColor (color);
2148
+ auto err = module->setColor (color);
2149
+ if (err != SCPI_RES_OK) {
2150
+ SCPI_ErrorPush (context, err);
2151
+ return SCPI_RES_ERR;
2152
+ }
2135
2153
2136
2154
#if OPTION_DISPLAY
2137
2155
refreshScreen ();
@@ -2146,7 +2164,14 @@ scpi_result_t scpi_cmd_systemSlotColorQ(scpi_t *context) {
2146
2164
return SCPI_RES_ERR;
2147
2165
}
2148
2166
2149
- SCPI_ResultUInt8 (context, module->getColor ());
2167
+ uint8_t color;
2168
+ auto err = module->getColor (color);
2169
+ if (err != SCPI_RES_OK) {
2170
+ SCPI_ErrorPush (context, err);
2171
+ return SCPI_RES_ERR;
2172
+ }
2173
+
2174
+ SCPI_ResultUInt8 (context, color);
2150
2175
2151
2176
return SCPI_RES_OK;
2152
2177
}
0 commit comments