Web API and emulating remote controls

When emulating a remote control, I think one needs the ability to know three things:

  1. When a button is pushed
  2. When it is released
  3. when it’s repeating

Let’s take a Volume UP command.

In some cases it might be desireable to not do anything just when the button is pressed, but to wait for a HELD/Let go event.

Pushed my have to start some sort of timer for say 50 mS as an example. If a button released code is received, then the system should know that a “one event” message been generated.

If it is held, then the repeat event is generated.

It would be wise, I think to include an ESC Key or event, which can cancels what’s in progress.

In some of the remote API’s I’ve seen they don;t really address what usually happens within an IR remote control.

The cludge is to have:
Volume up +1
Continuouls Volume up when held

So, what I would liek to see is some sort of API documentation whether it;s AJAX, JAVA, HTML or whatever that shows what it takes to deal with these events.

It isn’t as simple as a button controlling the ON/OFF state.

This is a “Head up” for the developers to be aware of how one might implement events of the type suggested.

I can see this platform being used a lot for remote control applications.

As an example for one remote.
A data word is dent twice with a certain space for a volume up. Before the next command can be accepted, a certain minimum time must elapse.

I am currently under the assumption that repeat is the continuation.

e.g.
DATA-t1-DATA-t2-DATA-t1-DATA-t1-DATA-t1

In this case, a single push includes up to t2, t2 can also be thought of as the minimum time that must elapse before a different command is accepted. Two pieces of the same DATA is required fo +1.

Until I do some more analysis, I don;t know if t2 must be present.

t1 would have to be extended to t2 before another key is accepted.

So, it isn’t qute realtime to figure out what to actually do.

It’s sort of like a click event sends two pieces of data and if it’s sustained, it keeps sending the data.

A processor that has direct control, such as the core may be able to distinguish between the events needed.

This is again an awareness issue and someting to brainstorm and think about, If it works now, then it should be part of a “remote control” starter suite of an example.

I could also be barking up the wrong tree too.

Sorry was too busy to reply the first time I read this… good thoughts! Have you dug up anything on this topic? I’m guessing someone out there has implemented a simple jQuery library for button/touch events that would have a lot of these timers built in already. The Web API just takes requests and processes them without any kind of state machine or timing logic, other than rate limiting requests… and other housekeeping simple stuff, AFAIK.

1 Like