slave callbacks

Asked by William Koos

I'm working on a slave device and thinking about porting your code to eCos and using it in my device. Your current implementation uses internal arrays for the register updates. In most embedded devices you would really like to have a callback than the user can implement to affect device state based on the register written. I would recommend adding slave callbacks that default to updating internal arrays but can be replaced with user define callback functions. I'll probably do this anyway so let me know if you have a preference for where the callbacks should live. I was thinking of just adding them to the mapping structure but it might be better to have a separate callback functions structure. I'll send you any changes I make if you'll let me know the best way to do it.

Question information

Language:
English Edit question
Status:
Answered
For:
libmodbus Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Stéphane Raimbault (sra) said :
#1

I'm not sure about the right answer (trade-off between stable API, size of the mapping structure, convenient API, and so on) so I think the best thing to do it's to let you choose.

I'll be happy to read your code.

Can you help with this problem?

Provide an answer of your own, or ask William Koos for more information if necessary.

To post a message you must log in.