Is there a way to trigger the online event handler through code, similar to do_push or do_custom_event? I know I can do a function, and just have my online event call the function, but I'm just curious.
Is there a way to trigger the online event handler through code, similar to do_push or do_custom_event? I know I can do a function, and just have my online event call the function, but I'm just curious.
Hmmm... this may be a case where there's a better way to do whatever you have in mind to do. why would you want to fake an online event??? And, if whatever it is you want to make happen via a fake online_event is going to a function, why not just call the function?
What were you planning on doing code-wise to start the fake online event? whereever that was just call the function and avoid the middle man.
Post some code with your idea and we'll see if we can help.
e
Hmmm... this may be a case where there's a better way to do whatever you have in mind to do. why would you want to fake an online event??? And, if whatever it is you want to make happen via a fake online_event is going to a function, why not just call the function?
What were you planning on doing code-wise to start the fake online event? whereever that was just call the function and avoid the middle man.
Post some code with your idea and we'll see if we can help.
e
I'm just looking for a way to send some initialization commands to DXLink devices in response to a REINIT command to a module or when they come online without writing the same code in both sections. As for why I'm looking to emulate the online event, because that's where the code lives, and I'm being lazy.
In general, the ability to control when an online event occurs for modules would be nice. It's always struck me as weird to use the DATA_INITIALIZED channel event, instead of allowing the module to just control the online and offline events, but that's a whole other issue.
Yeah, that's definitely the right way to do it. Like I said, I was being lazy (my own project, this isn't for anyone external or anything) and then got curious if it was even possible. do_push() can be pretty useful, and it's arguably just as bad as do_online_event() would be.
Easiest way to do this is to create a function for your init routine. Pass it whatever you need to from the online event, but make the function your only code in the event. Then when you need it elsewhere, call the function directly.
Comments
Hmmm... this may be a case where there's a better way to do whatever you have in mind to do. why would you want to fake an online event??? And, if whatever it is you want to make happen via a fake online_event is going to a function, why not just call the function?
What were you planning on doing code-wise to start the fake online event? whereever that was just call the function and avoid the middle man.
Post some code with your idea and we'll see if we can help.
e
I'm just looking for a way to send some initialization commands to DXLink devices in response to a REINIT command to a module or when they come online without writing the same code in both sections. As for why I'm looking to emulate the online event, because that's where the code lives, and I'm being lazy.
In general, the ability to control when an online event occurs for modules would be nice. It's always struck me as weird to use the DATA_INITIALIZED channel event, instead of allowing the module to just control the online and offline events, but that's a whole other issue.
Paul