{"id":17576916,"url":"https://github.com/bengtmartensson/jgirs","last_synced_at":"2025-09-03T07:41:27.508Z","repository":{"id":36045014,"uuid":"40342448","full_name":"bengtmartensson/JGirs","owner":"bengtmartensson","description":"\"IrScrutinizer as server.\" An IR server, compatible with Girs.","archived":false,"fork":false,"pushed_at":"2023-08-25T13:20:46.000Z","size":1149,"stargazers_count":5,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T13:41:41.419Z","etag":null,"topics":["girs","infrared","ir","java"],"latest_commit_sha":null,"homepage":"http://www.harctoolbox.org/Girs.html","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bengtmartensson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-07T05:15:26.000Z","updated_at":"2023-05-11T18:42:03.000Z","dependencies_parsed_at":"2024-10-22T21:33:24.543Z","dependency_job_id":null,"html_url":"https://github.com/bengtmartensson/JGirs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bengtmartensson/JGirs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FJGirs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FJGirs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FJGirs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FJGirs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bengtmartensson","download_url":"https://codeload.github.com/bengtmartensson/JGirs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengtmartensson%2FJGirs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273410261,"owners_count":25100450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["girs","infrared","ir","java"],"created_at":"2024-10-21T23:43:37.966Z","updated_at":"2025-09-03T07:41:27.484Z","avatar_url":"https://github.com/bengtmartensson.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JGirs [![Build Status](https://travis-ci.org/bengtmartensson/JGirs.svg?branch=master)](https://travis-ci.org/bengtmartensson/JGirs)\nThis is an IR server, compatible with [Girs](http://www.harctoolbox.org/Girs.html).\nIt can be considered as _IrScrutinizer as server_, as it builds on the same\ncomponents as IrScrutinizer: the renderer IrpMaster,\nthe hardware structures of HarcHardware, the Lirc subset Jirc, the Girr support.\n\nJGirs implements the \"server\" in my [architecture](http://harctoolbox.org/architecture.html).\n(With an presently not yet implemented option, it may be possible for an instance\ninstead to fulfill the \"listener\" role.\n\n## Demarcation\nThe program  should be kept fairly \"dumb\", basically executing simple commands.\nIt should not be extended with, e.g. embedded script language, macros or the such.\n(This is instead the domain of a home automation server.)\n\nAlso, the usage of IrScrutinizer and JGirs should not overlap.\n\n## The configuration file\nAt start, the program reads a configuration file. This is an XML file consisting\nof declarations of variables, modules, remotes data bases, and deployed hardware.\nAn XML scheme is planned, but at the time of this writing not yet implemented.\n\n### Varibles\nA variable in JGirs has as `type` either `string` (default), `int`, or `boolean`. It is\ndeclared either in the Java code or in the configuration file. The value can be changed interactively in the server.\nSome of the functions use the values of these variables.\n\n## Loading of JNI native libraries\nIt is possible from the configuration file to load JNI libraries, that the program or the dynamically\nloaded modules or hardware drivers may need. This is done with the `jni-lib` element, allowed as immediate child\nof the root element, and as immediate child of the `module` and `hardware-item` elements. The `jni-lib` must have\neither the `libpath` or the `library` attribute (but not both) set: the first one contains the complete path to the\njni lib (including both absolute directory path and file extension)\n(to be loaded with [load](https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#load-java.lang.String-),\nwhile the second one contains the bare library\nname (without directory and extension), to be loaded with\n[loadLibrary](https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#loadLibrary-java.lang.String-).\n\n## Dynamic loading\nModules are \"dynamically loaded\" as per above.\nnot belonging to the program proper. The `class` attribute denotes the full Java class name to the class that is to be loaded.\nOf course, this must be loadable in the Java `classpath`.\nAs arguments, within the XML element `argument`, the arguments (type and actual value), of the constructor used, are given.\n\n### Hardware\nA number of different hardware can be deployed by the server. The hardware devices are identified\nby a unique `name`, subsequently used by the server to  identify the device. The program will maintain\nthree variables `transmitDevice`, `captureDevice`, and `receiveDevice`,\nwhich should contain the name of the default devices used for transmitting, capturing, and receiving.\n\nIf an empty element `\u003cimmediate-open/\u003e` is contained in the `\u003chardware-item\u003e` element,\nthe hardware will be initialized immediately at start; otherwise it will be initialized when needed.\n\n### Modules\nThe functionality of the program is implemented in [modules](http://harctoolbox.org/Girs.html#Modules).\nModules, other than the standard ones, are declared in the configuration file. The full Java class name is given,\nas well as the arguments to the constructor, as described above. Version 0.1.0 comes with two \"example\" extra modules,\n`OpenClose` (class name `org.harctoolbox.jgirs.OpenClose`), allowing for opening and closing of hardware as desired\n(otherwise it is done implicitly, when the need arise), and `Dummy` (classname `org.example.jgirs.Dummy`)\nadding some truly remarkable functionality :-).\n\n### \"Named remotes\": databases of remote commands\nThe program will read \"configuration files\" defining IR commands with names. Typically, these corresponds\nto a consumer electronics device, and its known commands, with a name in plain English, like `play`.\nFiles in [Girr](http://www.harctoolbox.org/Girr.html) format, [Lircd](http://lirc.org/html/lircd.conf.html),\nand CSV files, e.g. from [IRDB](https://github.com/probonopd/irdb). These are accessed through URLs,\nso not only local files can be used, but also, e.g., Internet http resources. See the examples in\nthe supplied configuration file.\n\nA _remote_ is here nothing but a set of commands. It is identified by its name.\nA _command_ is an IR signal identified by its a name.\n\n## Usage\nAs of version 0.1.0, the program is strictly single threaded. Many of the classes are implemented as\nsingleton classes (i.e. can be instantiated only once).\n\nThere are three ways of running the program, described next. In the future,\nmore program modes will likely be implemented, as well as multi-threaded operation.\n\n### One-shot command mode\nA command, including its parameters, can be given at the command line.\nIt will then be executed, and the result printed on standard output.\nIt is possible to give several commands by separating them with a semicolon (\";\").\nNote that the latter must likely be escaped from the shell.\n\n### Interactive (Readline) mode\nIf the program is started without arguments, it goes into interactive mode, reading one line of command, evaluating it,\nand printing the result to standard out (\"read-eval-print\"). This continues until the user issues the `quit` command,\nor enters the end-of-line (Normally Ctrl-D on Unix/Linux, Ctrl-Z on Msdos/Windows).\nIf [Java Readline](https://github.com/bengtmartensson/java-readline)\nand [Readline Commander](https://github.com/bengtmartensson/ReadlineCommander)\nare installed, advanced command line editing will be available.\n\n### TCP server mode\nIf given the `--tcp` option, the program will start as TCP server, listening for connections on a given TCP port (default 33333).\n(To try it out, just use the `telnet` program.)  This will accept a  client session on the port,\naccepting a new one as soon as one has been closed.\nThis is compatible both with the Girs client of IrScrutinizer, and with Lirc, using the experimental version of the Girs driver.\n\n\n## Commands\nAll commands consists of text only. The command name, and in most cases its arguments, can be abbreviated as long as the\nabbreviation (as prefix) matches exactly one command. All matching of command and arguments are being done case insensitively.\nAlmost all commands return exactly one line. If the command succeeded, but without delivering any\nuseful information, the response is \"`OK`\". If the command fails, the response is \"`ERROR`\", possibly followed by some more\nprecise error information. If timeout is received, the response is \"`.`\" (a period).\nSome command, like `remote`, deliver a list as answer; these are given as one line, with the list elements separated\nby white spaces (), except for when they contain white space themselves. In that case, the elements will be\nenclosed by double quotes (\").\n\nCommands can be abbreviated as long as the entered fragments is the prefix of exactly one command.\n\nNext, the currently implemented commands in the standard modules are described:\n\n### analyze\nWithout arguments, captures am IR signal using the current default device contained\nin the variable `captureDevice`. With an argument, tries to use that as the\nname of the capturing hardware.\n\nThe signal is output in raw format, consisting of a frequency measurement and a number\nof durations in micro seconds. There is no possibility for example to decode the signal.\nFor this, instead the `receive` format should be used, or alternatively, IrScrutinizer should be\nused.\n\n### commands\nPrints a list of the available commands.\n\n### gettransmitters\nWithout argument, prints the list of transmitters available on the current default\ntransmitting device. With argument, returns the transmitters on that device instead,\nif possible.\n\n### license\nReturns the license\n\n### modules\nReturns a list of the loaded modules\n\n### parameter\nWithout arguments, all parameters and their values are listed. With one argument, the value of\nthat parameter is listed. With two arguments, the first one is used as the parameter name,\nwhich is assigned the value of the second parameter. Parameter names and values can abbreviated\nas long as sensible.\n\n### protocols\nLists all the protocols known to the renderer.\n\n### quit\nEnds the session.\n\n### receive\nWithout arguments, captures am IR signal using the current default device contained\nin the variable `captureDevice`. With an argument, tries to use that as the\nname of the capturing hardware. The variable `receiveFormat` determines how the received\nsignals are presented:\n\n* `raw`:  the raw signal, i.e. its durations in micro seconds, are output.\n* `ccf`: the signal is output in the Pronto Hex format.\n* `protocolparameter`: it is attempted to decode the signal as a known protocol with its parameters.\nPresently, decodeir is invoked for this.\n*  `namedcommand`: it is attempted to identify the received signal as one already present\nin the named command data base.\n\n###  remotes\nWithout arguments, lists the names of the known remotes. With one argument, lists the commands\nof the remote given as argument.\n\n### send\nSynonym for `transmit raw`, for compatibility with [AGirs](https://github.com/bengtmartensson/AGirs).\n\n### settransmitter\nWith one argument, sets the transmitter of the default transmitting device to the value\nof the argument. With two arguments, transmitter of the the transmitting device given as the first argument\n is set to the second argument.\n\n### transmit\nThis command transmits an IR signal using the current value of `transmitDevice`.\nIt has four subcommand, which designates how the arguments are to be interpreted.\n\n* `transmit raw` _nosends_ _frequency_ _intro_length_ _repeat_length_ _ending_length_ _\u003ctiming_data\u003e_\n\nSends a raw signal, i.e., determined by its timing data.\n\n* `transmit hex` _nosends_ _\u003cSignal as Pronto hex\u003e_\n\nSends a signal entered as Pronto hex.\n\n* `transmit protocolparameter` _nosends_ _protocol_ _\u003cparameters\u003e_\n\nRenders and sends a signal using the given protocol and parameters. The protocols recognized\ndepends on the renderer used. They can be listed by the command `protocols`.\n\n* `transmit irp` _nosends_ _irpprotocol_as_string_ _\u003cparameters\u003e_\n\nRenders and sends a signal using the given protocol in IRP form.\n\n* `transmit name` _nosends_ _remotename_ _commandname_\n\n## version\nWithout arguments, returns the version of the program. Can also be given an argument, which should\ncorrespond to the name of a connected hardware item. In that case, the version number of that\nhardware item is returned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengtmartensson%2Fjgirs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbengtmartensson%2Fjgirs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengtmartensson%2Fjgirs/lists"}