Home AMX User Forum AMX General Discussion

Simulate an Online Event?

I can use do_push() to simulate a button event. Does anyone know if there's a way to simulate an online event?

J

Comments

  • a_riot42a_riot42 Posts: 1,624
    Jeff wrote: »
    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
  • JeffJeff Posts: 374
    The virtual device just has its online event when the system boots though, right? I can't make its online event happen any particular time . . .
  • ericmedleyericmedley Posts: 4,177
    Jeff wrote: »
    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.

    I do that quite a bit.
  • JeffJeff Posts: 374
    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.

    J
  • Chip MoodyChip Moody Posts: 727
    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...

    - Chip
  • JeffJeff Posts: 374
    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.

    J
Sign In or Register to comment.