add 'TB600B_TVOC10' sensor of tvoc to sensor framework
This commit is contained in:
@@ -39,7 +39,7 @@ static struct SensorProductInfo info =
|
||||
};
|
||||
|
||||
/**
|
||||
* @description: Open AS830 sensor device
|
||||
* @description: Open tb600b_iaq10 sensor device
|
||||
* @param sdev - sensor device pointer
|
||||
* @return success: 1 , failure: other
|
||||
*/
|
||||
@@ -130,7 +130,7 @@ static struct SensorDone done =
|
||||
};
|
||||
|
||||
/**
|
||||
* @description: Init AS830 sensor and register
|
||||
* @description: Init tb600b_iaq10 sensor and register
|
||||
* @return void
|
||||
*/
|
||||
static void SensorDeviceTb600bIaq10Init(void)
|
||||
@@ -159,7 +159,7 @@ static uint8_t getCheckSum(uint8_t *packet)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Analysis AS830 CH4 result
|
||||
* @description: Analysis tb600b_iaq10 result
|
||||
* @param quant - sensor quantity pointer
|
||||
* @return quantity value
|
||||
*/
|
||||
@@ -185,7 +185,7 @@ static int32_t QuantityRead(struct SensorQuantity *quant)
|
||||
checksum = getCheckSum(quant->sdev->buffer);
|
||||
if(checksum == quant->sdev->buffer[12])
|
||||
{
|
||||
result.gas = (uint16_t)quant->sdev->buffer[6] * 256 + (uint16)quant->sdev->buffer[7];
|
||||
result.gas = (uint16_t)quant->sdev->buffer[6] * 256 + (uint16_t)quant->sdev->buffer[7];
|
||||
result.TH = ((int)((quant->sdev->buffer[8] << 8)|quant->sdev->buffer[9]))/100;
|
||||
result.TL = ((int)((quant->sdev->buffer[8] << 8)|quant->sdev->buffer[9]))%100;
|
||||
result.RhH = ((unsigned int)((quant->sdev->buffer[10] << 8)|quant->sdev->buffer[11]))/100;
|
||||
@@ -211,7 +211,7 @@ static int32_t QuantityRead(struct SensorQuantity *quant)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Init AS830 CH4 quantity and register
|
||||
* @description: Init tb600b_iaq10 quantity and register
|
||||
* @return 0
|
||||
*/
|
||||
int Tb600bIaq10IaqInit(void)
|
||||
|
||||
Reference in New Issue
Block a user