From 16c1f0641e8971895cc9690991c4b3662e8b5988 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Nov 2018 17:33:17 +0200 Subject: fix PID in heaters. waste tank valve in intersegment (bug #323) --- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 2 +- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c | 5 +++-- Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index bee00c049..68bd680a8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -523,7 +523,7 @@ uint32_t MillisecLoop(uint32_t tick) } //ROM_IntMasterEnable(); - //loop_Run_Read_Speed(); - just for testing + return OK; } /****************************************************************************** diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c index d1febd3db..169ae463e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c @@ -284,10 +284,11 @@ uint32_t HeaterRecalculateHeaterParams(uint32_t deviceId, uint32_t new_outputpro } // all numbers are rounded down. better to have carefully calculated numbers - HeaterControl[deviceId].outputproportionalpowerlimit = new_outputproportionalpowerlimit; + if (new_outputproportionalpowerlimit > HeaterControl[deviceId].outputproportionalpowerlimit) + new_outputproportionalpowerlimit = HeaterControl[deviceId].outputproportionalpowerlimit; //mark the time slices for heaters operation as empty / Heater1000 / Heater 200 - DCTimeSliceAllocation[deviceId] = (HeaterControl[deviceId].outputproportionalpowerlimit/*/100*/ * NumberOFSlicesInUse) / 100; + DCTimeSliceAllocation[deviceId] = (new_outputproportionalpowerlimit/*/100*/ * NumberOFSlicesInUse) / 100; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index f9c4c1bc3..2af2f63c0 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -379,6 +379,8 @@ uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId) int Dispenser_i; TimerMotors_t HW_Motor_Id; + Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Waste); + for (Dispenser_i = 0;Dispenser_i < MAX_SYSTEM_DISPENSERS;Dispenser_i++) { HW_Motor_Id = DispenserIdToMotorId[Dispenser_i]; -- cgit v1.3.1 From f8416707278aabcebcccbbe4e1a8a9b5d66e0f82 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 29 Nov 2018 14:58:05 +0200 Subject: advanced PID in thread and heaters - use only with modified congiguration --- .../Embedded_SW/Embedded/Modules/Control/PIDAlgo.c | 36 ++++++++++++++++++++++ .../Embedded_SW/Embedded/Modules/Control/PIDAlgo.h | 4 +++ .../Embedded/Modules/General/GeneralHardware.c | 1 + .../Embedded/Modules/Heaters/Heaters_print.c | 10 ++++-- .../Embedded/Modules/Thread/Thread_print.c | 17 +++++----- 5 files changed, 58 insertions(+), 10 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c b/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c index f37759943..72774461a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.c @@ -36,4 +36,40 @@ float PIDAlgorithmCalculation(float _setPoint,float _mesuredParam , PID_Config_P return output; } +float AdvancedPIDAlgorithmCalculation(float _setPoint,float _mesuredParam , PID_Config_Params *params, float *_pre_error, float *_integral) +{ + float error; + float derivative; + float output; + + //Calculate P,I,D + error = _setPoint - _mesuredParam; + + //In case of error too small then stop integration + if(abs(error) > params->epsilon) + { + *_integral = *_integral + error*params->dt; + } + + derivative = (error - *_pre_error)/params->dt; + float IntegralErrorMultiplier; + float ProportionalErrorMultiplier; + + output = params->Kp*error/params->ProportionalErrorMultiplier + params->Ki**_integral/params->IntegralErrorMultiplier + params->Kd*derivative; + + //Saturation Filter + if(output > params->MAX) + { + output = params->MAX; + } + else if(output < params->MIN) + { + output = params->MIN; + } + + //Update error + *_pre_error = error; + + return output; +} diff --git a/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.h b/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.h index 03c363131..4792be9ec 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.h @@ -12,7 +12,11 @@ typedef struct float Kp; float Kd; float Ki; + float IntegralErrorMultiplier; + float ProportionalErrorMultiplier; + }PID_Config_Params; float PIDAlgorithmCalculation(float _setPoint,float _mesuredParam , PID_Config_Params *params, float *_pre_error, float *_integral); +float AdvancedPIDAlgorithmCalculation(float _setPoint,float _mesuredParam , PID_Config_Params *params, float *_pre_error, float *_integral); #endif /* MODULES_PIDALGO_H_ */ diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index a0ac11d1f..4ad9af903 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -108,6 +108,7 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) { BlowerCfg.enabled = true; BlowerCfg.voltage = request->blowers[0]->voltage; + BlowerCfg.heatingvoltage = request->blowers[0]->heatingvoltage; /*Turn_the_Blower_On();//Turn on with the Default_Voltage if (request->blowers[0]->voltage) Control_Voltage_To_Blower(request->blowers[0]->voltage); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index aa3d695de..4f8edde02 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -145,7 +145,9 @@ void LoadHeaterState(HeaterType HeaterType,HeaterState *HeaterState) HeaterState->has_heatertype = true; HeaterState->heatertype = HeaterType; HeaterState->has_setpoint = true; - HeaterState->setpoint = HeaterCmd[HeaterId].targettemperatue/100; + // HeaterState->setpoint = HeaterCmd[HeaterId].targettemperatue/100; + // if (HeaterType >= HEATER_TYPE__HeaterZone1) + HeaterState->setpoint = DCTimeSliceAllocation[HeaterId]*100/NumberOFSlicesInUse; HeaterState->has_currentvalue = true; HeaterState->currentvalue = TemperatureSensorRead(HeaterId2PT100Id[HeaterId])/100; HeaterState->has_isactive = true; @@ -359,7 +361,9 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue) if (BlowerCfg.enabled == true) { Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.voltage) + if (BlowerCfg.heatingvoltage) + Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); + else Control_Voltage_To_Blower(BlowerCfg.voltage-500); } @@ -653,7 +657,7 @@ uint32_t DCHeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) // Report(logmsg[index],__FILE__,__LINE__,index,RpWarning,index, Counter[index]); // #warning PID is now only proportional (above) if (printindex==index) - Report(heatstr,__FILE__,__LINE__,index,RpWarning,readValue, HeaterPIDConfig[index].m_calculatedError); + Report(heatstr,__FILE__,__LINE__,index,RpWarning,HeaterPIDConfig[index].m_calculatedError,0); HeaterRecalculateHeaterParams(index, (int)(HeaterPIDConfig[index].m_calculatedError/100)); } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 5390ed0a7..15ea5157b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -319,7 +319,7 @@ uint32_t ThreadControlSpeedReadFunction(uint32_t IfIndex, uint32_t ReadValue) #define MAX_THREAD_CONTROL_LOG 300 double calculatedError[MAX_THREAD_CONTROL_LOG+1]; double NormError[MAX_THREAD_CONTROL_LOG+1]; -double Integral[MAX_THREAD_CONTROL_LOG+1]; +double mIntegral[MAX_THREAD_CONTROL_LOG+1]; int MotorId[MAX_THREAD_CONTROL_LOG+1]; int readValue[MAX_THREAD_CONTROL_LOG+1]; int AveragereadValue[MAX_THREAD_CONTROL_LOG+1]; @@ -452,13 +452,13 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //EndState(CurrentJob,Message ); SegmentReady(Module_Thread,ModuleFail); AlarmHandlingSetAlarm(EVENT_TYPE__ThreadTensionControlFailure,true); - LOG_ERROR (index, "Dancer Failure"); + LOG_ERROR (DancerId, "Dancer Failure"); return OK; } NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index]; MotorControlConfig[index].m_mesuredParam = NormalizedError; DancerError[DancerId] = NormalizedError; - MotorControlConfig[index].m_calculatedError = PIDAlgorithmCalculation((float)MotorControlConfig[index].m_SetParam , (float)MotorControlConfig[index].m_mesuredParam, + MotorControlConfig[index].m_calculatedError = AdvancedPIDAlgorithmCalculation((float)MotorControlConfig[index].m_SetParam , (float)MotorControlConfig[index].m_mesuredParam, &MotorControlConfig[index].m_params, &MotorControlConfig[index].m_preError, &MotorControlConfig[index].m_integral); if (index != FEEDER_MOTOR) //feeder unit handles errors opposite to left unit { @@ -478,9 +478,10 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) readValue[controlIndex] = ReadValue; AveragereadValue[controlIndex] = avreageSampleValue; calculatedspeed[controlIndex] = calculated_speed; + NormError[controlIndex] + = MotorControlConfig[index].m_mesuredParam; + mIntegral[controlIndex] = MotorControlConfig[index].m_integral; timestamp[controlIndex] = msec_millisecondCounter; - NormError[controlIndex]= NormalizedError; - Integral[controlIndex] = MotorControlConfig[index].m_integral; if (controlIndex++>=MAX_THREAD_CONTROL_LOG) controlIndex = 0; } @@ -555,8 +556,10 @@ uint32_t ThreadEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue) MotorControlConfig[Motor_i].m_params.Kd = MotorsControl[Pid_Id].derivativetime; MotorControlConfig[Motor_i].m_params.Kp = MotorsControl[Pid_Id].proportionalgain; MotorControlConfig[Motor_i].m_params.Ki = MotorsControl[Pid_Id].integraltime; - MotorControlConfig[Motor_i].m_params.epsilon = 0.1; - MotorControlConfig[Motor_i].m_params.dt = 1000; + MotorControlConfig[Motor_i].m_params.IntegralErrorMultiplier = MotorsControl[Pid_Id].setpointramprateorsoftstartramp; + MotorControlConfig[Motor_i].m_params.ProportionalErrorMultiplier = MotorsControl[Pid_Id].outputonoffhysteresisvalue; + MotorControlConfig[Motor_i].m_params.epsilon = MotorsControl[Pid_Id].epsilon; + MotorControlConfig[Motor_i].m_params.dt = MotorsControl[Pid_Id].controloutputtype; MotorControlConfig[Motor_i].m_calculatedError = 0; MotorControlConfig[Motor_i].m_integral = 0; MotorControlConfig[Motor_i].m_isEnabled = true; -- cgit v1.3.1 From 2cbc3deb559323ac366e84b3e0ba40d27447347e Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 2 Dec 2018 14:24:44 +0200 Subject: 1.1.5.1 Thread jogging, thread PID preparation, --- .../Embedded/Common/SWUpdate/FileSystem.c | 124 +++++++++---------- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded_SW/Embedded/Communication/Container.c | 6 + .../PMR/IO/ActivateVersionRequest.pb-c.c | 92 +++++++++++++++ .../PMR/IO/ActivateVersionRequest.pb-c.h | 73 ++++++++++++ .../PMR/IO/ActivateVersionResponse.pb-c.c | 72 +++++++++++ .../PMR/IO/ActivateVersionResponse.pb-c.h | 70 +++++++++++ .../PMR/IO/FileChunkDownloadRequest.pb-c.c | 131 +++++++++++++++++++++ .../PMR/IO/FileChunkDownloadRequest.pb-c.h | 76 ++++++++++++ .../PMR/IO/FileChunkDownloadResponse.pb-c.c | 105 +++++++++++++++++ .../PMR/IO/FileChunkDownloadResponse.pb-c.h | 74 ++++++++++++ .../PMR/IO/FileDownloadRequest.pb-c.c | 92 +++++++++++++++ .../PMR/IO/FileDownloadRequest.pb-c.h | 71 +++++++++++ .../PMR/IO/FileDownloadResponse.pb-c.c | 105 +++++++++++++++++ .../PMR/IO/FileDownloadResponse.pb-c.h | 73 ++++++++++++ .../PMR/IO/GetStorageInfoResponse.pb-c.c | 19 ++- .../PMR/IO/GetStorageInfoResponse.pb-c.h | 3 +- .../PMR/IO/ValidateVersionRequest.pb-c.c | 92 +++++++++++++++ .../PMR/IO/ValidateVersionRequest.pb-c.h | 73 ++++++++++++ .../PMR/IO/ValidateVersionResponse.pb-c.c | 72 +++++++++++ .../PMR/IO/ValidateVersionResponse.pb-c.h | 70 +++++++++++ .../PMR/IO/VersionFileDescriptor.pb-c.c | 131 +++++++++++++++++++++ .../PMR/IO/VersionFileDescriptor.pb-c.h | 77 ++++++++++++ .../PMR/IO/VersionFileDestination.pb-c.c | 41 +++++++ .../PMR/IO/VersionFileDestination.pb-c.h | 45 +++++++ .../Communication/PMR/Printing/JobTicket.pb-c.c | 4 +- .../Embedded_SW/Embedded/Modules/General/process.c | 4 +- .../Embedded_SW/Embedded/Modules/General/process.h | 2 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 3 +- .../Embedded/Modules/Thread/Thread_print.c | 2 +- .../Embedded/StateMachines/Printing/JobSTM.c | 110 +++++++++++++++++ .../Embedded/StateMachines/Printing/PrintingSTM.h | 3 + Software/PMR/Messages/Common/ErrorCode.proto | 2 +- 33 files changed, 1838 insertions(+), 81 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 3a6a6f924..6b7e816c4 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -41,20 +41,16 @@ int FileReceivedLength = 0; static char g_cCwdBuf[50] = "/"; uint32_t WrittenBytes = 0; -/*ErrorCode FileError_to_ErrorCode[FILE_ERRORS_MAX+1] = {ERROR_CODE__NONE,ERROR_CODE__JOB_UNSPECIFIED_ERROR,ERROR_CODE__JOB_THREAD_BREAK,ERROR_CODE__JOB_WINDER_DANCER_FAIL, - ERROR_CODE__JOB_POOLER_DANCER_FAIL,ERROR_CODE__JOB_FEEDER_DANCER_FAIL,ERROR_CODE__JOB_OUT_OF_DYE,ERROR_CODE__JOB_OTHER_ALARM, - ERROR_CODE__JOB_TEMPERATURE_ALARM,ERROR_CODE__JOB_LS_ALARM,ERROR_CODE__JOB_PRESSURE_ALARM,ERROR_CODE__JOB_CURRENT_ALARM,ERROR_CODE__JOB_MOTOR_ALARM}; -*/ +ErrorCode FileError_to_ErrorCode[FR_INVALID_PARAMETER+1] = {ERROR_CODE__NONE,ERROR_CODE__FILE_REQUEST_DISK_ERR,ERROR_CODE__FILE_REQUEST_INT_ERR,ERROR_CODE__FILE_REQUEST_NOT_READY,ERROR_CODE__FILE_REQUEST_NO_FILE, + ERROR_CODE__FILE_REQUEST_NO_PATH,ERROR_CODE__FILE_REQUEST_INVALID_NAME,ERROR_CODE__FILE_REQUEST_DENIED,ERROR_CODE__FILE_REQUEST_EXIST,ERROR_CODE__FILE_REQUEST_INVALID_OBJECT, + ERROR_CODE__FILE_REQUEST_WRITE_PROTECTED,ERROR_CODE__FILE_REQUEST_INVALID_DRIVE,ERROR_CODE__FILE_REQUEST_NOT_ENABLED,ERROR_CODE__FILE_REQUEST_NO_FILESYSTEM, + ERROR_CODE__FILE_REQUEST_MKFS_ABORTED,ERROR_CODE__FILE_REQUEST_TIMEOUT,ERROR_CODE__FILE_REQUEST_LOCKED,ERROR_CODE__FILE_REQUEST_NOT_ENOUGH_CORE,ERROR_CODE__FILE_REQUEST_TOO_MANY_OPEN_FILES, + ERROR_CODE__FILE_REQUEST_INVALID_PARAMETER}; + ErrorCode getErrorCode(FRESULT Fresult) { - switch (Fresult) - { - case FR_OK: - return ERROR_CODE__NONE; - default: - return ERROR_CODE__FILE_LENGTH_OUT_OF_RANGE; - } + return FileError_to_ErrorCode[Fresult]; } bool isDirectory(FileAttribute FileAtt) { @@ -97,8 +93,8 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__FileUploadResponse, requestContainer->token, false, &response, &file_upload_response__pack, &file_upload_response__get_packed_size); if (Fresult!= FR_OK) { - responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; - responseContainer.errormessage = "JOb Active or incorrect parameters"; + responseContainer.error = getErrorCode(Fresult); + responseContainer.errormessage = "File operation error"; } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -130,10 +126,6 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) //if (ReceivedFileHandle == FileHandle) //{ Fresult = f_write(ReceivedFileHandle,request->buffer.data,request->buffer.len,&WrittenBytes ); -// FIL *fp, /* Pointer to the file object */ -// const void *buff, /* Pointer to the data to be written */ -// UINT btw, /* Number of bytes to write */ -// UINT *bw /* Pointer to number of bytes written */ if(Fresult != FR_OK) { LOG_ERROR (Fresult,"f_write error"); @@ -167,10 +159,10 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) }*/ responseContainer = createContainer(MESSAGE_TYPE__FileChunkUploadResponse, requestContainer->token, false, &response, &file_chunk_upload_response__pack, &file_chunk_upload_response__get_packed_size); - if (status!= OK) + if (Fresult!= OK) { - responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; - responseContainer.errormessage = "JOb Active or incorrect parameters"; + responseContainer.error = getErrorCode(Fresult); + responseContainer.errormessage = "File operation error"; } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -195,8 +187,8 @@ uint32_t ExecuteProcessRequestFunc(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__ExecuteProcessResponse, requestContainer->token, false, &response, &execute_process_response__pack, &execute_process_response__get_packed_size); if (status!= OK) { - responseContainer.error = ERROR_CODE__FILE_NOT_FOUND; - responseContainer.errormessage = "JOb Active or incorrect parameters"; + responseContainer.error = ERROR_CODE__GENERAL_ERROR;//getErrorCode(Fresult); + responseContainer.errormessage = "File operation error"; } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -221,8 +213,8 @@ uint32_t KillProcessRequestFunc(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__KillProcessResponse, requestContainer->token, false, &response, &kill_process_response__pack, &kill_process_response__get_packed_size); if (status!= OK) { - responseContainer.error = ERROR_CODE__FILE_NOT_FOUND; - responseContainer.errormessage = "JOb Active or incorrect parameters"; + responseContainer.error = ERROR_CODE__GENERAL_ERROR;//getErrorCode(Fresult); + responseContainer.errormessage = "File operation error"; } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -273,10 +265,10 @@ uint32_t CreateRequestFunc(MessageContainer* requestContainer) free (FileHandle); responseContainer = createContainer(MESSAGE_TYPE__CreateResponse, requestContainer->token, false, &response, &create_response__pack, &create_response__get_packed_size); - if (status!= OK) + if (Fresult!= OK) { - responseContainer.error = ERROR_CODE__FILE_NOT_FOUND; - responseContainer.errormessage = ErrorMsg; + responseContainer.error = getErrorCode(Fresult); + responseContainer.errormessage = "File operation error"; } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -305,51 +297,49 @@ uint32_t DeleteRequestFunc(MessageContainer* requestContainer) Fresult |= f_opendir(&dir, g_cCwdBuf); if(Fresult != FR_OK) { - return(Fresult); + LOG_ERROR (Fresult,"f_write error"); } - - fno = my_malloc(sizeof(FILINFO)); - memset (fno,0,sizeof(FILINFO)); - Fresult = f_stat(request->path,fno); - if (Fresult == FR_OK) + else { - if (isDirectory(fno->fattrib)) + + fno = my_malloc(sizeof(FILINFO)); + memset (fno,0,sizeof(FILINFO)); + Fresult = f_stat(request->path,fno); + if (Fresult == FR_OK) { - //============================ - Fresult = f_opendir(&dir, request->path); /* Open the directory */ - if (Fresult == FR_OK) - { - Fresult = f_readdir(&dir, &fno); /* Read a directory item */ + if (isDirectory(fno->fattrib)) + { + //============================ + Fresult = f_opendir(&dir, request->path); /* Open the directory */ if (Fresult == FR_OK) { - if(fno->fname[0] ==0) - { - //no files - Fresult = f_unlink(request->path); - } - else + Fresult = f_readdir(&dir, &fno); /* Read a directory item */ + if (Fresult == FR_OK) { - LOG_ERROR (fno,"Directory not empty"); + if(fno->fname[0] ==0) + { + //no files + Fresult = f_unlink(request->path); + } + else + { + LOG_ERROR (fno,"Directory not empty"); + } } } - } - } - else - { - Fresult = f_unlink(request->path); + } + else + { + Fresult = f_unlink(request->path); + } } } - if (Fresult != FR_OK) - { - status = ERROR_CODE__FILE_NOT_FOUND; - usnprintf(ErrorMsg, 100, "File Operation failed error code %d",Fresult); - } - responseContainer = createContainer(MESSAGE_TYPE__DeleteResponse, requestContainer->token, false, &response, &delete_response__pack, &delete_response__get_packed_size); - if (status!= OK) + if (Fresult!= OK) { - responseContainer.error = ERROR_CODE__FILE_NOT_FOUND; - responseContainer.errormessage = "JOb Active or incorrect parameters"; + usnprintf(ErrorMsg, 100, "File Operation failed error code %d",Fresult); + responseContainer.error = getErrorCode(Fresult); + responseContainer.errormessage = ErrorMsg; } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -391,10 +381,10 @@ uint32_t GetStorageInfoRequestFunc(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__GetStorageInfoResponse, requestContainer->token, false, &response, &get_storage_info_response__pack, &get_storage_info_response__get_packed_size); - if (status!= OK) + if (Fresult!= OK) { - responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; - responseContainer.errormessage = "JOb Active or incorrect parameters"; + responseContainer.error = getErrorCode(Fresult); + responseContainer.errormessage = "File operation error"; } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -490,10 +480,10 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) } responseContainer = createContainer(MESSAGE_TYPE__GetFilesResponse, requestContainer->token, false, &response, &get_files_response__pack, &get_files_response__get_packed_size); - if (status!= OK) + if (Fresult!= OK) { - responseContainer.error = ERROR_CODE__FILE_NOT_FOUND; - responseContainer.errormessage = "JOb Active or incorrect parameters"; + responseContainer.error = getErrorCode(Fresult); + responseContainer.errormessage = "File operation error"; } responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -507,5 +497,5 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) if (fno[i]) my_free (fno[i]); } - return OK; + return Fresult; } diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index e193938d3..bc27771a2 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {001,001,005,000}; +TangoVersion_t _gTangoVersion = {001,001,005,001}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 100dba7a8..7b5e44860 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -312,6 +312,12 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__SetDigitalOutRequest: SetDigitalOutRequestRequestFunc(requestContainer); break; + case MESSAGE_TYPE__ThreadJoggingRequest: + ThreadJoggingRequestFunc(requestContainer); + break; + case MESSAGE_TYPE__ThreadAbortJoggingRequest: + ThreadAbortJoggingRequestFunc(requestContainer); + break; case MESSAGE_TYPE__StubI2CReadBytesRequest: Stub_I2CReadBytesRequest(requestContainer); break; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.c new file mode 100644 index 000000000..3602f7f9e --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ActivateVersionRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ActivateVersionRequest.pb-c.h" +void activate_version_request__init + (ActivateVersionRequest *message) +{ + static const ActivateVersionRequest init_value = ACTIVATE_VERSION_REQUEST__INIT; + *message = init_value; +} +size_t activate_version_request__get_packed_size + (const ActivateVersionRequest *message) +{ + assert(message->base.descriptor == &activate_version_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t activate_version_request__pack + (const ActivateVersionRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &activate_version_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t activate_version_request__pack_to_buffer + (const ActivateVersionRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &activate_version_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ActivateVersionRequest * + activate_version_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ActivateVersionRequest *) + protobuf_c_message_unpack (&activate_version_request__descriptor, + allocator, len, data); +} +void activate_version_request__free_unpacked + (ActivateVersionRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &activate_version_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor activate_version_request__field_descriptors[1] = +{ + { + "FileDescriptors", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(ActivateVersionRequest, n_filedescriptors), + offsetof(ActivateVersionRequest, filedescriptors), + &version_file_descriptor__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned activate_version_request__field_indices_by_name[] = { + 0, /* field[0] = FileDescriptors */ +}; +static const ProtobufCIntRange activate_version_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor activate_version_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ActivateVersionRequest", + "ActivateVersionRequest", + "ActivateVersionRequest", + "", + sizeof(ActivateVersionRequest), + 1, + activate_version_request__field_descriptors, + activate_version_request__field_indices_by_name, + 1, activate_version_request__number_ranges, + (ProtobufCMessageInit) activate_version_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.h new file mode 100644 index 000000000..90fe6479d --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionRequest.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ActivateVersionRequest.proto */ + +#ifndef PROTOBUF_C_ActivateVersionRequest_2eproto__INCLUDED +#define PROTOBUF_C_ActivateVersionRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "VersionFileDescriptor.pb-c.h" + +typedef struct _ActivateVersionRequest ActivateVersionRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ActivateVersionRequest +{ + ProtobufCMessage base; + size_t n_filedescriptors; + VersionFileDescriptor **filedescriptors; +}; +#define ACTIVATE_VERSION_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&activate_version_request__descriptor) \ + , 0,NULL } + + +/* ActivateVersionRequest methods */ +void activate_version_request__init + (ActivateVersionRequest *message); +size_t activate_version_request__get_packed_size + (const ActivateVersionRequest *message); +size_t activate_version_request__pack + (const ActivateVersionRequest *message, + uint8_t *out); +size_t activate_version_request__pack_to_buffer + (const ActivateVersionRequest *message, + ProtobufCBuffer *buffer); +ActivateVersionRequest * + activate_version_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void activate_version_request__free_unpacked + (ActivateVersionRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ActivateVersionRequest_Closure) + (const ActivateVersionRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor activate_version_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ActivateVersionRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.c new file mode 100644 index 000000000..6f54f8708 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ActivateVersionResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ActivateVersionResponse.pb-c.h" +void activate_version_response__init + (ActivateVersionResponse *message) +{ + static const ActivateVersionResponse init_value = ACTIVATE_VERSION_RESPONSE__INIT; + *message = init_value; +} +size_t activate_version_response__get_packed_size + (const ActivateVersionResponse *message) +{ + assert(message->base.descriptor == &activate_version_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t activate_version_response__pack + (const ActivateVersionResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &activate_version_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t activate_version_response__pack_to_buffer + (const ActivateVersionResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &activate_version_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ActivateVersionResponse * + activate_version_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ActivateVersionResponse *) + protobuf_c_message_unpack (&activate_version_response__descriptor, + allocator, len, data); +} +void activate_version_response__free_unpacked + (ActivateVersionResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &activate_version_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define activate_version_response__field_descriptors NULL +#define activate_version_response__field_indices_by_name NULL +#define activate_version_response__number_ranges NULL +const ProtobufCMessageDescriptor activate_version_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ActivateVersionResponse", + "ActivateVersionResponse", + "ActivateVersionResponse", + "", + sizeof(ActivateVersionResponse), + 0, + activate_version_response__field_descriptors, + activate_version_response__field_indices_by_name, + 0, activate_version_response__number_ranges, + (ProtobufCMessageInit) activate_version_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.h new file mode 100644 index 000000000..10dc41bcb --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ActivateVersionResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ActivateVersionResponse.proto */ + +#ifndef PROTOBUF_C_ActivateVersionResponse_2eproto__INCLUDED +#define PROTOBUF_C_ActivateVersionResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _ActivateVersionResponse ActivateVersionResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ActivateVersionResponse +{ + ProtobufCMessage base; +}; +#define ACTIVATE_VERSION_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&activate_version_response__descriptor) \ + } + + +/* ActivateVersionResponse methods */ +void activate_version_response__init + (ActivateVersionResponse *message); +size_t activate_version_response__get_packed_size + (const ActivateVersionResponse *message); +size_t activate_version_response__pack + (const ActivateVersionResponse *message, + uint8_t *out); +size_t activate_version_response__pack_to_buffer + (const ActivateVersionResponse *message, + ProtobufCBuffer *buffer); +ActivateVersionResponse * + activate_version_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void activate_version_response__free_unpacked + (ActivateVersionResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ActivateVersionResponse_Closure) + (const ActivateVersionResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor activate_version_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ActivateVersionResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.c new file mode 100644 index 000000000..44c892aec --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FileChunkDownloadRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "FileChunkDownloadRequest.pb-c.h" +void file_chunk_download_request__init + (FileChunkDownloadRequest *message) +{ + static const FileChunkDownloadRequest init_value = FILE_CHUNK_DOWNLOAD_REQUEST__INIT; + *message = init_value; +} +size_t file_chunk_download_request__get_packed_size + (const FileChunkDownloadRequest *message) +{ + assert(message->base.descriptor == &file_chunk_download_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t file_chunk_download_request__pack + (const FileChunkDownloadRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &file_chunk_download_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t file_chunk_download_request__pack_to_buffer + (const FileChunkDownloadRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &file_chunk_download_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +FileChunkDownloadRequest * + file_chunk_download_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (FileChunkDownloadRequest *) + protobuf_c_message_unpack (&file_chunk_download_request__descriptor, + allocator, len, data); +} +void file_chunk_download_request__free_unpacked + (FileChunkDownloadRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &file_chunk_download_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor file_chunk_download_request__field_descriptors[4] = +{ + { + "DownloadID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(FileChunkDownloadRequest, downloadid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "FileName", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(FileChunkDownloadRequest, filename), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Position", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT64, + offsetof(FileChunkDownloadRequest, has_position), + offsetof(FileChunkDownloadRequest, position), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "IsCanceled", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(FileChunkDownloadRequest, has_iscanceled), + offsetof(FileChunkDownloadRequest, iscanceled), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned file_chunk_download_request__field_indices_by_name[] = { + 0, /* field[0] = DownloadID */ + 1, /* field[1] = FileName */ + 3, /* field[3] = IsCanceled */ + 2, /* field[2] = Position */ +}; +static const ProtobufCIntRange file_chunk_download_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor file_chunk_download_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "FileChunkDownloadRequest", + "FileChunkDownloadRequest", + "FileChunkDownloadRequest", + "", + sizeof(FileChunkDownloadRequest), + 4, + file_chunk_download_request__field_descriptors, + file_chunk_download_request__field_indices_by_name, + 1, file_chunk_download_request__number_ranges, + (ProtobufCMessageInit) file_chunk_download_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h new file mode 100644 index 000000000..1de5229cd --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadRequest.pb-c.h @@ -0,0 +1,76 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FileChunkDownloadRequest.proto */ + +#ifndef PROTOBUF_C_FileChunkDownloadRequest_2eproto__INCLUDED +#define PROTOBUF_C_FileChunkDownloadRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _FileChunkDownloadRequest FileChunkDownloadRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _FileChunkDownloadRequest +{ + ProtobufCMessage base; + char *downloadid; + char *filename; + protobuf_c_boolean has_position; + int64_t position; + protobuf_c_boolean has_iscanceled; + protobuf_c_boolean iscanceled; +}; +#define FILE_CHUNK_DOWNLOAD_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&file_chunk_download_request__descriptor) \ + , NULL, NULL, 0, 0, 0, 0 } + + +/* FileChunkDownloadRequest methods */ +void file_chunk_download_request__init + (FileChunkDownloadRequest *message); +size_t file_chunk_download_request__get_packed_size + (const FileChunkDownloadRequest *message); +size_t file_chunk_download_request__pack + (const FileChunkDownloadRequest *message, + uint8_t *out); +size_t file_chunk_download_request__pack_to_buffer + (const FileChunkDownloadRequest *message, + ProtobufCBuffer *buffer); +FileChunkDownloadRequest * + file_chunk_download_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void file_chunk_download_request__free_unpacked + (FileChunkDownloadRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*FileChunkDownloadRequest_Closure) + (const FileChunkDownloadRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor file_chunk_download_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_FileChunkDownloadRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadResponse.pb-c.c new file mode 100644 index 000000000..f846a56b9 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FileChunkDownloadResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "FileChunkDownloadResponse.pb-c.h" +void file_chunk_download_response__init + (FileChunkDownloadResponse *message) +{ + static const FileChunkDownloadResponse init_value = FILE_CHUNK_DOWNLOAD_RESPONSE__INIT; + *message = init_value; +} +size_t file_chunk_download_response__get_packed_size + (const FileChunkDownloadResponse *message) +{ + assert(message->base.descriptor == &file_chunk_download_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t file_chunk_download_response__pack + (const FileChunkDownloadResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &file_chunk_download_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t file_chunk_download_response__pack_to_buffer + (const FileChunkDownloadResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &file_chunk_download_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +FileChunkDownloadResponse * + file_chunk_download_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (FileChunkDownloadResponse *) + protobuf_c_message_unpack (&file_chunk_download_response__descriptor, + allocator, len, data); +} +void file_chunk_download_response__free_unpacked + (FileChunkDownloadResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &file_chunk_download_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor file_chunk_download_response__field_descriptors[2] = +{ + { + "Buffer", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BYTES, + offsetof(FileChunkDownloadResponse, has_buffer), + offsetof(FileChunkDownloadResponse, buffer), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "IsCanceled", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(FileChunkDownloadResponse, has_iscanceled), + offsetof(FileChunkDownloadResponse, iscanceled), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned file_chunk_download_response__field_indices_by_name[] = { + 0, /* field[0] = Buffer */ + 1, /* field[1] = IsCanceled */ +}; +static const ProtobufCIntRange file_chunk_download_response__number_ranges[1 + 1] = +{ + { 2, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor file_chunk_download_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "FileChunkDownloadResponse", + "FileChunkDownloadResponse", + "FileChunkDownloadResponse", + "", + sizeof(FileChunkDownloadResponse), + 2, + file_chunk_download_response__field_descriptors, + file_chunk_download_response__field_indices_by_name, + 1, file_chunk_download_response__number_ranges, + (ProtobufCMessageInit) file_chunk_download_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadResponse.pb-c.h new file mode 100644 index 000000000..7461554c3 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileChunkDownloadResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FileChunkDownloadResponse.proto */ + +#ifndef PROTOBUF_C_FileChunkDownloadResponse_2eproto__INCLUDED +#define PROTOBUF_C_FileChunkDownloadResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _FileChunkDownloadResponse FileChunkDownloadResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _FileChunkDownloadResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_buffer; + ProtobufCBinaryData buffer; + protobuf_c_boolean has_iscanceled; + protobuf_c_boolean iscanceled; +}; +#define FILE_CHUNK_DOWNLOAD_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&file_chunk_download_response__descriptor) \ + , 0, {0,NULL}, 0, 0 } + + +/* FileChunkDownloadResponse methods */ +void file_chunk_download_response__init + (FileChunkDownloadResponse *message); +size_t file_chunk_download_response__get_packed_size + (const FileChunkDownloadResponse *message); +size_t file_chunk_download_response__pack + (const FileChunkDownloadResponse *message, + uint8_t *out); +size_t file_chunk_download_response__pack_to_buffer + (const FileChunkDownloadResponse *message, + ProtobufCBuffer *buffer); +FileChunkDownloadResponse * + file_chunk_download_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void file_chunk_download_response__free_unpacked + (FileChunkDownloadResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*FileChunkDownloadResponse_Closure) + (const FileChunkDownloadResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor file_chunk_download_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_FileChunkDownloadResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadRequest.pb-c.c new file mode 100644 index 000000000..b128e2d76 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FileDownloadRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "FileDownloadRequest.pb-c.h" +void file_download_request__init + (FileDownloadRequest *message) +{ + static const FileDownloadRequest init_value = FILE_DOWNLOAD_REQUEST__INIT; + *message = init_value; +} +size_t file_download_request__get_packed_size + (const FileDownloadRequest *message) +{ + assert(message->base.descriptor == &file_download_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t file_download_request__pack + (const FileDownloadRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &file_download_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t file_download_request__pack_to_buffer + (const FileDownloadRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &file_download_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +FileDownloadRequest * + file_download_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (FileDownloadRequest *) + protobuf_c_message_unpack (&file_download_request__descriptor, + allocator, len, data); +} +void file_download_request__free_unpacked + (FileDownloadRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &file_download_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor file_download_request__field_descriptors[1] = +{ + { + "FileName", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(FileDownloadRequest, filename), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned file_download_request__field_indices_by_name[] = { + 0, /* field[0] = FileName */ +}; +static const ProtobufCIntRange file_download_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor file_download_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "FileDownloadRequest", + "FileDownloadRequest", + "FileDownloadRequest", + "", + sizeof(FileDownloadRequest), + 1, + file_download_request__field_descriptors, + file_download_request__field_indices_by_name, + 1, file_download_request__number_ranges, + (ProtobufCMessageInit) file_download_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadRequest.pb-c.h new file mode 100644 index 000000000..9be5758e5 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadRequest.pb-c.h @@ -0,0 +1,71 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FileDownloadRequest.proto */ + +#ifndef PROTOBUF_C_FileDownloadRequest_2eproto__INCLUDED +#define PROTOBUF_C_FileDownloadRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _FileDownloadRequest FileDownloadRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _FileDownloadRequest +{ + ProtobufCMessage base; + char *filename; +}; +#define FILE_DOWNLOAD_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&file_download_request__descriptor) \ + , NULL } + + +/* FileDownloadRequest methods */ +void file_download_request__init + (FileDownloadRequest *message); +size_t file_download_request__get_packed_size + (const FileDownloadRequest *message); +size_t file_download_request__pack + (const FileDownloadRequest *message, + uint8_t *out); +size_t file_download_request__pack_to_buffer + (const FileDownloadRequest *message, + ProtobufCBuffer *buffer); +FileDownloadRequest * + file_download_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void file_download_request__free_unpacked + (FileDownloadRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*FileDownloadRequest_Closure) + (const FileDownloadRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor file_download_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_FileDownloadRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadResponse.pb-c.c new file mode 100644 index 000000000..ece764223 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FileDownloadResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "FileDownloadResponse.pb-c.h" +void file_download_response__init + (FileDownloadResponse *message) +{ + static const FileDownloadResponse init_value = FILE_DOWNLOAD_RESPONSE__INIT; + *message = init_value; +} +size_t file_download_response__get_packed_size + (const FileDownloadResponse *message) +{ + assert(message->base.descriptor == &file_download_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t file_download_response__pack + (const FileDownloadResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &file_download_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t file_download_response__pack_to_buffer + (const FileDownloadResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &file_download_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +FileDownloadResponse * + file_download_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (FileDownloadResponse *) + protobuf_c_message_unpack (&file_download_response__descriptor, + allocator, len, data); +} +void file_download_response__free_unpacked + (FileDownloadResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &file_download_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor file_download_response__field_descriptors[2] = +{ + { + "DownloadID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(FileDownloadResponse, downloadid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MaxChunkLength", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT64, + offsetof(FileDownloadResponse, has_maxchunklength), + offsetof(FileDownloadResponse, maxchunklength), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned file_download_response__field_indices_by_name[] = { + 0, /* field[0] = DownloadID */ + 1, /* field[1] = MaxChunkLength */ +}; +static const ProtobufCIntRange file_download_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor file_download_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "FileDownloadResponse", + "FileDownloadResponse", + "FileDownloadResponse", + "", + sizeof(FileDownloadResponse), + 2, + file_download_response__field_descriptors, + file_download_response__field_indices_by_name, + 1, file_download_response__number_ranges, + (ProtobufCMessageInit) file_download_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadResponse.pb-c.h new file mode 100644 index 000000000..9f8bcfb2d --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/FileDownloadResponse.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FileDownloadResponse.proto */ + +#ifndef PROTOBUF_C_FileDownloadResponse_2eproto__INCLUDED +#define PROTOBUF_C_FileDownloadResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _FileDownloadResponse FileDownloadResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _FileDownloadResponse +{ + ProtobufCMessage base; + char *downloadid; + protobuf_c_boolean has_maxchunklength; + int64_t maxchunklength; +}; +#define FILE_DOWNLOAD_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&file_download_response__descriptor) \ + , NULL, 0, 0 } + + +/* FileDownloadResponse methods */ +void file_download_response__init + (FileDownloadResponse *message); +size_t file_download_response__get_packed_size + (const FileDownloadResponse *message); +size_t file_download_response__pack + (const FileDownloadResponse *message, + uint8_t *out); +size_t file_download_response__pack_to_buffer + (const FileDownloadResponse *message, + ProtobufCBuffer *buffer); +FileDownloadResponse * + file_download_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void file_download_response__free_unpacked + (FileDownloadResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*FileDownloadResponse_Closure) + (const FileDownloadResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor file_download_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_FileDownloadResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.c index 0ba9d355f..864b46201 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.c @@ -52,7 +52,7 @@ void get_storage_info_response__free_unpacked assert(message->base.descriptor == &get_storage_info_response__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor get_storage_info_response__field_descriptors[2] = +static const ProtobufCFieldDescriptor get_storage_info_response__field_descriptors[3] = { { "Capacity", @@ -78,15 +78,28 @@ static const ProtobufCFieldDescriptor get_storage_info_response__field_descripto 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "Root", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(GetStorageInfoResponse, root), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned get_storage_info_response__field_indices_by_name[] = { 0, /* field[0] = Capacity */ 1, /* field[1] = FreeSpace */ + 2, /* field[2] = Root */ }; static const ProtobufCIntRange get_storage_info_response__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 3 } }; const ProtobufCMessageDescriptor get_storage_info_response__descriptor = { @@ -96,7 +109,7 @@ const ProtobufCMessageDescriptor get_storage_info_response__descriptor = "GetStorageInfoResponse", "", sizeof(GetStorageInfoResponse), - 2, + 3, get_storage_info_response__field_descriptors, get_storage_info_response__field_indices_by_name, 1, get_storage_info_response__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.h index 778512d4f..beda98113 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/GetStorageInfoResponse.pb-c.h @@ -30,10 +30,11 @@ struct _GetStorageInfoResponse int32_t capacity; protobuf_c_boolean has_freespace; int32_t freespace; + char *root; }; #define GET_STORAGE_INFO_RESPONSE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&get_storage_info_response__descriptor) \ - , 0, 0, 0, 0 } + , 0, 0, 0, 0, NULL } /* GetStorageInfoResponse methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.c new file mode 100644 index 000000000..f42b94737 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ValidateVersionRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ValidateVersionRequest.pb-c.h" +void validate_version_request__init + (ValidateVersionRequest *message) +{ + static const ValidateVersionRequest init_value = VALIDATE_VERSION_REQUEST__INIT; + *message = init_value; +} +size_t validate_version_request__get_packed_size + (const ValidateVersionRequest *message) +{ + assert(message->base.descriptor == &validate_version_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t validate_version_request__pack + (const ValidateVersionRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &validate_version_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t validate_version_request__pack_to_buffer + (const ValidateVersionRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &validate_version_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ValidateVersionRequest * + validate_version_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ValidateVersionRequest *) + protobuf_c_message_unpack (&validate_version_request__descriptor, + allocator, len, data); +} +void validate_version_request__free_unpacked + (ValidateVersionRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &validate_version_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor validate_version_request__field_descriptors[1] = +{ + { + "FileDescriptors", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(ValidateVersionRequest, n_filedescriptors), + offsetof(ValidateVersionRequest, filedescriptors), + &version_file_descriptor__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned validate_version_request__field_indices_by_name[] = { + 0, /* field[0] = FileDescriptors */ +}; +static const ProtobufCIntRange validate_version_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor validate_version_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ValidateVersionRequest", + "ValidateVersionRequest", + "ValidateVersionRequest", + "", + sizeof(ValidateVersionRequest), + 1, + validate_version_request__field_descriptors, + validate_version_request__field_indices_by_name, + 1, validate_version_request__number_ranges, + (ProtobufCMessageInit) validate_version_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.h new file mode 100644 index 000000000..eeb30902e --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionRequest.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ValidateVersionRequest.proto */ + +#ifndef PROTOBUF_C_ValidateVersionRequest_2eproto__INCLUDED +#define PROTOBUF_C_ValidateVersionRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "VersionFileDescriptor.pb-c.h" + +typedef struct _ValidateVersionRequest ValidateVersionRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ValidateVersionRequest +{ + ProtobufCMessage base; + size_t n_filedescriptors; + VersionFileDescriptor **filedescriptors; +}; +#define VALIDATE_VERSION_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&validate_version_request__descriptor) \ + , 0,NULL } + + +/* ValidateVersionRequest methods */ +void validate_version_request__init + (ValidateVersionRequest *message); +size_t validate_version_request__get_packed_size + (const ValidateVersionRequest *message); +size_t validate_version_request__pack + (const ValidateVersionRequest *message, + uint8_t *out); +size_t validate_version_request__pack_to_buffer + (const ValidateVersionRequest *message, + ProtobufCBuffer *buffer); +ValidateVersionRequest * + validate_version_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void validate_version_request__free_unpacked + (ValidateVersionRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ValidateVersionRequest_Closure) + (const ValidateVersionRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor validate_version_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ValidateVersionRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.c new file mode 100644 index 000000000..9be2cce20 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ValidateVersionResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ValidateVersionResponse.pb-c.h" +void validate_version_response__init + (ValidateVersionResponse *message) +{ + static const ValidateVersionResponse init_value = VALIDATE_VERSION_RESPONSE__INIT; + *message = init_value; +} +size_t validate_version_response__get_packed_size + (const ValidateVersionResponse *message) +{ + assert(message->base.descriptor == &validate_version_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t validate_version_response__pack + (const ValidateVersionResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &validate_version_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t validate_version_response__pack_to_buffer + (const ValidateVersionResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &validate_version_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ValidateVersionResponse * + validate_version_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ValidateVersionResponse *) + protobuf_c_message_unpack (&validate_version_response__descriptor, + allocator, len, data); +} +void validate_version_response__free_unpacked + (ValidateVersionResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &validate_version_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define validate_version_response__field_descriptors NULL +#define validate_version_response__field_indices_by_name NULL +#define validate_version_response__number_ranges NULL +const ProtobufCMessageDescriptor validate_version_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ValidateVersionResponse", + "ValidateVersionResponse", + "ValidateVersionResponse", + "", + sizeof(ValidateVersionResponse), + 0, + validate_version_response__field_descriptors, + validate_version_response__field_indices_by_name, + 0, validate_version_response__number_ranges, + (ProtobufCMessageInit) validate_version_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.h new file mode 100644 index 000000000..0032ec8c9 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/ValidateVersionResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ValidateVersionResponse.proto */ + +#ifndef PROTOBUF_C_ValidateVersionResponse_2eproto__INCLUDED +#define PROTOBUF_C_ValidateVersionResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _ValidateVersionResponse ValidateVersionResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ValidateVersionResponse +{ + ProtobufCMessage base; +}; +#define VALIDATE_VERSION_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&validate_version_response__descriptor) \ + } + + +/* ValidateVersionResponse methods */ +void validate_version_response__init + (ValidateVersionResponse *message); +size_t validate_version_response__get_packed_size + (const ValidateVersionResponse *message); +size_t validate_version_response__pack + (const ValidateVersionResponse *message, + uint8_t *out); +size_t validate_version_response__pack_to_buffer + (const ValidateVersionResponse *message, + ProtobufCBuffer *buffer); +ValidateVersionResponse * + validate_version_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void validate_version_response__free_unpacked + (ValidateVersionResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ValidateVersionResponse_Closure) + (const ValidateVersionResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor validate_version_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ValidateVersionResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.c new file mode 100644 index 000000000..53b9f5bfd --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: VersionFileDescriptor.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "VersionFileDescriptor.pb-c.h" +void version_file_descriptor__init + (VersionFileDescriptor *message) +{ + static const VersionFileDescriptor init_value = VERSION_FILE_DESCRIPTOR__INIT; + *message = init_value; +} +size_t version_file_descriptor__get_packed_size + (const VersionFileDescriptor *message) +{ + assert(message->base.descriptor == &version_file_descriptor__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t version_file_descriptor__pack + (const VersionFileDescriptor *message, + uint8_t *out) +{ + assert(message->base.descriptor == &version_file_descriptor__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t version_file_descriptor__pack_to_buffer + (const VersionFileDescriptor *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &version_file_descriptor__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +VersionFileDescriptor * + version_file_descriptor__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (VersionFileDescriptor *) + protobuf_c_message_unpack (&version_file_descriptor__descriptor, + allocator, len, data); +} +void version_file_descriptor__free_unpacked + (VersionFileDescriptor *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &version_file_descriptor__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor version_file_descriptor__field_descriptors[4] = +{ + { + "FileName", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(VersionFileDescriptor, filename), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Version", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(VersionFileDescriptor, version), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Destination", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(VersionFileDescriptor, has_destination), + offsetof(VersionFileDescriptor, destination), + &version_file_destination__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "CheckSum", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BYTES, + offsetof(VersionFileDescriptor, has_checksum), + offsetof(VersionFileDescriptor, checksum), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned version_file_descriptor__field_indices_by_name[] = { + 3, /* field[3] = CheckSum */ + 2, /* field[2] = Destination */ + 0, /* field[0] = FileName */ + 1, /* field[1] = Version */ +}; +static const ProtobufCIntRange version_file_descriptor__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor version_file_descriptor__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "VersionFileDescriptor", + "VersionFileDescriptor", + "VersionFileDescriptor", + "", + sizeof(VersionFileDescriptor), + 4, + version_file_descriptor__field_descriptors, + version_file_descriptor__field_indices_by_name, + 1, version_file_descriptor__number_ranges, + (ProtobufCMessageInit) version_file_descriptor__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.h new file mode 100644 index 000000000..692dc6722 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDescriptor.pb-c.h @@ -0,0 +1,77 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: VersionFileDescriptor.proto */ + +#ifndef PROTOBUF_C_VersionFileDescriptor_2eproto__INCLUDED +#define PROTOBUF_C_VersionFileDescriptor_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "VersionFileDestination.pb-c.h" + +typedef struct _VersionFileDescriptor VersionFileDescriptor; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _VersionFileDescriptor +{ + ProtobufCMessage base; + char *filename; + char *version; + protobuf_c_boolean has_destination; + VersionFileDestination destination; + protobuf_c_boolean has_checksum; + ProtobufCBinaryData checksum; +}; +#define VERSION_FILE_DESCRIPTOR__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&version_file_descriptor__descriptor) \ + , NULL, NULL, 0, VERSION_FILE_DESTINATION__MCU, 0, {0,NULL} } + + +/* VersionFileDescriptor methods */ +void version_file_descriptor__init + (VersionFileDescriptor *message); +size_t version_file_descriptor__get_packed_size + (const VersionFileDescriptor *message); +size_t version_file_descriptor__pack + (const VersionFileDescriptor *message, + uint8_t *out); +size_t version_file_descriptor__pack_to_buffer + (const VersionFileDescriptor *message, + ProtobufCBuffer *buffer); +VersionFileDescriptor * + version_file_descriptor__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void version_file_descriptor__free_unpacked + (VersionFileDescriptor *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*VersionFileDescriptor_Closure) + (const VersionFileDescriptor *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor version_file_descriptor__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_VersionFileDescriptor_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.c new file mode 100644 index 000000000..3e45ece3e --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.c @@ -0,0 +1,41 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: VersionFileDestination.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "VersionFileDestination.pb-c.h" +static const ProtobufCEnumValue version_file_destination__enum_values_by_number[4] = +{ + { "MCU", "VERSION_FILE_DESTINATION__MCU", 0 }, + { "FPGA1", "VERSION_FILE_DESTINATION__FPGA1", 1 }, + { "FPGA2", "VERSION_FILE_DESTINATION__FPGA2", 2 }, + { "FPGA3", "VERSION_FILE_DESTINATION__FPGA3", 3 }, +}; +static const ProtobufCIntRange version_file_destination__value_ranges[] = { +{0, 0},{0, 4} +}; +static const ProtobufCEnumValueIndex version_file_destination__enum_values_by_name[4] = +{ + { "FPGA1", 1 }, + { "FPGA2", 2 }, + { "FPGA3", 3 }, + { "MCU", 0 }, +}; +const ProtobufCEnumDescriptor version_file_destination__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "VersionFileDestination", + "VersionFileDestination", + "VersionFileDestination", + "", + 4, + version_file_destination__enum_values_by_number, + 4, + version_file_destination__enum_values_by_name, + 1, + version_file_destination__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.h new file mode 100644 index 000000000..83686d194 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/IO/VersionFileDestination.pb-c.h @@ -0,0 +1,45 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: VersionFileDestination.proto */ + +#ifndef PROTOBUF_C_VersionFileDestination_2eproto__INCLUDED +#define PROTOBUF_C_VersionFileDestination_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _VersionFileDestination { + VERSION_FILE_DESTINATION__MCU = 0, + VERSION_FILE_DESTINATION__FPGA1 = 1, + VERSION_FILE_DESTINATION__FPGA2 = 2, + VERSION_FILE_DESTINATION__FPGA3 = 3 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(VERSION_FILE_DESTINATION) +} VersionFileDestination; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor version_file_destination__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_VersionFileDestination_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/JobTicket.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/JobTicket.pb-c.c index b24330f6c..c913c9d4c 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/JobTicket.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/JobTicket.pb-c.c @@ -55,7 +55,7 @@ void job_ticket__free_unpacked static const ProtobufCFieldDescriptor job_ticket__field_descriptors[9] = { { - "guid", + "Guid", 1, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, @@ -165,6 +165,7 @@ static const ProtobufCFieldDescriptor job_ticket__field_descriptors[9] = }; static const unsigned job_ticket__field_indices_by_name[] = { 2, /* field[2] = EnableInterSegment */ + 0, /* field[0] = Guid */ 3, /* field[3] = InterSegmentLength */ 4, /* field[4] = Length */ 1, /* field[1] = Name */ @@ -172,7 +173,6 @@ static const unsigned job_ticket__field_indices_by_name[] = { 8, /* field[8] = Segments */ 7, /* field[7] = Spool */ 6, /* field[6] = WindingMethod */ - 0, /* field[0] = guid */ }; static const ProtobufCIntRange job_ticket__number_ranges[1 + 1] = { diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index 1ab1365d0..96248ab8b 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -28,7 +28,7 @@ int32_t tableindex = 0; #define MAX_ALLOWED_TEMPERATURE 280 -ProcessParameters* ProcessParametersKeep; +ProcessParameters ProcessParametersKeep; uint32_t HandleProcessParameters(ProcessParameters* ProcessParams) { @@ -47,7 +47,7 @@ uint32_t HandleProcessParameters(ProcessParameters* ProcessParams) return status; if (ProcessParams) { - ProcessParametersKeep = ProcessParams; + memcpy (&ProcessParametersKeep,ProcessParams,sizeof(ProcessParameters)); } if (ProcessParams->mixertemp) status |= HeaterCommandRequestMessage( diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.h b/Software/Embedded_SW/Embedded/Modules/General/process.h index 520b5e626..12f1f8461 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.h +++ b/Software/Embedded_SW/Embedded/Modules/General/process.h @@ -19,7 +19,7 @@ extern double headairflow; extern double dryerairflow; extern int32_t tableindex; -extern ProcessParameters* ProcessParametersKeep; +extern ProcessParameters ProcessParametersKeep; extern void ProcessRequestFunc(MessageContainer* requestContainer); extern uint32_t HandleProcessParameters(ProcessParameters* ProcessParams); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 2af2f63c0..958f481bf 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -379,8 +379,7 @@ uint32_t IDSPreSegmentState(void *JobDetails, int SegmentId) int Dispenser_i; TimerMotors_t HW_Motor_Id; - Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Waste); - + Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Waste); //#bug 323 for (Dispenser_i = 0;Dispenser_i < MAX_SYSTEM_DISPENSERS;Dispenser_i++) { HW_Motor_Id = DispenserIdToMotorId[Dispenser_i]; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 15ea5157b..6db7f616e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -458,7 +458,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index]; MotorControlConfig[index].m_mesuredParam = NormalizedError; DancerError[DancerId] = NormalizedError; - MotorControlConfig[index].m_calculatedError = AdvancedPIDAlgorithmCalculation((float)MotorControlConfig[index].m_SetParam , (float)MotorControlConfig[index].m_mesuredParam, + MotorControlConfig[index].m_calculatedError = /*Advanced*/PIDAlgorithmCalculation((float)MotorControlConfig[index].m_SetParam , (float)MotorControlConfig[index].m_mesuredParam, &MotorControlConfig[index].m_params, &MotorControlConfig[index].m_preError, &MotorControlConfig[index].m_integral); if (index != FEEDER_MOTOR) //feeder unit handles errors opposite to left unit { diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 2eed69f24..43700d8ff 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -51,6 +51,12 @@ #include "PMR/Stubs/StubAbortJobRequest.pb-c.h" #include "PMR/Stubs/StubAbortJobResponse.pb-c.h" +#include "PMR/Diagnostics/ThreadJoggingRequest.pb-c.h" +#include "PMR/Diagnostics/ThreadJoggingResponse.pb-c.h" +#include "PMR/Diagnostics/ThreadAbortJoggingRequest.pb-c.h" +#include "PMR/Diagnostics/ThreadAbortJoggingResponse.pb-c.h" + + #include "./printingSTM.h" #include "modules/thread/thread_ex.h" #include "modules/ids/ids_ex.h" @@ -330,6 +336,110 @@ double previousJobLength; char ErrorMsg[100]; uint32_t StubControlId = 0xFF; double StubLengthCounter = 0,StubLength = 0,StubSpeed=0; +//#include "PMR/Diagnostics/ThreadJoggingResponse.pb-c.h" +//#include "PMR/Diagnostics/ThreadAbortJoggingRequest.pb-c.h" +JobTicket Ticket; +JobSegment *TSegment; +JobSpool *Tspool; +bool CopyConfigured[MAX_SYSTEM_MODULES]; +void ThreadJoggingRequestFunc(MessageContainer* requestContainer) +{ + uint32_t status = OK; + + MessageContainer responseContainer; + ProcessParameters ProcessParametersCopy; + ThreadJoggingRequest* request = thread_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + ThreadJoggingResponse response = THREAD_JOGGING_RESPONSE__INIT; + if (JobIsActive() == true) + { + status = ERROR; + } + else + { + memcpy(&CopyConfigured,&Configured,sizeof(CopyConfigured)); + //set the job handler to ignore heaters, ids and waste in the state machine + Configured[Module_Thread] = true; + Configured[Module_Winder] = true; + Configured[Module_IDS] = false; + Configured[Module_Heaters] = false; + Configured[Module_Waste] = false; + //set the requested speed without changing other process parameters + memcpy (&ProcessParametersCopy,&ProcessParametersKeep,sizeof(ProcessParameters)); + if(request->speed) + ProcessParametersCopy.dyeingspeed = request->speed; + else + ProcessParametersCopy.dyeingspeed = 30; + if (HandleProcessParameters(&ProcessParametersCopy)!= OK) + { + status = FAILED; + } + else + { + //load essential job prameters to enable thread running + Ticket.n_segments = 1; + Ticket.segments = my_malloc(sizeof(Ticket.segments)); + TSegment = my_malloc(sizeof(JobSegment)); + Tspool = my_malloc(sizeof(JobSpool)); + TSegment->length = 5000.0; + TSegment->n_brushstops = 0; + Ticket.segments[0] = TSegment; + Tspool->backingrate = 30; + Tspool->bottombackingrate = 18; + Tspool->segmentoffsetpulses = 1000; + Tspool->startoffsetpulses = 240; + Tspool->rotationsperpassage = 6; + Ticket.spool = Tspool; + CurrentJob = &Ticket; + InternalWindingConfigMessage(Tspool); + StartJob(&Ticket); + } + } + responseContainer = createContainer(MESSAGE_TYPE__ThreadJoggingResponse, requestContainer->token, true, &response, &thread_jogging_response__pack, &thread_jogging_response__get_packed_size); + if (status!= OK) + { + responseContainer.error = ERROR_CODE__INVALID_PARAMETER; + responseContainer.errormessage = "JOb Active or incorrect parameters"; + } +// responseContainer.continuous = false; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + SendChars(container_buffer, container_size); + my_free(responseContainer.data.data); + + return ; + +} +void ThreadAbortJoggingRequestFunc(MessageContainer* requestContainer) +{ + uint32_t status = OK; + + MessageContainer responseContainer; + + ThreadAbortJoggingRequest* request = thread_abort_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + ThreadAbortJoggingResponse response = THREAD_ABORT_JOGGING_RESPONSE__INIT; + + AbortJob(0); + + //set the job handler to handle heaters, ids and waste in the state machine + memcpy(&Configured,&CopyConfigured,sizeof(CopyConfigured)); + my_free(Ticket.segments); + my_free(TSegment); + my_free(Tspool); + + responseContainer = createContainer(MESSAGE_TYPE__ThreadAbortJoggingResponse, requestContainer->token, false, &response, &thread_abort_jogging_response__pack, &thread_abort_jogging_response__get_packed_size); + + responseContainer.continuous = false; + 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); + SendChars(container_buffer, container_size); + + return ; + +} + //******************************************************************************************************************** uint32_t SendStubJobProgress(uint32_t IfIndex, uint32_t readValue) { diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h index 0b9c68394..503fbeed9 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h @@ -156,6 +156,9 @@ void AbortJob(char *Msg); void Stub_JobRequest(MessageContainer* requestContainer); void Stub_AbortJobRequest(MessageContainer* requestContainer); +void ThreadJoggingRequestFunc(MessageContainer* requestContainer); +void ThreadAbortJoggingRequestFunc(MessageContainer* requestContainer); + uint32_t CurrentJobRequestFunc(MessageContainer* requestContainer); uint32_t ResumeCurrentJobRequestFunc(MessageContainer* requestContainer); diff --git a/Software/PMR/Messages/Common/ErrorCode.proto b/Software/PMR/Messages/Common/ErrorCode.proto index 97f5a65a4..025fbf19d 100644 --- a/Software/PMR/Messages/Common/ErrorCode.proto +++ b/Software/PMR/Messages/Common/ErrorCode.proto @@ -40,7 +40,7 @@ enum ErrorCode FILE_REQUEST_TOO_MANY_OPEN_FILES = 1021; FILE_REQUEST_INVALID_PARAMETER = 1022; - //Job Failure + //Job Failure JOB_UNSPECIFIED_ERROR = 2000; JOB_THREAD_BREAK = 2001; JOB_WINDER_DANCER_FAIL = 2002; -- cgit v1.3.1 From 23856e0409fc62155fc1dec934101a507517c2b5 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 3 Dec 2018 09:47:09 +0200 Subject: improved logging in thread winder --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index b6392249a..c7d303f9a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -219,7 +219,9 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) winderspeed+=WinderMotorSpeed[i]; } winderspeed/=MAX_WINDER_SPEED_CALCULATION; - LOG_ERROR(winderspeed, "WinderSpeedUpdated"); + //LOG_ERROR(winderspeed, "WinderSpeedUpdated"); + Report("WinderSpeedUpdated",__FILE__,__LINE__,winderspeed,RpWarning,ScrewNumberOfSteps,0); + WinderReferenceSpeed = winderspeed; } screw_horizontal_speed = ScrewNumberOfSteps / InternalWinderCfg.NumberOfRotationPerPassage; @@ -231,7 +233,8 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) temp /= ScrewSpeed; if (ScrewRunningTime != temp) { - LOG_ERROR(temp , "new winder speed"); + //LOG_ERROR(temp , "new winder speed"); + Report("new winder speed",__FILE__,__LINE__,temp,RpWarning,ScrewSpeed,0); } ScrewRunningTime = temp;//(SYS_CLK_FREQ*Steps)/ScrewSpeed; -- cgit v1.3.1 From 7665c5bd2de71fa724809cede3bcb408a78250bf Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 3 Dec 2018 09:54:52 +0200 Subject: improve alarm handling reporting --- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index d1a7b0145..2d0e5a4c7 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -261,6 +261,8 @@ JobEndReasonEnum getEndReason(uint32_t AlarmId) return JOB_OTHER_ALARM; } } +char Alarmstr[150]; + uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Severity) { switch (Severity) @@ -269,25 +271,20 @@ uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Sever //raise flag fr next job break; + case DEBUG_LOG_CATEGORY__Critical: + watchdogCriticalAlarm = true; + //intentional fall through case DEBUG_LOG_CATEGORY__Error: if (JobIsActive()) { + memset(Alarmstr,0,sizeof(Alarmstr)); + usnprintf(Alarmstr, 100, "Alarm set on Alarm Id, Value",(int)AlarmId,(int)AlarmItem[AlarmId].AlarmValue); + strcat (Alarmstr, AlarmItem[AlarmId].EventName ); JobEndReason = getEndReason(AlarmId); - AbortJob(AlarmItem[AlarmId].EventName); - Report(AlarmItem[AlarmId].EventName, __FILE__,__LINE__,AlarmId, RpMessage, DEBUG_LOG_CATEGORY__Error, 0); + AbortJob(Alarmstr); + Report("Alarm set on - stop job", __FILE__,__LINE__,AlarmItem[AlarmId].AlarmValue, RpMessage, AlarmItem[AlarmId].DebounceCounter, 0); + Report(AlarmItem[AlarmId].EventName, __FILE__,__LINE__,AlarmId, RpMessage, Severity, 0); } -//Stop Job - break; - case DEBUG_LOG_CATEGORY__Critical: - if (JobIsActive()) - { - JobEndReason = JOB_OTHER_ALARM; - AbortJob(AlarmItem[AlarmId].EventName); - Report(AlarmItem[AlarmId].EventName, __FILE__,__LINE__,AlarmId, RpMessage, DEBUG_LOG_CATEGORY__Critical, 0); - } - watchdogCriticalAlarm = true; - //stop job - //turn machine off break; case DEBUG_LOG_CATEGORY__Debug: case DEBUG_LOG_CATEGORY__Info: -- cgit v1.3.1 From 704146a52197741c1df351e48098b91ca69a2426 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 4 Dec 2018 15:05:20 +0200 Subject: alarm handling: initial test and fix debounce bugs. --- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 119 +++++++++++++++++---- .../Embedded/Modules/AlarmHandling/AlarmHandling.h | 1 + .../Embedded/StateMachines/Printing/JobSTM.c | 1 + 3 files changed, 101 insertions(+), 20 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 2d0e5a4c7..fc2fa7625 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -26,6 +26,7 @@ #include "PMR/Hardware/HardwareDancerType.pb-c.h" #include "modules/thread/thread_ex.h" +#include "modules/heaters/heaters_ex.h" #include "modules/ids/ids_ex.h" #include #include @@ -261,8 +262,6 @@ JobEndReasonEnum getEndReason(uint32_t AlarmId) return JOB_OTHER_ALARM; } } -char Alarmstr[150]; - uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Severity) { switch (Severity) @@ -277,14 +276,11 @@ uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Sever case DEBUG_LOG_CATEGORY__Error: if (JobIsActive()) { - memset(Alarmstr,0,sizeof(Alarmstr)); - usnprintf(Alarmstr, 100, "Alarm set on Alarm Id, Value",(int)AlarmId,(int)AlarmItem[AlarmId].AlarmValue); - strcat (Alarmstr, AlarmItem[AlarmId].EventName ); JobEndReason = getEndReason(AlarmId); - AbortJob(Alarmstr); - Report("Alarm set on - stop job", __FILE__,__LINE__,AlarmItem[AlarmId].AlarmValue, RpMessage, AlarmItem[AlarmId].DebounceCounter, 0); - Report(AlarmItem[AlarmId].EventName, __FILE__,__LINE__,AlarmId, RpMessage, Severity, 0); + AbortJob(AlarmItem[AlarmId].EventName); + Report(AlarmItem[AlarmId].EventName, __FILE__,__LINE__,AlarmId, RpMessage, DEBUG_LOG_CATEGORY__Error, 0); } +//Stop Job break; case DEBUG_LOG_CATEGORY__Debug: case DEBUG_LOG_CATEGORY__Info: @@ -295,6 +291,83 @@ uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Sever } return OK; } +uint32_t AlarmHandlingPrepareJob(void *CurrentJob) +{ + JobTicket* JobTicket = CurrentJob; + bool DispenserInUse[MAX_SYSTEM_DISPENSERS] = {false,false,false,false,false,false,false,false}; + EventType HeaterEventType[MAX_HEATERS_NUM] = {EVENT_TYPE__DryerOverTemperature,EVENT_TYPE__DryerOverTemperature,EVENT_TYPE__DryerOverTemperature,EVENT_TYPE__DyeingHead1OverTemperature,EVENT_TYPE__DyeingHead2OverTemperature, + EVENT_TYPE__DyeingHead3OverTemperature,EVENT_TYPE__DyeingHead4OverTemperature,EVENT_TYPE__DyeingHead5OverTemperature,EVENT_TYPE__DyeingHead6OverTemperature, + EVENT_TYPE__GeneralInternalOverTemperature}; + int Segment_i,Brush_i,Dispenser_i,DispenserId,Alarm_i,Heater_i,AlarmId=0; + HeaterState HeaterState; + + uint32_t status = OK; + if (JobTicket->n_segments == 0) + return OK; + for (Segment_i=0;Segment_in_segments;Segment_i++) + { + for (Brush_i=0;Brush_isegments[Segment_i]->n_brushstops;Brush_i++) + { + if (JobTicket->segments[Segment_i]->brushstops[Brush_i]->n_dispensers) + { + for (Dispenser_i = 0;Dispenser_i < JobTicket->segments[Segment_i]->brushstops[Brush_i]->n_dispensers;Dispenser_i++) + { + //prepare the SW structures + DispenserId = JobTicket->segments[Segment_i]->brushstops[Brush_i]->dispensers[Dispenser_i]->index; + if (JobTicket->segments[Segment_i]->brushstops[Brush_i]->dispensers[Dispenser_i]->nanolitterpersecond>0.0) + { + DispenserInUse[DispenserId] = true; + } + }//for dispenser + }//if dispensers + }//for brush + }//for segments + for (Dispenser_i=0;Dispenser_i= AlarmItem[Alarm_i].AlarmValue) @@ -420,7 +493,7 @@ uint32_t AlarmHandlingLoop(uint32_t tick) } break; case LimitSwitchAlarm: - value = IDS_CheckDispenserLimitSwitch(AlarmItem[Alarm_i].DeviceId); + value = IDS_CheckDispenserLimitSwitch((LimitSwitchAlarms)AlarmItem[Alarm_i].DeviceId); if (value == AlarmItem[Alarm_i].AlarmValue) { Status = true; @@ -446,12 +519,12 @@ uint32_t AlarmHandlingLoop(uint32_t tick) case CurrentAlarm: break; case MotorAlarm: - if (isMotorConfigured(AlarmItem[Alarm_i].DeviceId) == false) + if (isMotorConfigured((TimerMotors_t)AlarmItem[Alarm_i].DeviceId) == false) { Status = false; break; } - value = MotorGetStatus(AlarmItem[Alarm_i].DeviceId); + value = MotorGetStatus((TimerMotors_t)AlarmItem[Alarm_i].DeviceId); if (AlarmItem[Alarm_i].AlarmDirection == true) { if (value && AlarmItem[Alarm_i].AlarmValue) @@ -478,25 +551,31 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if (Status == true) //increase counter { AlarmItem[Alarm_i].DebounceCounter++; - if (AlarmItem[Alarm_i].DebounceCounter < AlarmItem[Alarm_i].DebounceValue) + if (AlarmItem[Alarm_i].Status == false) // alarm is not set yet { - Status = false; + if (AlarmItem[Alarm_i].DebounceCounter < AlarmItem[Alarm_i].DebounceValue) //had not reached the debounce value + { + Status = false; //do not set the alarm + } //else alarm will be set } - else + else // alarm is already set { - AlarmItem[Alarm_i].DebounceCounter = AlarmItem[Alarm_i].DebounceValue; + AlarmItem[Alarm_i].DebounceCounter = AlarmItem[Alarm_i].DebounceValue; // do not go over the debounce value } } else //status == false - decrease counter { AlarmItem[Alarm_i].DebounceCounter--; - if (AlarmItem[Alarm_i].DebounceCounter > 0) + if (AlarmItem[Alarm_i].Status == true) // alarm is set { - Status = true; + if (AlarmItem[Alarm_i].DebounceCounter > 0) // had not reached zero yet + { + Status = true; // do not reset the alarm yet + } // else reset the alarm } - else + else // if the alarm is off { - AlarmItem[Alarm_i].DebounceCounter = 0; + AlarmItem[Alarm_i].DebounceCounter = 0; //do not go below 0 } } } diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h index 4a11276a1..edce0d9cb 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h @@ -15,6 +15,7 @@ uint32_t AlarmHandlingStart(void); uint32_t AlarmHandlingStop(void); void AlarmHandlingSetAlarm(uint32_t AlarmId, bool Value); +uint32_t AlarmHandlingPrepareJob(void *CurrentJob); uint32_t StartEventsNotificationRequestFunc(MessageContainer* requestContainer); uint32_t StopEventsNotificationRequestFunc(MessageContainer* requestContainer); uint32_t ResolveEventRequestFunc(MessageContainer* requestContainer); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 43700d8ff..52967fd67 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -214,6 +214,7 @@ static ReturnCode PrepareState(void *JobDetails) } } + //AlarmHandlingPrepareJob(CurrentJob); return retcode; } //******************************************************************************************************************** -- cgit v1.3.1