I can use do_push() to simulate a button event. Does anyone know if there's a way to simulate an online event?
J
You could create a virtual device that has an online event. I think that's about all you can do though, as I don't believe there is a way to trigger a hardware online event without the hardware.
Paul
I can use do_push() to simulate a button event. Does anyone know if there's a way to simulate an online event?
J
If this is just to test a section of code to see if the Online event does what it's supposed to, perhaps you could use some other device you do have handy and make it go on and offline. Perhaps you have a touch panel that could stand-in for the device. Once you've tested you could reset the device number.
Naw, I'm actually working on writing a module for one of the iPhone touchpanel apps. I'm simulating button events quite well, but I'm trying to figure out how to do an online event.
It looks like i'll just have to do a command event when data.text equals "ONLINE", which isn't that big of a deal, but I'm trying to make programming for this panel as close to programming for the real thing as possible.
Jeff, how is the connection between the iPhone and the control system made? Is it a direct Ethernet connection, or does it have to go through some kind of outboard service - running on a PC perhaps?
In the case of the former, I'm assuming you'd be using IP_SERVER_OPEN in your code. This should generate online/offline events when the iPhone app makes and breaks connections...
It does use IP_SERVER_OPEN, but it has to pass a password test in order to connect, something the default AMX panels don't do. This means that anything I do in the online event there would happen when it connects, not once it starts listening to commands.
It does send me an initialization message once it connects successfully, but I don't know what to do with that.
Comments
You could create a virtual device that has an online event. I think that's about all you can do though, as I don't believe there is a way to trigger a hardware online event without the hardware.
Paul
If this is just to test a section of code to see if the Online event does what it's supposed to, perhaps you could use some other device you do have handy and make it go on and offline. Perhaps you have a touch panel that could stand-in for the device. Once you've tested you could reset the device number.
I do that quite a bit.
It looks like i'll just have to do a command event when data.text equals "ONLINE", which isn't that big of a deal, but I'm trying to make programming for this panel as close to programming for the real thing as possible.
J
In the case of the former, I'm assuming you'd be using IP_SERVER_OPEN in your code. This should generate online/offline events when the iPhone app makes and breaks connections...
- Chip
It does send me an initialization message once it connects successfully, but I don't know what to do with that.
J