diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-10-09 16:46:20 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-10-09 16:46:20 +0300 |
| commit | 07276289ff121853256bb894bc3040c4f5bfb2b0 (patch) | |
| tree | 369835914beffe3330a3f16150e8a6ce70f10b46 /Software/Embedded_SW/Embedded/Modules/Waste | |
| parent | 67bfd778a15597bb213c94fa5c2f5495fafd7c66 (diff) | |
| download | Tango-07276289ff121853256bb894bc3040c4f5bfb2b0.tar.gz Tango-07276289ff121853256bb894bc3040c4f5bfb2b0.zip | |
ifs filling / waste emptying interface
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Waste')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h | 2 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 55 |
2 files changed, 56 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h index 0a7534635..38e3236cc 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h @@ -47,6 +47,8 @@ bool WHS_IsEmptying(); uint32_t Waste_CheckState(void); uint32_t Waste_Prepare(void); bool WHS_IsVocPpmOverAlarmLimit(); +uint32_t StartWasteEmptyingRequestFunc(MessageContainer* requestContainer); + extern bool ReadingVocEverySec; diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 84609035a..6d338cbf7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -6,13 +6,17 @@ #include "drivers/Valves/Valve.h" #include "Common/report/report.h" #include "Modules/Waste/Waste_ex.h" +#include "modules/heaters/heaters_ex.h" #include <Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h> #include "Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.h" #include <Drivers/I2C_Communication/RFID_NFC/NFC_MainBaord.h> #include "Drivers/I2C_Communication/RFID_NFC/NFC.h" -//#include <Utilities/RfidTagHandling.h> +#include <Utilities/RfidTagHandling.h> #include <PMR/Diagnostics/EventType.pb-c.h> +#include "PMR/Diagnostics/FillingAction.pb-c.h" +#include "PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.h" +#include "PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.h" #include "Modules/AlarmHandling/AlarmHandling.h" #include "StateMachines/Initialization/PowerOffSequence.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" @@ -501,6 +505,53 @@ void Waste_StateMachine(void) break; } } +char WasteEmptyingToken[36+1] = {0}; +uint32_t WasteEmptyingUpdate(POWER_OFF_STAGES_ENUM stage) +{ + uint32_t status = NOT_SUPPORTED; + MessageContainer responseContainer; + + StartWasteEmptyingResponse response = START_WASTE_EMPTYING_RESPONSE__INIT; + response.action = FILLING_ACTION__None; + response.has_action = true; + //response.cartridge = LoadCartridgeData(); response.cartridge = LoadCartridgeData(); + + response.cartridge = NULL; + response.has_progresspercentage = true; + response.progresspercentage = 0.0; + response.message = NULL; + + responseContainer = createContainer(MESSAGE_TYPE__StartWasteEmptyingResponse, WasteEmptyingToken, false, &response, &start_waste_emptying_response__pack, &start_waste_emptying_response__get_packed_size); + responseContainer.has_continuous = true; + responseContainer.continuous = true; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + //USBCDCD_sendData(container_buffer, container_size,10); + + SendChars((char*)container_buffer, container_size); + //MessageContainer responseContainer; + + return status; +} + +uint32_t StartWasteEmptyingRequestFunc(MessageContainer* requestContainer) +{ + uint32_t status = NOT_SUPPORTED; + //MessageContainer responseContainer; + +// MachineUpdateInitParams InitParams; + + Report("StartWasteEmptyingRequestFunc",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); + StartWasteEmptyingRequest* request = start_waste_emptying_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + ustrncpy (WasteEmptyingToken, requestContainer->token,36); + + WasteEmptyingUpdate(POWER_OFF_INIT); + start_waste_emptying_request__free_unpacked(request,NULL); + return status; +// case MESSAGE_TYPE__StartWasteEmptyingRequest: + +} uint32_t Waste_CheckState(void) { //check if the waste is ready to run - waste level not above overflow level and no cartridge in the slots @@ -572,6 +623,7 @@ uint32_t Waste_PrepareCallbak(uint32_t IfIndex, uint32_t ReadValue) PrepareReady(Module_Waste,ModuleDone); } Report("Module waste prepare", __FILE__, __LINE__, headready, RpMessage, whsready, 0); + return OK; } uint32_t Waste_Prepare(void) { @@ -581,6 +633,7 @@ uint32_t Waste_Prepare(void) //check that blowers are within 10% of designated flow: WHS, head blowers WasteReadyControlId = AddControlCallback("Cartridge Cover Door", Waste_PrepareCallbak, eOneSecond, TemplateDataReadCBFunction, 0, 0, 0); Report("Module waste prepare", __FILE__, __LINE__, Head_Type, RpMessage, WHS_Type, 0); + return OK; } bool WHS_IsVocPpmOverAlarmLimit() |
