/**
 * Sends status command. (Overloading from superclass)
 */
void ClientKramerVSHDMIMatrix::_sendStatus()	{
	_resetBuffer();
	_addToBuffer_P(PSTR("#VID? 1|VID? 2|VID? 3|VID? 4\r"));
	_sendBuffer();

	_resetBuffer();
	_addToBuffer_P(PSTR("#SIGNAL? 1|SIGNAL? 2|SIGNAL? 3|SIGNAL? 4\r"));
	_sendBuffer();
}
示例#2
0
/**
 * Sends status command. (Overloading from superclass)
 */
void ClientBMDVideohubTCP::_sendStatus() {
  _resetBuffer();
  _addToBuffer_P(PSTR("VIDEO OUTPUT ROUTING:\n\n"));
  _addToBuffer_P(PSTR("VIDEO OUTPUT LOCKS:\n\n"));
  // If more are added, the buffer will be too small and they must be sent in multiple batches...
  _sendBuffer();
}
/**
 * Sends status command. (Overloading from superclass)
 */
void ClientSonyDeckControlUDP::_sendStatus() {
  _binarybuffer[0] = 0x61;
  _binarybuffer[1] = 0x20;
  _binarybuffer[2] = 0x09;
  _bufferWriteIndex = 3;
  _sendBuffer();
}
void ClientSonyDeckControlUDP::doStop() {
  if (TXready()) {
    _binarybuffer[0] = 0x20;
    _binarybuffer[1] = 0x00;
    _bufferWriteIndex = 2;
    _sendBuffer();
  }
}
void ClientSonyDeckControlUDP::doFastForward() {
  if (TXready()) {
    _binarybuffer[0] = 0x20;
    _binarybuffer[1] = 0x10;
    _bufferWriteIndex = 2;
    _sendBuffer();
  }
}
示例#6
0
void ClientBMDVideohubTCP::setLock(uint8_t output, char newState) {
  _resetBuffer();
  _addToBuffer_P(PSTR("VIDEO OUTPUT LOCKS:\n"));
  _addToBuffer(String(output - 1));
  _addToBuffer_P(PSTR(" "));
  _addToBuffer(String(newState));
  _addToBuffer_P(PSTR("\n\n"));
  _sendBuffer();
}
size_t AsyncPrinter::write(const uint8_t *data, size_t len){
  if(_tx_buffer == NULL || !connected())
    return 0;
  size_t toWrite = 0;
  size_t toSend = len;
  while(_tx_buffer->room() < toSend){
    toWrite = _tx_buffer->room();
    _tx_buffer->write((const char*)data, toWrite);
    while(!_client->canSend())
      delay(0);
    _sendBuffer();
    toSend -= toWrite;
  }
  _tx_buffer->write((const char*)(data+(len - toSend)), toSend);
  while(!_client->canSend()) delay(0);
  _sendBuffer();
  return len;
}
void SyncClient::flush(){
  if(_tx_buffer == NULL || !connected())
    return;
  if(_tx_buffer->available()){
    while(!_client->canSend() && connected())
      delay(0);
    _sendBuffer();
  }
}
void ClientKramerVSHDMIMatrix::routeInputToOutput(uint8_t input, uint8_t output)	{
	_resetBuffer();
	_addToBuffer_P(PSTR("#VID "));
	_addToBuffer(String(input));
	_addToBuffer_P(PSTR(">"));
	_addToBuffer(String(output));
	_addToBuffer_P(PSTR("\r"));
	_sendBuffer();
}
/**
 * Gets value from a given object (shift+ctrl+o when you have selected an object in the ZonePro Program Screen - there you will see values for b0-b3)
 */
void ClientDbxZonePro::_getAllStates() {
	_resetBuffer();

	_insertMsgId(0x0119);	// Get Command	- or all stuff?
	_insertFlags(0x0001);	
	_insertObjectId(0,0,0,1);

	_bufferWriteIndex=21;
	_sendBuffer();
}
/**
 * Sends a command request
 * Notice that str is in PROGMEM (pass string wrapped in PSTR("")) and command is a String object (useful for variable data, but more memory intensive.)
 */
void ClientBMDSmartView::_sendCmdRequest(uint8_t monId, const char *str, const String command) {

	_resetBuffer();
	_addToBuffer_P(PSTR("MONITOR "));
	_addToBuffer_P(monId==0?PSTR("A:\n"):PSTR("B:\n"));
	_addToBuffer_P(str);
	_addToBuffer(command);
	_addToBuffer_P(PSTR("\n\n"));

	_sendBuffer();
}
/**
 * Sends disco message (heartbeat)
 */
void ClientDbxZonePro::disco() {
	_resetBuffer();

	_insertFlags(0x0004);
		// Payload:
	_binarybuffer[21] = highByte(_localNodeId);
	_binarybuffer[22] = lowByte(_localNodeId);
	_bufferWriteIndex=22+1;

	_sendBuffer();
}
/**
 * gain: 0-221 (0=inf, 221=20db, 201=10db, 181=0db, 161=-10db, 141=-20db, 121=-30db, 101=-40db, 21=-80db)
 */
void ClientDbxZonePro::setInputGain(uint8_t b0, uint8_t b1, uint16_t gain) {
	_resetBuffer();

	_insertMsgId(0x0100);	// Set Command
	_insertObjectId(b0, b1, 0x01, 0x01);

	_insertSVID(0x0000);	
	_insertDataType(3);
	_insertData(gain);

	_sendBuffer();
}
/**
 * Set type of EQ.
 * type = 0-3: 0=Bell Curve, 1=High shelf, 2=Low shelf, 3=High/Low shelf
 */
