Infrared Smart Matching APIs

Last Updated on : 2021-12-07 08:41:20

If a plenty of indexes are preset for a branded IR code library, it usually takes a lot of time to match a remote control with an index.

The smart IR code matching feature helps to quickly match an index of the IR code library in line with the learned IR codes.

The actual remote control must be provided to learn and match.

Infrared Smart Matching APIs

Business process

  1. Enable the learning status of an IR gateway. For more information, see Modify Learning Status.

  2. Align the actual remote control with the IR gateway and send the IR code.

  3. Get the learning code learned by the IR gateway. For more information, see Get Learned IR Code.

  4. Request smart matching by the learned IR code to return a smart matching token. For more information, see Get Token by Smart Matching.

  5. Request a matching list by a smart matching token. For more information, see Get Matching Result by Token.

  6. View the remote control index information from the returned matching list. For more information, see Get Remote Control Brand.

  7. Try to match the buttons in the remote control indexes in the list one by one. For more information, see Send Standard Command (During Pairing) and Send Single Command.

    • If you find an index that can be used to properly control the real device, call the Add Remote Control API to end this smart matching action.

    • Otherwise, continue to use the smart matching token to request the matching list, and proceed to Step 5. When matching results are returned on more than one page, if no matched remote control is found on the first page, repeat Step 5 to request matching lists for the rest pages.

    • If no value is returned, the matching list ends.

    • To further narrow down the matching range, enable the learning status of the IR gateway again, send a new learning code, and then get a new smart matching token.

      1. See Steps 1 to 4.
      2. Request a matching list with the new smart matching token and the old token in Step 5. Based on matching results with the learned IR code in Step 3, the system narrows down the matching range with the IR code in Step 11.
      3. Repeat Steps 6 and 7 until an applicable remote control index is matched or no matching index is found.