将瞬时风速风向,极大极小添加进协议
This commit is contained in:
parent
51e5b07b49
commit
4c91d4bf82
|
@ -24,15 +24,19 @@ typedef enum
|
||||||
{
|
{
|
||||||
FRT_REGISTER_MIN_WIND_DIRECTION = 0, /* 最小风向 */
|
FRT_REGISTER_MIN_WIND_DIRECTION = 0, /* 最小风向 */
|
||||||
FRT_REGISTER_AVERAGE_WIND_DIRECTION = 1, /* 平均风向 */
|
FRT_REGISTER_AVERAGE_WIND_DIRECTION = 1, /* 平均风向 */
|
||||||
FRT_REGISTER_MAX_WIND_DIRECTION = 2, /* 最大风向 */
|
FRT_REGISTER_INSTANTANEOUS_WIND_DIRECTION = 2, /* 瞬时风向 */
|
||||||
FRT_REGISTER_MIN_WIND_SPEED = 3, /* 最小风速 */
|
FRT_REGISTER_MAX_WIND_DIRECTION = 3, /* 最大风向 */
|
||||||
FRT_REGISTER_AVERAGE_WIND_SPEED = 4, /* 平均风速 */
|
FRT_REGISTER_MIN_WIND_SPEED = 4, /* 最小风速 */
|
||||||
FRT_REGISTER_MAX_WIND_SPEED = 5, /* 最大风速 */
|
FRT_REGISTER_THROUGH_WIND_SPEED = 5, /* 极小风速 */
|
||||||
FRT_REGISTER_TEMPERATURE = 6, /* 大气温度 */
|
FRT_REGISTER_AVERAGE_WIND_SPEED = 6, /* 平均风速 */
|
||||||
FRT_REGISTER_HUMIDITY = 7, /* 大气湿度 */
|
FRT_REGISTER_INSTANTANEOUS_WIND_SPEED = 7, /* 瞬时风速 */
|
||||||
FRT_REGISTER_PRESSURE = 8, /* 大气压 */
|
FRT_REGISTER_PEAK_WIND_SPEED = 8, /* 极大风速 */
|
||||||
FRT_REGISTER_RAIN = 9, /* 雨量 */
|
FRT_REGISTER_MAX_WIND_SPEED = 9, /* 最大风速 */
|
||||||
FRT_REGISTER_PRECIPITATION_INTENSITY = 10, /* 总辐射 */
|
FRT_REGISTER_TEMPERATURE = 10, /* 大气温度 */
|
||||||
|
FRT_REGISTER_HUMIDITY = 11, /* 大气湿度 */
|
||||||
|
FRT_REGISTER_PRESSURE = 12, /* 大气压 */
|
||||||
|
FRT_REGISTER_RAIN = 13, /* 雨量 */
|
||||||
|
FRT_REGISTER_PRECIPITATION_INTENSITY = 14, /* 总辐射 */
|
||||||
|
|
||||||
FRT_REGISTER_DEVICE_ADDR = 20, /* 设备地址 */
|
FRT_REGISTER_DEVICE_ADDR = 20, /* 设备地址 */
|
||||||
FRT_REGISTER_COMMU_BAUDRATE = 21, /* 波特率 */
|
FRT_REGISTER_COMMU_BAUDRATE = 21, /* 波特率 */
|
||||||
|
|
|
@ -17,9 +17,13 @@ static u_int16_t FRT_ReadReg(unsigned char regId);
|
||||||
/* 读 */
|
/* 读 */
|
||||||
static u_int16_t FRT_ReadRegMinWindDiretion(void *pMsg);
|
static u_int16_t FRT_ReadRegMinWindDiretion(void *pMsg);
|
||||||
static u_int16_t FRT_ReadRegAverageWindDirection(void *pMsg);
|
static u_int16_t FRT_ReadRegAverageWindDirection(void *pMsg);
|
||||||
|
static u_int16_t FRT_ReadRegInstantaneousWindDirection(void *pMsg);
|
||||||
static u_int16_t FRT_ReadRegMaxWindDirection(void *pMsg);
|
static u_int16_t FRT_ReadRegMaxWindDirection(void *pMsg);
|
||||||
static u_int16_t FRT_ReadRegMinWindSpeed(void *pMsg);
|
static u_int16_t FRT_ReadRegMinWindSpeed(void *pMsg);
|
||||||
|
static u_int16_t FRT_ReadRegThroughWindSpeed(void *pMsg);
|
||||||
static u_int16_t FRT_ReadRegAverageWindSpeed(void *pMsg);
|
static u_int16_t FRT_ReadRegAverageWindSpeed(void *pMsg);
|
||||||
|
static u_int16_t FRT_ReadRegInstantaneousWindSpeed(void *pMsg);
|
||||||
|
static u_int16_t FRT_ReadRegPeakWindSpeed(void *pMsg);
|
||||||
static u_int16_t FRT_ReadRegMaxWindSpeed(void *pMsg);
|
static u_int16_t FRT_ReadRegMaxWindSpeed(void *pMsg);
|
||||||
static u_int16_t FRT_ReadRegTemperature(void *pMsg);
|
static u_int16_t FRT_ReadRegTemperature(void *pMsg);
|
||||||
static u_int16_t FRT_ReadRegHumidity(void *pMsg);
|
static u_int16_t FRT_ReadRegHumidity(void *pMsg);
|
||||||
|
@ -85,9 +89,13 @@ FRT_RegProcTable_s g_RegTbl[] =
|
||||||
{
|
{
|
||||||
{ FRT_REGISTER_MIN_WIND_DIRECTION, FRT_ReadRegMinWindDiretion }, /* 最小风向 */
|
{ FRT_REGISTER_MIN_WIND_DIRECTION, FRT_ReadRegMinWindDiretion }, /* 最小风向 */
|
||||||
{ FRT_REGISTER_AVERAGE_WIND_DIRECTION, FRT_ReadRegAverageWindDirection }, /* 平均风向 */
|
{ FRT_REGISTER_AVERAGE_WIND_DIRECTION, FRT_ReadRegAverageWindDirection }, /* 平均风向 */
|
||||||
|
{ FRT_REGISTER_INSTANTANEOUS_WIND_DIRECTION, FRT_ReadRegInstantaneousWindDirection }, /* 瞬时风向 */
|
||||||
{ FRT_REGISTER_MAX_WIND_DIRECTION, FRT_ReadRegMaxWindDirection }, /* 最大风向 */
|
{ FRT_REGISTER_MAX_WIND_DIRECTION, FRT_ReadRegMaxWindDirection }, /* 最大风向 */
|
||||||
{ FRT_REGISTER_MIN_WIND_SPEED, FRT_ReadRegMinWindSpeed }, /* 最小风速 */
|
{ FRT_REGISTER_MIN_WIND_SPEED, FRT_ReadRegMinWindSpeed }, /* 最小风速 */
|
||||||
|
{ FRT_REGISTER_THROUGH_WIND_SPEED, FRT_ReadRegThroughWindSpeed }, /* 极小风速 */
|
||||||
{ FRT_REGISTER_AVERAGE_WIND_SPEED, FRT_ReadRegAverageWindSpeed }, /* 平均风速 */
|
{ FRT_REGISTER_AVERAGE_WIND_SPEED, FRT_ReadRegAverageWindSpeed }, /* 平均风速 */
|
||||||
|
{ FRT_REGISTER_INSTANTANEOUS_WIND_SPEED, FRT_ReadRegInstantaneousWindSpeed }, /* 瞬时风速 */
|
||||||
|
{ FRT_REGISTER_PEAK_WIND_SPEED, FRT_ReadRegPeakWindSpeed }, /* 极大风速 */
|
||||||
{ FRT_REGISTER_MAX_WIND_SPEED, FRT_ReadRegMaxWindSpeed }, /* 最大风速 */
|
{ FRT_REGISTER_MAX_WIND_SPEED, FRT_ReadRegMaxWindSpeed }, /* 最大风速 */
|
||||||
{ FRT_REGISTER_TEMPERATURE, FRT_ReadRegTemperature }, /* 大气温度 */
|
{ FRT_REGISTER_TEMPERATURE, FRT_ReadRegTemperature }, /* 大气温度 */
|
||||||
{ FRT_REGISTER_HUMIDITY, FRT_ReadRegHumidity }, /* 大气湿度 */
|
{ FRT_REGISTER_HUMIDITY, FRT_ReadRegHumidity }, /* 大气湿度 */
|
||||||
|
@ -197,6 +205,17 @@ static u_int16_t FRT_ReadRegAverageWindDirection(void *pMsg)
|
||||||
return FRT_swap_endian_16(value);
|
return FRT_swap_endian_16(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 读瞬时风向寄存器值
|
||||||
|
* @param
|
||||||
|
* @retval
|
||||||
|
*/
|
||||||
|
static u_int16_t FRT_ReadRegInstantaneousWindDirection(void *pMsg)
|
||||||
|
{
|
||||||
|
u_int16_t value = (u_int16_t)(g_stMcs_Para.instantaneous_wind_direction *10);
|
||||||
|
return FRT_swap_endian_16(value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 读最大风向寄存器值
|
* @brief 读最大风向寄存器值
|
||||||
* @param
|
* @param
|
||||||
|
@ -219,6 +238,17 @@ static u_int16_t FRT_ReadRegMinWindSpeed(void *pMsg)
|
||||||
return FRT_swap_endian_16(value);
|
return FRT_swap_endian_16(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 读最小风速寄存器值
|
||||||
|
* @param
|
||||||
|
* @retval
|
||||||
|
*/
|
||||||
|
static u_int16_t FRT_ReadRegThroughWindSpeed(void *pMsg)
|
||||||
|
{
|
||||||
|
u_int16_t value=(u_int16_t)(g_stMcs_Para.trough_wind_speed *10);
|
||||||
|
return FRT_swap_endian_16(value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 读平均风速寄存器值
|
* @brief 读平均风速寄存器值
|
||||||
* @param
|
* @param
|
||||||
|
@ -230,6 +260,28 @@ static u_int16_t FRT_ReadRegAverageWindSpeed(void *pMsg)
|
||||||
return FRT_swap_endian_16(value);
|
return FRT_swap_endian_16(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 读瞬时风速寄存器值
|
||||||
|
* @param
|
||||||
|
* @retval
|
||||||
|
*/
|
||||||
|
static u_int16_t FRT_ReadRegInstantaneousWindSpeed(void *pMsg)
|
||||||
|
{
|
||||||
|
u_int16_t value=(u_int16_t)(g_stMcs_Para.instantaneous_wind_speed *10);
|
||||||
|
return FRT_swap_endian_16(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 读极大风速寄存器值
|
||||||
|
* @param
|
||||||
|
* @retval
|
||||||
|
*/
|
||||||
|
static u_int16_t FRT_ReadRegPeakWindSpeed(void *pMsg)
|
||||||
|
{
|
||||||
|
u_int16_t value=(u_int16_t)(g_stMcs_Para.peak_wind_speed *10);
|
||||||
|
return FRT_swap_endian_16(value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 读最大风速寄存器值
|
* @brief 读最大风速寄存器值
|
||||||
* @param
|
* @param
|
||||||
|
@ -538,7 +590,7 @@ static u_int16_t FRT_ReadRegErrorData(void *pMsg)
|
||||||
*/
|
*/
|
||||||
static u_int16_t FRT_ReadRegWindC(void *pMsg)
|
static u_int16_t FRT_ReadRegWindC(void *pMsg)
|
||||||
{
|
{
|
||||||
u_int16_t value=weather_info.wind_c = 0;
|
u_int16_t value=(u_int16_t)(weather_info.wind_c *10);
|
||||||
return FRT_swap_endian_16(value);
|
return FRT_swap_endian_16(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue