diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 94a6d133..07152646 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1798,7 +1798,7 @@ void CPhoneDevice::UpdateSimcard(const std::string& simcard) } -int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceTail, SENSOR_PARAM sensorParam) +int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceTail, SENSOR_PARAM *sensorParam) { Collect_sensor_data(); //15s Data_DEF airt; @@ -1807,26 +1807,24 @@ int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceT iceInfo->tension = 0; iceInfo->tension_difference = 0; - GetPullValue(2, &airt); - iceInfo->t_sensor_data[0].original_tension = airt.EuValue; - GetPullValue(4, &airt); - iceInfo->t_sensor_data[1].original_tension = airt.EuValue; - GetPullValue(5, &airt); - iceInfo->t_sensor_data[2].original_tension = airt.EuValue; - - - GetAngleValue(6, &airt, 0); - iceInfo->t_sensor_data[0].deflection_angle = airt.EuValue; - GetAngleValue(6, &airt, 1); - iceInfo->t_sensor_data[0].windage_yaw_angle = airt.EuValue; - GetAngleValue(7, &airt, 0); - iceInfo->t_sensor_data[1].deflection_angle = airt.EuValue; - GetAngleValue(7, &airt, 1); - iceInfo->t_sensor_data[1].windage_yaw_angle = airt.EuValue; - GetAngleValue(13, &airt, 0); - iceInfo->t_sensor_data[2].deflection_angle = airt.EuValue; - GetAngleValue(13, &airt, 1); - iceInfo->t_sensor_data[2].windage_yaw_angle = airt.EuValue; + int pullno = 0; + int angleno = 0; + for(int num = 0; num < MAX_SERIAL_DEV_NUM; num++) + { + if(sensorParam[num].SensorsType == RALLY_PROTOCOL) + { + GetPullValue(num, &airt); + iceInfo->t_sensor_data[pullno].original_tension = airt.EuValue; + pullno++; + } else if(sensorParam[num].SensorsType == SLANT_PROTOCOL) + { + GetAngleValue(num, &airt, 0); + iceInfo->t_sensor_data[angleno].deflection_angle = airt.EuValue; + GetAngleValue(num, &airt, 1); + iceInfo->t_sensor_data[angleno].windage_yaw_angle = airt.EuValue; + angleno++; + } + } GetWindSpeedData(&airt); iceTail->instantaneous_windspeed = airt.EuValue; diff --git a/app/src/main/cpp/PhoneDevice.h b/app/src/main/cpp/PhoneDevice.h index 0a338a68..61ada62a 100644 --- a/app/src/main/cpp/PhoneDevice.h +++ b/app/src/main/cpp/PhoneDevice.h @@ -199,7 +199,7 @@ public: virtual bool ReleaseWakelock(unsigned long wakelock); virtual int GetWData(WEATHER_INFO *weatherInfo); - virtual int GetIceData(ICE_INFO *iceInfo, ICE_TAIL *icetail, SENSOR_PARAM sensorParam); + virtual int GetIceData(ICE_INFO *iceInfo, ICE_TAIL *icetail, SENSOR_PARAM *sensorParam); virtual bool OpenSensors(); virtual bool CloseSensors(); diff --git a/app/src/main/cpp/serialComm.cpp b/app/src/main/cpp/SerialComm.cpp similarity index 100% rename from app/src/main/cpp/serialComm.cpp rename to app/src/main/cpp/SerialComm.cpp diff --git a/app/src/main/cpp/serialComm.h b/app/src/main/cpp/SerialComm.h similarity index 100% rename from app/src/main/cpp/serialComm.h rename to app/src/main/cpp/SerialComm.h