Closed Omid888 closed 2 days ago
My questions are:
1) Is it the right way?
2) why on_get_cb
does not have the "register name"
parameter, instead of the address
parameter? This way the callback would be much useful. This is a very bad way to iterate through ALL registers to find the correct "register name"
and then do the operation (e.g assign the desired value).
on_get_cb()
function, should be a client.setup_registers(registers=register_definitions)
function? shouldn't that be done automatically?
Description
I need to read a temperature sensor value and assign it to it's register only when the register is requested from master. I understand that this must be done by
on_get_cb
callback for that register.This works. But I think it's a very poor way to do such thing. Is there a better way? Informations: