Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

cec-cdi

cec-cdi is a CDI Extension to interface with libcec through cec-client.

Install

  1. Install cec-client in /usr/local/bin/cec-client (for Raspbian a premade deb is available)
  2. Add cec-cdi to pom.xml:
<dependency>
	<groupId>nl.edubits.cec</groupId>
	<artifactId>cec-cdi</artifactId>
	<version>1.0-SNAPSHOT</version>
</dependency>

Usage examples

Observe CEC messages

@ApplicationScoped
public class CecObserverBean {
	public void tvMessage(@Observes @CecSource(TV) Message message) {
		logger.info("Message received from TV: " + message);
	}
}

Send CEC message

public class SendExample {

	@Inject
	private CecConnection connection;
	
	public void send() {
		// Send message from RECORDER1 (by default the device running this code) to the TV to turn on
		connection.sendMessage(new Message(RECORDER1, TV, IMAGE_VIEW_ON, Collections.emptyList(), ""));
		
		// Send message from RECORDER1 (by default the device running this code) to the TV to turn off
		connection.sendMessage(new Message(RECORDER1, TV, STANDBY, Collections.emptyList(), ""));
	}
}

Resources

About

cec-cdi is a CDI Extension to interface with libcec through cec-client

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.