--- add O2 for data port 10 STS_RSS_MODE=3

This commit is contained in:
Yunhorn 2024-07-26 13:52:09 +08:00
parent 125c6326d4
commit 3f91746f2a
2 changed files with 22 additions and 4 deletions

View File

@ -162,6 +162,12 @@
//#define YUNHORN_STS_O5_LORA_APP_DATA_PORT 4U
//#define YUNHORN_STS_O5_LORA_APP_HTBT_PORT 5U
#define YUNHORN_STS_O2_LORA_APP_DATA_PORT 10U
#define YUNHORN_STS_O2_LORA_APP_HTBT_PORT 5U
#define YUNHORN_STS_O2_USER_APP_CTRL_PORT 2U
#define YUNHORN_STS_O2_USER_APP_CTRL_REPLY_PORT 1U
#define YUNHORN_STS_O6_LORA_APP_DATA_PORT 17U
#define YUNHORN_STS_O6_LORA_APP_HTBT_PORT 18U
#define YUNHORN_STS_O6_USER_APP_CTRL_PORT 2U
@ -233,7 +239,7 @@
#define MajorVer 24U
#define MinorVer 07U
#define SubMinorVer 25U
#define SubMinorVer 26U
#define FirmwareVersion 3U
#define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U

View File

@ -927,6 +927,8 @@ static void SendTxData(void)
} else if (sts_work_mode == STS_UNI_MODE) {
AppData.Port = (uint8_t)YUNHORN_STS_O7_LORA_APP_DATA_PORT;
} else if (sts_work_mode == STS_RSS_MODE) {
AppData.Port = (uint8_t)YUNHORN_STS_O2_LORA_APP_DATA_PORT;
}
AppLedStateOn = LED1_STATE;
@ -938,20 +940,30 @@ static void SendTxData(void)
AppData.Port = (uint8_t)YUNHORN_STS_O6_LORA_APP_HTBT_PORT; //LORAWAN_USER_APP_PORT+1;
else if (sts_work_mode == STS_UNI_MODE)
AppData.Port = (uint8_t)YUNHORN_STS_O7_LORA_APP_HTBT_PORT; //LORAWAN_USER_APP_PORT+1;
else if (sts_work_mode == STS_RSS_MODE)
AppData.Port = (uint8_t)YUNHORN_STS_O2_LORA_APP_HTBT_PORT; //LORAWAN_USER_APP_PORT+1;
//AppData.Port = (uint8_t)sts_sendhtbtport; //LORAWAN_USER_APP_PORT+1;
AppData.Buffer[i++] = (uint8_t)(AppLedStateOn|0x80)&0x0ff;
AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254)&0xff; //#05
AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254)&0xff; //#05
} else if ((sensor_data_ready!= 0U)) //sensor_data_ready for manual push button-1 trigger)
{
sensor_data_ready =0;
AppData.Buffer[i++] = (uint8_t)(AppLedStateOn|0x80)&0x0ff; //00 ************ MUST KEEP IT HERE, NON-ZERO ******
if (sts_work_mode != STS_RSS_MODE) // keep compatible with previous version, PIXEL-NETWORK
{
AppData.Buffer[i++] = (uint8_t)(AppLedStateOn|0x80)&0x0ff; //00 ************ MUST KEEP IT HERE, NON-ZERO ******
}
AppData.Buffer[i++] = (uint8_t)(sensorData.lamp_bar_color)&0xff; //01
AppData.Buffer[i++] = (uint8_t)(sensorData.workmode)&0xff; //02 WORK MODE
if (sts_work_mode == STS_DUAL_MODE)
if (sts_work_mode == STS_RSS_MODE)
{
AppData.Buffer[i++] = (uint8_t)(sensorData.state_sensor1_on_off)&0xff; //03 Sensor head #1 status
AppData.Buffer[i++] = (uint8_t)(sensorData.state_sensor2_on_off)&0xff; //04 Sensor head #3 status
}
else if (sts_work_mode == STS_DUAL_MODE)
{
AppData.Buffer[i++] = (uint8_t)(sensorData.state_sensor1_on_off)&0xff; //03 Sensor head #1 status
AppData.Buffer[i++] = (uint8_t)(sensorData.state_sensor2_on_off)&0xff; //04 Sensor head #2 status