reaper7 / SDM_Energy_Meter

reading SDM72 SDM120 SDM220 SDM230 SDM630 modbus energy meters from arduino (esp8266, esp32, avr)
240 stars 97 forks source link

set WAITING_TURNAROUND_DELAY and RESPONSE_TIMEOUT in function call #58

Closed Hard-n-Soft closed 2 years ago

Hard-n-Soft commented 2 years ago

Hi,

thanks for providing the SDM630 lib. I don't want to use the SDM_Config_User.h file for configuration. Therefore it would make sense - from my point of view - to add a function to change the WAITING_TURNAROUND_DELAY and RESPONSE_TIMEOUT values while runtime and not by define for eample in setup(). Is that possible?

Best regards and thanks

reaper7 commented 2 years ago

as people say - everything is possible :) For security such functions should also check values entered by the user (minimum and maximum values), but what should they be? Believe me but you can't allow too much freedom because people try to enter strange values :)

Are the SET functions alone enough? should GET functions also appear?

I don't actively use this library so PR would be welcome and I don't have the option to test.

reaper7 commented 2 years ago

please check new 4 functions: https://github.com/reaper7/SDM_Energy_Meter/blob/master/SDM.h#L260

Hard-n-Soft commented 2 years ago

Thanks, it's working like wanted. 1st test is working fine.

Best regards and thanks, Hard-n-Soft