GithubHelp home page GithubHelp logo

bengtmartensson / girr Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 7.85 MB

Girr is a universal XML-based format for the exchange and storage of infrared signals.

Home Page: http://www.harctoolbox.org/

License: GNU General Public License v3.0

HTML 93.56% Java 4.09% XSLT 2.17% Makefile 0.05% Shell 0.13%
api exchange-format infrared ir java xml

girr's People

Contributors

bengtmartensson avatar dependabot[bot] avatar leamas avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rpourzia

girr's Issues

generated XML: use parameter/protocolName inheritance whenever possible

Prefer

<commandSet ... >
    <parameters protocol="rc6">
        <parameter name="D" value="0"/>
    </parameters>
    <command F="12" master="parameters" name="power_toggle"/>
    <command F="56" master="parameters" name="input"/>
    <command F="60" master="parameters" name="teletext_toggle"/>
    ...

over

<commandSet ... >
   <command master="parameters" name="power_toggle">
        <parameters protocol="rc6">
            <parameter name="D" value="0"/>
            <parameter name="F" value="12"/>
        </parameters>
    </command>
    <command master="parameters" name="input">
        <parameters protocol="rc6">
            <parameter name="D" value="0"/>
            <parameter name="F" value="56"/>
        </parameters>
    </command>
    <command master="parameters" name="teletext_toggle">
        <parameters protocol="rc6">
            <parameter name="D" value="0"/>
            <parameter name="F" value="60"/>
        </parameters>
    </command>
    ....

for reasons of human readability.

Turn protocol names lower case.

In the IrpTransmogrifier/JP1 tradition, all protocol names are considered case insensitive. Turning them lower case makes life much easier for postprocessing.

"Girr 2.0": Make Girr useful for more than proper sense IR

Although the applicationData allows for adding all sort of data, it would be desirable to make Girr more explicitly in inviting to use for other kind of remote control than IR in the proper sense, i.e. either raw signals or protocol/parameter form of signals. For this, in the commandSet element. there should be a parameter kind taking values like "ir", "serial", "tcp", "udp", "http", code" etc. (Default to "ir" for backwards compatibility). (Let's make it "text", and not an ennumeration, to be able to have it user extendable). It using this parameter, it may be necessary to complement it with some application parameter (appParameter), like code requires (e.g.) a lirc driver. both to make sense of the codes and to send them.

For example, the atilibusb.lircd.conf may be turned into

<remote vendor="ATI" name="ATI_Remote_Wonder_II">
    <commandSet type="code">
          <applicationData application="lirc">
                 <appParameter name="driver" value="atilibusb"/>
                  <appParameter name="gap" value="203970"/>
            </applicationData>
            <command name="KEY_STOP" code="0x000231"/>
             ...
      </commandSet>
</remote>

Similarly, a Sony Projector can be controlled serially and over IR by

<remote id="sony_vlp_hw50es" name="Sony VLP HW50ES" vendor="Sony" model="VLP HW50ES" type="projector">
<commandSet kind="serial">
       <applicationData application="serial">
            <applicationParameter name="protocol" value="rs232"/>
             <applicationParameter name="baud" value="38400"/>
              <applicationParameter name="dataBits="8"/>
              <applicationParameter name="parity" value="even"/>
               <applicationParameter name="stopBits" value="1"/>
               <applicationParameter name="commandFormatter" value="org.harctoolbox.harchardware.misc.SonySerialCommand"/>
        </applicationData>
        <command name="power_toggle" code="set,23,21"/>
         ...
    </commandSet>
    <commandSet name="sony15" protocol="sony15" deviceno="84">
           <command name="video_mute_toggle" code="36"/>
           ....
    </commandSet>     
     ....
</remote>

Here, the attribute F in command has been renamed to code.

Remains to define syntax and semantic for

  • input arguments,
  • output arguments.

Note that:

  1. This does not concern IrScrutinizer proper,
  2. The changes are all to girr[_ns].xsd.

displayName should be element, not attribute.

