|
|
@ -51,12 +51,13 @@ class PXXPSBus { |
|
|
|
result.numOnlineId = numSensor; |
|
|
|
for (int i = 0; i < PXX_PRESSURE_SENSOR_NUM; i++) { |
|
|
|
if (sensors[i].online) { |
|
|
|
result.sensor[0].ptype = sensors[i].type; |
|
|
|
result.sensor[0].subid = sensors[i].id; |
|
|
|
result.sensor[0].isOnline = 1; |
|
|
|
result.sensor[0].precision = sensors[i].p100_sensor_info.precision; |
|
|
|
result.sensor[0].zero = sensors[i].p100_sensor_info.zero_point; |
|
|
|
result.sensor[0].full = sensors[i].p100_sensor_info.range_full_point; |
|
|
|
result.sensor[i].ptype = sensors[i].type; |
|
|
|
result.sensor[i].subid = sensors[i].id; |
|
|
|
result.sensor[i].isOnline = 1; |
|
|
|
result.sensor[i].precision = sensors[i].p100_sensor_info.precision; |
|
|
|
result.sensor[i].uint = sensors[i].p100_sensor_info.pressure_unit; |
|
|
|
result.sensor[i].zero = sensors[i].p100_sensor_info.zero_point; |
|
|
|
result.sensor[i].full = sensors[i].p100_sensor_info.range_full_point; |
|
|
|
} |
|
|
|
} |
|
|
|
zcanbus_send_ack(cxt->packet, (uint8_t*)&result, sizeof(result)); |
|
|
@ -87,11 +88,11 @@ class PXXPSBus { |
|
|
|
report_pressure_data_t* reportData = (report_pressure_data_t*)report_buf; |
|
|
|
|
|
|
|
reportData->sensorDataNum = 0; |
|
|
|
for (int i = 0; i < psbus.sensorNum; i++) { |
|
|
|
for (int i = 0; i < PXX_PRESSURE_SENSOR_NUM; i++) { |
|
|
|
if (psbus.sensors[i].online) { |
|
|
|
psbus.readData(i, &val); |
|
|
|
reportData->data[i].subid = psbus.sensors[i].id; |
|
|
|
reportData->data[i].pressureVal = val; |
|
|
|
reportData->data[reportData->sensorDataNum].subid = psbus.sensors[i].id; |
|
|
|
reportData->data[reportData->sensorDataNum].pressureVal = val; |
|
|
|
reportData->sensorDataNum++; |
|
|
|
} |
|
|
|
} |
|
|
|