|
|
@@ -45,12 +45,17 @@ void nbus_slave_unicastToSensorGet(nBus_TypeDef *nbus){
|
|
|
|
|
|
case CMD_DATA:
|
|
|
{
|
|
|
- uint8_t cnt = nbus->interface->getData(nbus->sensorInfo.address, &nbus->tx_buffer[4]);
|
|
|
- if (cnt == 0){
|
|
|
- setErrorResponse(nbus, DEVICE_BUSY);
|
|
|
- return;
|
|
|
+ if (nbus->measure_active == MEASURE_RUNNING) {
|
|
|
+ uint8_t cnt = nbus->interface->getData(nbus->sensorInfo.address, &nbus->tx_buffer[4]);
|
|
|
+ if (cnt == 0){
|
|
|
+ setErrorResponse(nbus, DEVICE_BUSY);
|
|
|
+ //return;
|
|
|
+ }
|
|
|
+ nbus->tx_length += cnt;
|
|
|
+ } else {
|
|
|
+ setErrorResponse(nbus, DEVICE_NOT_READY);
|
|
|
}
|
|
|
- nbus->tx_length += cnt;
|
|
|
+
|
|
|
}
|
|
|
break;
|
|
|
|