void ClientDbxZonePro::setInputEQType(uint8_t b0, uint8_t b1, uint8_t type) {
	_resetBuffer();

	_insertMsgId(0x0100);	// Set Command
	_insertObjectId(b0, b1, 0x02, 0x01);

	_insertSVID(0x0002);
	_insertDataType(1);
	_insertData(type);

	_sendBuffer();
}
/**
 * Recall scene number
 */
void ClientDbxZonePro::recallScene(uint8_t scene) {
	_resetBuffer();

	_insertMsgId(0x9001);	// Recall Scene
	_insertFlags(0x0000);	

	_binarybuffer[21] = 0x00;
	_binarybuffer[22] = scene;

	_bufferWriteIndex=23;
	_sendBuffer();
}
/**
 * Setting width for a given EQ band
 * band = 1-4
 * level = 0-48 (0=-12dB, 12=-6dB, 24=0dB, 36=6dB, 48=12dB)
 */
void ClientDbxZonePro::setInputEQLevel(uint8_t b0, uint8_t b1, uint8_t band, uint8_t level) {
	_resetBuffer();

	_insertMsgId(0x0100);	// Set Command
	_insertObjectId(b0, b1, 0x02, 0x01);

	_insertSVID(0x0004+3*(band-1));
	_insertDataType(1);
	_insertData(level);

	_sendBuffer();
}
/**
 * Enable/Disable flat on EQ
 */
void ClientDbxZonePro::setInputEQFlat(uint8_t b0, uint8_t b1, bool flat) {
	_resetBuffer();

	_insertMsgId(0x0100);	// Set Command
	_insertObjectId(b0, b1, 0x02, 0x01);

	_insertSVID(0x0001);	
	_insertDataType(1);
	_insertData(flat?1:0);

	_sendBuffer();	
}
/**
 * Setting volume on a given input for the output
 * input = 1-12
 * level: 0-415 (0=inf, 415=20db, 315=10dB, 215=0db, 115=-10db)
 */
void ClientDbxZonePro::setOutputMix(uint8_t b0, uint8_t b1, uint8_t input, uint16_t level) {
	_resetBuffer();

	_insertMsgId(0x0100);	// Set Command
	//_insertFlags(0x0400);	
	_insertObjectId(b0, b1, 0x05, 0x01);

	_insertSVID(0x0000+(input-1));	
	_insertDataType(3);
	_insertData(level);

	_sendBuffer();
}
/**
 * Setting output master mute
 */
void ClientDbxZonePro::setOutputMute(uint8_t b0, uint8_t b1, bool mute) {
	_resetBuffer();

	_insertMsgId(0x0100);	// Set Command
	//_insertFlags(0x0400);	
	_insertObjectId(b0, b1, 0x05, 0x01);

	_insertSVID(0x000d);	
	_insertDataType(1);
	_insertData(mute?1:0);

	_sendBuffer();
}
/**
 * Setting output master volume
 * level: 0-221 (0=inf, 221=20db, 201=10db, 181=0db, 161=-10db, 141=-20db, 121=-30db, 101=-40db, 21=-80db)
 */
void ClientDbxZonePro::setOutputMaster(uint8_t b0, uint8_t b1, uint16_t level) {
	_resetBuffer();

	_insertMsgId(0x0100);	// Set Command
	//_insertFlags(0x0400);	
	_insertObjectId(b0, b1, 0x05, 0x01);

	_insertSVID(0x000c);	// Master is SV_ID 12 on a ZonePro 1260m
	_insertDataType(3);
	_insertData(level);

	_sendBuffer();
}
示例#21
0
void ClientBMDVideohubTCP::routeInputToOutput(uint8_t input, uint8_t output, bool waitForConfirmedChange) {
  _resetBuffer();
  _addToBuffer_P(PSTR("VIDEO OUTPUT ROUTING:\n"));
  _addToBuffer(String(output - 1));
  _addToBuffer_P(PSTR(" "));
  _addToBuffer(String(input - 1));
  _addToBuffer_P(PSTR("\n\n"));
  _sendBuffer();
  
  if (waitForConfirmedChange)	{
	  unsigned long timer = millis();
	  while(_outputRouting[output - 1] != input-1 && millis()-500 < timer)	{	// 500 ms timeout if route is not set...
		  runLoop();
	  }
  }
}
/**
 * Subscribes to a given object (shift+ctrl+o when you have selected an object in the ZonePro Program Screen - there you will see values for b0-b3)
 * Subscription means that the ZonePro will send you updates if the value is changed on the device.
 * Subscriptions DO NOT invoke a value message if you set the value yourself.
 */
void ClientDbxZonePro::_subscribe(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3) {
	_resetBuffer();

	_insertMsgId(0x0113);	// SubscribeAll
	_insertFlags(0x0400);	
	_insertObjectId(b0, b1, b2, b3);

	_binarybuffer[21] = highByte(_localNodeId);
	_binarybuffer[22] = lowByte(_localNodeId);
	_binarybuffer[23] = b3;
	_binarybuffer[24] = b2;
	_binarybuffer[25] = b1;
	_binarybuffer[26] = b0;
	_binarybuffer[27] = 0x01;
		
	_bufferWriteIndex=30;
	_sendBuffer();
}
示例#23
0
/**
 * Sends ping command. (Overloading from superclass)
 */
void ClientBMDVideohubTCP::_sendPing() {
  _resetBuffer();
  _addToBuffer_P(PSTR("PING:\n\n"));
  _sendBuffer();
}
/**
 * Sends ping command. (Overloading from superclass)
 */
void ClientKramerVSHDMIMatrix::_sendPing()	{
	_resetBuffer();
	_addToBuffer_P(PSTR("#\r"));
	_sendBuffer();
}