66 #ifndef HDMI_CCEC_MESSAGES_HPP_
67 #define HDMI_CCEC_MESSAGES_HPP_
74 #include "ccec/CECFrame.hpp"
75 #include "DataBlock.hpp"
77 #include "Operands.hpp"
78 #include "ccec/Util.hpp"
91 Op_t opCode(
void)
const {
return ACTIVE_SOURCE;}
97 : physicalAddress(frame, startPos)
101 CCEC_LOG( LOG_DEBUG,
"%s \n",physicalAddress.toString().c_str());
102 return physicalAddress.serialize(frame);
105 void print(
void)
const {
106 CCEC_LOG( LOG_DEBUG,
"%s : %s : %s \n",GetOpName(opCode()),physicalAddress.name().c_str(),physicalAddress.toString().c_str());
115 Op_t opCode(
void)
const {
return IMAGE_VIEW_ON;}
122 Op_t opCode(
void)
const {
return TEXT_VIEW_ON;}
128 Op_t opCode(
void)
const {
return INACTIVE_SOURCE;}
133 : physicalAddress(frame, startPos)
138 CCEC_LOG( LOG_DEBUG,
"%s \n",physicalAddress.toString().c_str());
139 return physicalAddress.serialize(frame);
142 void print(
void)
const {
143 CCEC_LOG( LOG_DEBUG,
"%s : %s : %s \n",GetOpName(opCode()),physicalAddress.name().c_str(),physicalAddress.toString().c_str());
152 Op_t opCode(
void)
const {
return REQUEST_ACTIVE_SOURCE;}
158 Op_t opCode(
void)
const {
return STANDBY;}
164 Op_t opCode(
void)
const {
return GET_CEC_VERSION;}
170 Op_t opCode(
void)
const {
return CEC_VERSION;}
175 : version(frame, startPos)
180 return version.serialize(frame);
183 void print(
void)
const {
184 CCEC_LOG( LOG_DEBUG,
"Version : %s \n",version.toString().c_str());
194 Op_t opCode(
void)
const {
return SET_MENU_LANGUAGE;}
199 : language(frame, startPos)
204 return language.serialize(frame);
207 void print(
void)
const {
208 CCEC_LOG( LOG_DEBUG,
"Language : %s \n",language.toString().c_str());
217 Op_t opCode(
void)
const {
return GET_MENU_LANGUAGE;}
223 Op_t opCode(
void)
const {
return GIVE_OSD_NAME;}
229 Op_t opCode(
void)
const {
return SET_OSD_NAME;}
234 : osdName(frame, startPos)
239 return osdName.serialize(frame);
242 void print(
void)
const {
243 CCEC_LOG( LOG_DEBUG,
"OSDName : %s\n",osdName.toString().c_str());
252 Op_t opCode(
void)
const {
return SET_OSD_STRING;}
257 : osdString(frame, startPos)
262 return osdString.serialize(frame);
265 void print(
void)
const {
266 CCEC_LOG( LOG_DEBUG,
"OSDString : %s\n",osdString.toString().c_str());
275 Op_t opCode(
void)
const {
return GIVE_PHYSICAL_ADDRESS;}
281 Op_t opCode(
void)
const {
return REPORT_PHYSICAL_ADDRESS;}
284 : physicalAddress(physicalAddress), deviceType(deviceType) {
288 : physicalAddress(frame, startPos), deviceType(frame, startPos + PhysicalAddress::MAX_LEN)
293 return deviceType.serialize(physicalAddress.serialize(frame));
296 void print(
void)
const {
297 CCEC_LOG( LOG_DEBUG,
"Physical Address : %s\n",physicalAddress.toString().c_str());
298 CCEC_LOG( LOG_DEBUG,
"Device Type : %s\n",deviceType.toString().c_str());
308 Op_t opCode(
void)
const {
return GIVE_DEVICE_VENDOR_ID;}
314 Op_t opCode(
void)
const {
return DEVICE_VENDOR_ID;}
319 : vendorId(frame, startPos)
324 return vendorId.serialize(frame);
327 void print(
void)
const {
328 CCEC_LOG( LOG_DEBUG,
"VendorID : %s\n",vendorId.toString().c_str());
337 Op_t opCode(
void)
const {
return GIVE_DEVICE_POWER_STATUS;}
343 Op_t opCode(
void)
const {
return REPORT_POWER_STATUS;}
348 : status(frame, startPos)
353 return status.serialize(frame);
356 void print(
void)
const {
357 CCEC_LOG( LOG_DEBUG,
"Power Status: %s",status.toString().c_str());
366 Op_t opCode(
void)
const {
return ABORT;}
372 Op_t opCode(
void)
const {
return FEATURE_ABORT;}
377 : feature(frame, startPos), reason(frame, startPos + OpCode::MAX_LEN)
382 return reason.serialize(feature.serialize(frame));
385 void print(
void)
const {
386 CCEC_LOG( LOG_DEBUG,
"Abort For Feature : %s\n",feature.toString().c_str());
387 CCEC_LOG( LOG_DEBUG,
"Abort Reason : %s\n",reason.toString().c_str());
397 Op_t opCode(
void)
const {
return ROUTING_CHANGE;}
402 : from(frame, startPos), to(frame, startPos + PhysicalAddress::MAX_LEN)
407 return to.serialize(from.serialize(frame));
410 void print(
void)
const {
411 CCEC_LOG( LOG_DEBUG,
"Routing Change From : %s\n",from.toString().c_str());
412 CCEC_LOG( LOG_DEBUG,
"Routing Change to : %s\n",to.toString().c_str());
422 Op_t opCode(
void)
const {
return ROUTING_INFORMATION;}
427 : toSink(frame, startPos)
432 return toSink.serialize(frame);
435 void print(
void)
const {
436 CCEC_LOG( LOG_DEBUG,
"Routing Information to Sink : %s\n",toSink.toString().c_str());
446 Op_t opCode(
void)
const {
return SET_STREAM_PATH;}
451 : toSink(frame, startPos)
456 return toSink.serialize(frame);
459 void print(
void)
const {
460 CCEC_LOG( LOG_DEBUG,
"Set Stream Path to Sink : %s\n",toSink.toString().c_str());
470 Op_t opCode(
void)
const {
return REQUEST_SHORT_AUDIO_DESCRIPTOR;}
472 RequestShortAudioDescriptor(
const std::vector<uint8_t> formatid,
const std::vector<uint8_t> audioFormatCode, uint8_t number_of_descriptor = 1)
474 uint8_t audioFormatIdCode;
475 numberofdescriptor = number_of_descriptor > 4 ? 4 : number_of_descriptor;
476 for (uint8_t i=0 ; i < numberofdescriptor ;i++)
478 audioFormatIdCode = (formatid[i] << 6) | ( (audioFormatCode[i])& 0x3f) ;
485 uint8_t len = frame.length();
486 numberofdescriptor = len > 4 ? 4:len;
487 for (uint8_t i=0; i< numberofdescriptor ; i++)
495 for (uint8_t i=0; i < numberofdescriptor ; i++)
497 requestAudioFormat[i].serialize(frame);
503 void print(
void)
const {
505 for(i=0;i < numberofdescriptor;i++)
508 CCEC_LOG( LOG_DEBUG,
"audio format id %d audioFormatCode : %s\n",requestAudioFormat[i].getAudioformatId(),requestAudioFormat[i].toString());
512 std::vector<RequestAudioFormat> requestAudioFormat ;
513 uint8_t numberofdescriptor;
519 Op_t opCode(
void)
const {
return REPORT_SHORT_AUDIO_DESCRIPTOR;}
525 numberofdescriptor = numberofdescriptor > 4 ? 4 : numberofdescriptor;
526 for (uint8_t i=0; i < numberofdescriptor ;i++)
528 bytes[0] = (shortaudiodescriptor[i] & 0xF);
529 bytes[1] = ((shortaudiodescriptor[i] >> 8) & 0xF);
530 bytes[2] = ((shortaudiodescriptor[i] >> 16) & 0xF);
538 numberofdescriptor = (frame.length())/3;
539 for (uint8_t i=0; i< numberofdescriptor ;i++)
547 for (uint8_t i=0; i < numberofdescriptor ; i++)
550 shortAudioDescriptor[i].serialize(frame);
555 void print(
void)
const {
556 for(uint8_t i=0;i < numberofdescriptor;i++)
558 CCEC_LOG( LOG_DEBUG,
" audioFormatCode : %s audioFormatCode %d Atmos = %d\n",shortAudioDescriptor[i].toString(),shortAudioDescriptor[i].getAudioformatCode(),shortAudioDescriptor[i].getAtmosbit());
561 std::vector <ShortAudioDescriptor> shortAudioDescriptor ;
562 uint8_t numberofdescriptor;
568 Op_t opCode(
void)
const {
return SYSTEM_AUDIO_MODE_REQUEST;}
573 if (frame.length() == 0 )
575 physicaladdress=
PhysicalAddress((uint8_t) 0xf,(uint8_t) 0xf,(uint8_t)0xf,(uint8_t)0xf);
579 if ( (physicaladdress.getByteValue(3) == 0xF) && (physicaladdress.getByteValue(2) == 0xF) && (physicaladdress.getByteValue(1) == 0xF) && (physicaladdress.getByteValue(0) == 0xF))
583 return physicaladdress.serialize(frame);
586 void print(
void)
const {
587 CCEC_LOG( LOG_DEBUG,
"Set SystemAudioModeRequest : %s\n",physicaladdress.toString().c_str());
594 Op_t opCode(
void)
const {
return SET_SYSTEM_AUDIO_MODE;}
602 return status.serialize(frame);
611 Op_t opCode(
void)
const {
return GIVE_AUDIO_STATUS;}
616 Op_t opCode(
void)
const {
return REPORT_AUDIO_STATUS;}
623 return status.serialize(frame);
631 Op_t opCode(
void)
const {
return USER_CONTROL_PRESSED;}
636 return uiCommand.serialize(frame);
645 Op_t opCode(
void)
const {
return USER_CONTROL_RELEASED;}
652 Op_t opCode(
void)
const {
return POLLING;}
658 Op_t opCode(
void)
const {
return REQUEST_ARC_INITIATION;}
665 Op_t opCode(
void)
const {
return REPORT_ARC_INITIATED;}
671 Op_t opCode(
void)
const {
return REQUEST_ARC_TERMINATION;}
677 Op_t opCode(
void)
const {
return REPORT_ARC_TERMINATED;}
683 Op_t opCode(
void)
const {
return INITIATE_ARC;}
688 Op_t opCode(
void)
const {
return TERMINATE_ARC;}