![]() |
|
#1
|
|||
|
|||
|
Currently developing a serial driver using the queued serial object.
The callback methods for receiving data, do not include the 'self' parameter. Now if I want to set some values on the object, based upon the received answer, I need access to 'self' (not?). How to go about getting a reference to 'self' in this case? or is there another (preferred) way of achieving this? any help is greatly appreciated |
|
#2
|
||||
|
||||
|
You shouldn't be using callbacks, that will interfere with the normal operation of the serial device.
Just override the ReceiveResponse method but be sure to call the inherited method from within it. Having said all that the serial classes are really deprecated these days in Girder 5, it's generally better to implement your device using the transport classes if you can. If you're using Girder 4 then you're stuck with the serial classes though.
__________________
--Rob |
|
#3
|
|||
|
|||
|
Hi Rob,
thx for the feedback. I've searched the help files on the transport stuff but couldn't find anything (as opposed to the serial stuff). Seems to me the documentation is really outdated? (has it even changed since Girder 4?) any way; can you point me to some documentation or examples on creating drivers for a serial connected device using the transport stuff? thx! |
|
#4
|
|||
|
|||
|
Just found the documentation, after checking the site, the manual was an updated one. I was still running one of the early Girder 5 versions. Installed the newer version and all docs are there.
|
|
#5
|
|||
|
|||
|
Quote:
Quote:
The original question stays; how to get a reference to 'self' inside the callback method provided to the 'SendCommand'? |
|
#6
|
||||
|
||||
|
ReceiveResponse override isn't required, but it is still the recommended way of handling responses.
As I said, do not use callbacks with the serial classes, it will break the operation of the serial device.
__________________
--Rob |
![]() |
| Tags |
| lua, serial |
| Thread Tools | |
| Display Modes | |
|
|