Coder Social home page Coder Social logo

stheves / denon4j Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 5.0 964 KB

A high-level Java API for interaction with Denon Audio Video receivers via TCP/IP

License: Apache License 2.0

Java 99.78% Shell 0.22%
java denon-avr denon protocol multimedia receiver api av-receiver tcp audio

denon4j's Introduction

denon4j Java API

Build Status

Maven Central

The denon4j project provides a higher level Java API for communicating with a Denon audio video receiver (currently only AVR1912 is tested) via TCP/IP. It hides the complexity of the network receiver protocol and provides generic controls that can be used with every Denon receiver.

The project is intended to be easily extended for those who want to write an API for their own denon receiver model.

Contributions and feedback are very welcome!

Features

  • High level API and strong domain model
  • Blocking and non-blocking request/response
  • Auto-discovery of receivers found in LAN
  • Lightweight and pure Java (no other dependencies needed)
  • Works out-of-the-box with your denon receiver
  • Available on Maven central

Prerequisites

  • Java 8
  • Maven 3.2+ (only for building)
  • You must be connected to the same network as your denon receiver
  • Your receiver must be either turned on or you have to enable the network standby feature

Basic API Usage

Avr1912 avr = new Avr1912(192.168.0.102, 23);
avr.connect(1000);
Slider masterVolume = avr.masterVolume();
masterVolume.slideUp();
avr.disconnect();

Take a look at the class Demo.java in the test directory to view a complete example.

Command line usage

java -jar denon4j-[version]-cli.jar 192.168.0.12 23
Enter a command ('?' for help, 'q' for quit):
> ?

The following options are available:

?			Prints this help
q			Quits the program
<cmd>		Executes a generic command e.g. PW?
PW?			Returns the power state
PWON		Turns power on

See the Denon AVR receiver for a full list of commands.
> MU?
OFF

About the API

  • All packages which have 'internal' in their name are not intended to be used from outside
  • Changes to internal packages are made without further notice

Building

This is a maven style project so mvn needs to be on your $PATH. To build from scratch just type:

mvn clean package

License

Apache License Version 2.0, January 2004 (see LICENSE file)

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_plugin)
  3. Commit your changes (git commit -am "Added feature")
  4. Push to the branch (git push origin my_plugin)
  5. Create a new Issue with a link to your branch, or just make a Pull Request.
  6. Enjoy a refreshing Diet Coke and wait

Denon AVR Control Protocol Specs

denon4j's People

Contributors

stheves avatar tuxburner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

denon4j's Issues

masterVolume() returns OFF because events are not filtered by regex Condition

When i try to get masterVolume() from my denon i always get the value OFF.

The reason for this is that my denon returns for some reason:

Event{asciiValue='SVOFF'}
Event{asciiValue='SVOFF'}
Event{asciiValue='MV53'}

when requesting: MV

My suggestion is to filter the events before picking the first one in io.theves.denon4j.DenonReceiver#send(java.lang.String, java.lang.String)

return send(command, Condition.regex(regex)) .stream() .filter(event -> event.asciiValue().matches(regex)) .findFirst().orElseThrow(() -> new TimeoutException( format("No response received after %s milliseconds. Receiver may be too busy to respond.", RECV_TIMEOUT) ));

Macro Support

Support for macros A macro is a sequential list of commands to be executed one after the other.

Support for MN commands

Support for Main Menu commands should be added including:

  • Toggle OSD
  • Navigate through OSD with cursor
  • Select menu links with ENTER command

API Cleanup

  • Simplify API usage
  • Test API classes
  • Remove unnecessary interfaces
  • Try to generify AVR1912

Support for NS commands

Denon4j should support the NS commands for Network USB/AUDIO/IPOD extended control. Therefore the NSA and NSE events need to be consumed and an API must be provided to get access to the display events. Navigation through the display should also be possible.

Auto Discovery

Provide an API for discovering denon receivers automatically. The denon receivers must be in the same subnet like the denon4j client for this functionality to work.

The API should provide a list of all found denon receivers found in the network and provide their IP addresses as well as the port on which we can interact with the receiver.

Fix pom issues when deploying to OSSRH

Following error occurred during deployment to OSSRH:

[ERROR] Rule failure while trying to close staging repository with ID "iotheves-1002". [ERROR] [ERROR] Nexus Staging Rules Failure Report [ERROR] ================================== [ERROR] [ERROR] Repository "iotheves-1002" failures [ERROR] Rule "pom-staging" failures [ERROR] * Invalid POM: /io/theves/denon4j/0.7/denon4j-0.7.pom: Project name missing, SCM URL missing [ERROR] [ERROR] [ERROR] Cleaning up local stage directory after a Rule failure during close of staging repositories: [iotheves-1002] [ERROR] * Deleting context bb5aca8e15958.properties [ERROR] Cleaning up remote stage repositories after a Rule failure during close of staging repositories: [iotheves-1002] [ERROR] * Dropping failed staging repository with ID "iotheves-1002" (Rule failure during close of staging repositories: [iotheves-1002]).

Deploy to Maven Central

All artifacts of each release must be deployed to maven central for maximum availability.

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.