aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c98
2 files changed, 7 insertions, 93 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
index 1c1f45434..e5c12f7b0 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
@@ -16,8 +16,6 @@ void HeatingTestPollRequest(MessageContainer* requestContainer);
bool HeaterCheckReady(void);
-void HeatingStopReporting(void);
-
bool HeaterGetOverTemperatureState(uint8_t HeaterId);
void LoadHeaterState(HeaterType HeaterType,HeaterState *HeaterState);
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c
index e862107ff..bf1f1128d 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c
@@ -64,11 +64,6 @@ uint32_t Heaters_Init(void)
FPGA_SensorInitConfig();
return OK;
}
-char stubToken[37] = {0};
-void HeatingStopReporting(void)
-{
- stubToken[0] = 0;
-}
void HeatingTestRequest(MessageContainer* requestContainer)
{
@@ -76,31 +71,8 @@ void HeatingTestRequest(MessageContainer* requestContainer)
MessageContainer responseContainer;
uint8_t* container_buffer;
uint32_t status = 0;
- HardwarePidControlType HeaterId1,HeaterId2;
StubHeatingTestRequest* request = stub_heating_test_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
- HeaterId1 = request->hardwarepidcontrol1->hardwarepidcontroltype;
- status += HeaterConfigRequestMessage(request->hardwarepidcontrol1);
- HeaterId2 = request->hardwarepidcontrol2->hardwarepidcontroltype;
- status += HeaterConfigRequestMessage(request->hardwarepidcontrol2);
-
- if (request->dryerzone1temp)
- status |= HeaterCommandRequestMessage(
- HeaterId1, true,
- request->dryerzone1temp);
- else
- status |= HeaterCommandRequestMessage(
- HeaterId1, false,
- request->dryerzone1temp);
- if (request->dryerzone2temp)
- status |= HeaterCommandRequestMessage(
- HeaterId2, true,
- request->dryerzone2temp);
- else
- status |= HeaterCommandRequestMessage(
- HeaterId2, false,
- request->dryerzone2temp);
- ControlStart();
StubHeatingTestResponse response = STUB_HEATING_TEST_RESPONSE__INIT;
responseContainer = createContainer(MESSAGE_TYPE__StubHeatingTestResponse, requestContainer->token, false, &response, &stub_heating_test_response__pack, &stub_heating_test_response__get_packed_size);
@@ -108,10 +80,10 @@ void HeatingTestRequest(MessageContainer* requestContainer)
- if (status)
+ //if (status)
{
responseContainer.has_error = true;
- responseContainer.error = (ErrorCode)status;
+ responseContainer.error = ERROR_CODE__JOB_UNSPECIFIED_ERROR;
}
size_t container_size = message_container__pack(&responseContainer, container_buffer);
free(responseContainer.data.data);
@@ -128,22 +100,22 @@ void HeatingTestRequest(MessageContainer* requestContainer)
}
void HeatingTestPollRequest(MessageContainer* requestContainer)
{
- //uint8_t* container_buffer;
+ uint8_t* container_buffer;
StubHeatingTestPollRequest* request = stub_heating_test_poll_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
- ustrncpy (stubToken, requestContainer->token,36);
-/* StubHeatingTestPollResponse response = STUB_HEATING_TEST_POLL_RESPONSE__INIT;
+ StubHeatingTestPollResponse response = STUB_HEATING_TEST_POLL_RESPONSE__INIT;
+ MessageContainer responseContainer;
+
responseContainer = createContainer(MESSAGE_TYPE__StubHeatingTestPollResponse, requestContainer->token, false, &response, &stub_heating_test_poll_response__pack, &stub_heating_test_poll_response__get_packed_size);
container_buffer = malloc(message_container__get_packed_size(&responseContainer));
- if (status)
{
responseContainer.has_error = true;
- responseContainer.error = (ErrorCode)status;
+ responseContainer.error = ERROR_CODE__JOB_UNSPECIFIED_ERROR;
}
size_t container_size = message_container__pack(&responseContainer, container_buffer);
free(responseContainer.data.data);
@@ -154,62 +126,6 @@ void HeatingTestPollRequest(MessageContainer* requestContainer)
stub_heating_test_poll_request__free_unpacked(request,NULL);
}
-void HeatingTestSendResonse(uint32_t status, bool last,bool heater1Active,bool heater2Active, int temperature1, int temperature2,int Heater1Percentage,int Heater2Percentage, char* Message)
-{
- MessageContainer responseContainer;
- uint8_t* container_buffer;
-// uint8_t container_buffer[50];
- if (stubToken[0] == 0)
- return;
- StubHeatingTestPollResponse response = STUB_HEATING_TEST_POLL_RESPONSE__INIT;
-
- /*
- protobuf_c_boolean has_heatergroupid;
- uint32_t heatergroupid;
- protobuf_c_boolean has_zone1temp;
- uint32_t zone1temp;
- protobuf_c_boolean has_zone2temp;
- uint32_t zone2temp;
- protobuf_c_boolean has_heater1active;
- protobuf_c_boolean heater1active;
- protobuf_c_boolean has_heater2active;
- protobuf_c_boolean heater2active;
- protobuf_c_boolean has_heater1percentage;
- uint32_t heater1percentage;
- protobuf_c_boolean has_heater2percentage;
- uint32_t heater2percentage;
- void HeatingTestSendResonse(uint32_t status, bool last,bool heater1Active,bool heater2Active, int temperature1, int temperature2,int Heater1Percentage,int Heater2Percentage)
- */
-response.has_heater1active = true;
-response.heater1active = heater1Active;
-response.has_heater1percentage = true;
-response.heater1percentage = Heater1Percentage;
-response.has_zone1temp = true;
-response.zone1temp = temperature1;
-response.has_heater2active = true;
-response.heater2active = heater2Active;
-response.has_heater2percentage = true;
-response.heater2percentage = Heater2Percentage;
-response.has_zone2temp = true;
-response.zone2temp = temperature2;
-response.infomessage = Message;
-responseContainer = createContainer(MESSAGE_TYPE__StubHeatingTestPollResponse, stubToken, last, &response, &stub_heating_test_poll_response__pack, &stub_heating_test_poll_response__get_packed_size);
-//setContainerContinuous
-responseContainer.continuous = true;
-container_buffer = malloc(message_container__get_packed_size(&responseContainer));
-
- if (status)
- {
- responseContainer.has_error = true;
- responseContainer.error = (ErrorCode)status;
- }
- size_t container_size = message_container__pack(&responseContainer, container_buffer);
- free(responseContainer.data.data);
- //USBCDCD_sendData(container_buffer, container_size,10);
- SendChars(container_buffer, container_size);
- //free(container_buffer);
-// stubToken[0] = 0;
-}
uint32_t HeaterConfigRequestMessage(HardwarePidControl* request)