Should be a child element instead of an attribute, multiplicity: *. Should take an xml:lang attribute (with unique-restriction), thus supporting multiiple languages.

In the same vein, adding a helpText element (that can be used for tooltips etc) would be a good idea, same xml:language handling and restriction.

Added 2021-04-12: For compatibility, the attribute form should still be accepted (though deprecated), and equivalent to a displayName element with xml:lang="en".

Added 2021-04-15: This defines a new version of the schema, which we will call 1.2 and will have the schema location systemID http://www.harctoolbox.org/schemas/girr_ns-1.2.xsd

Replaces bengtmartensson/IrScrutinizer#163

Inherited parameters are generated also if parameter generation is not selected

Like this...

        <commandSet name="commandSet">
            <parameters protocol="nec1">
                <parameter name="D" value="128"/>
            </parameters>
            <command master="ccf" name="Power On/Off Toggle">
                <ccf>0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C</ccf>
            </command>
      ....

command/@master="prontoHex" is generated, but is not valid wrt the scheme.

cvc-enumeration-valid: Value 'prontoHex' is not facet-valid with respect to enumeration '[raw, ccf, parameters]'. It must be a value from the enumeration. [13] 
cvc-attribute.3: The value 'prontoHex' of attribute 'master' on element 'command' is not valid with respect to its type, 'masterEnum'. [13] 

This must have sneaked in when I renamed several "ccf" to "prontoHex".

Release 2.0.0

Basically tagging a release for IrScrutinizer 2.0.0.

Optionally allow empty commands

An empty command is a command with a name, but without a definition: no protocol/parameters, no raw, no pronto. Presently, empty commands are rejected when importing. By allowing empty commands, the Girr format can be used to define templates for remotes.

To not break backwards compatibility, this should only be optional behavior.

Semantic attributes in command

For the next version of Girr, there should be some possibility to (non-mandatory) express semantic of a command, for example

<command name="..." ...>
   ....
    <semantic>
          <attribute name="toggle" value="true"/>
          <attribute name="powers-on" value="true"/>
          <attribute name="delay-after" value="5000"/>
    </semantic>
    ....
</command>

Girr as such should leave the interpretation to a program. Thus, no changes in the Java code are required, just an extension of the schema.

Replacement of IrScrutinizer issue.

NPE in rare cases in Command.canReduce, invoked by XML export

If the commands to be exported starts with a signal without a certain parameter (except F), and a later command, with the same protocol contains that parameter, a NPE will occur.

For example NEC1 D=123,F=... followed by NEC1 D=123,S=45,F=... will trigger the problem.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "java.lang.Long.equals(Object)" because the return value of "java.util.Map.get(Object)" is null
	at org.harctoolbox.girr.Command.canReduce(Command.java:1278)
	at org.harctoolbox.girr.Command.toElement(Command.java:1173)
	at org.harctoolbox.girr.CommandSet.lambda$toElement$4(CommandSet.java:317)
	at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:647)
	at org.harctoolbox.girr.CommandSet.toElement(CommandSet.java:316)
	at org.harctoolbox.girr.Remote.toElement(Remote.java:280)
	at org.harctoolbox.girr.RemoteSet.toElement(RemoteSet.java:552)
	at org.harctoolbox.girr.XmlExporter.toDocument(XmlExporter.java:204)```

Allow embedded IRP protocols

On the scheme level, this amounts to allow the irp:protocols element, for example as child element of remotes and remote.
This amounts to append the IRP data base of known protocols with the ones given in the file -- overriding in the case of identical names. The commands still refer to protocols using the protocol's name, not XML references.

Remove (sort-of) style sheet link generation in XmlExporter.toDocument(....)

Style sheet links has (although a nice technique as such) gone out of style. For example, Firefox (and probably also some other browsers) ignores such links (unless ...), "for security reasons". Moreover, this, basically useless, feature made the argument list to toDocument awfully long.

Todo: remove stylesheetUrl ans stylesheetType as argument to toDocument(....) and (not to just delete a working feature) make these static members of a suitable class.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.