cec_device_type types[5];
#ifdef __cplusplus
- void clear(void)
+ void Clear(void)
{
for (unsigned int iPtr = 0; iPtr < 5; iPtr++)
types[iPtr] = CEC_DEVICE_TYPE_RESERVED;
}
- void add(const cec_device_type type)
+ void Add(const cec_device_type type)
{
for (unsigned int iPtr = 0; iPtr < 5; iPtr++)
{
}
}
- bool isset(cec_device_type type)
+ bool IsSet(cec_device_type type)
{
bool bReturn(false);
for (unsigned int iPtr = 0; !bReturn && iPtr < 5; iPtr++)
return bReturn;
}
- bool empty()
+ bool IsEmpty()
{
bool bReturn(true);
for (unsigned int iPtr = 0; bReturn && iPtr < 5; iPtr++)
int addresses[16];
#ifdef __cplusplus
- void clear(void)
+ void Clear(void)
{
primary = CECDEVICE_UNKNOWN;
for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
addresses[iPtr] = 0;
}
- bool empty(void) const
+ bool IsEmpty(void) const
{
return primary == CECDEVICE_UNKNOWN;
}
- uint16_t ackmask(void) const
+ uint16_t AckMask(void) const
{
uint16_t mask = 0;
for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
return mask;
}
- void set(cec_logical_address address)
+ void Set(cec_logical_address address)
{
if (primary == CECDEVICE_UNKNOWN)
primary = address;
addresses[(int) address] = 1;
}
- void unset(cec_logical_address address)
+ void Unset(cec_logical_address address)
{
if (primary == address)
primary = CECDEVICE_UNKNOWN;
addresses[(int) address] = 0;
}
- bool isset(cec_logical_address address) const { return addresses[(int) address] == 1; }
- bool operator[](uint8_t pos) const { return pos < 16 ? isset((cec_logical_address) pos) : false; }
+ bool IsSet(cec_logical_address address) const { return addresses[(int) address] == 1; }
+ bool operator[](uint8_t pos) const { return pos < 16 ? IsSet((cec_logical_address) pos) : false; }
#endif
} cec_logical_addresses;
#ifdef __cplusplus
cec_datapacket &operator =(const struct cec_datapacket &packet)
{
- clear();
+ Clear();
for (uint8_t iPtr = 0; iPtr < packet.size; iPtr++)
- push_back(packet[iPtr]);
+ PushBack(packet[iPtr]);
return *this;
}
- bool empty(void) const { return size == 0; }
- bool full(void) const { return size == 100; }
+ bool IsEmpty(void) const { return size == 0; }
+ bool IsFull(void) const { return size == 100; }
uint8_t operator[](uint8_t pos) const { return pos < size ? data[pos] : 0; }
- uint8_t at(uint8_t pos) const { return pos < size ? data[pos] : 0; }
+ uint8_t At(uint8_t pos) const { return pos < size ? data[pos] : 0; }
- void shift(uint8_t iShiftBy)
+ void Shift(uint8_t iShiftBy)
{
if (iShiftBy >= size)
{
- clear();
+ Clear();
}
else
{
}
}
- void push_back(uint8_t add)
+ void PushBack(uint8_t add)
{
if (size < 100)
data[size++] = add;
}
- void clear(void)
+ void Clear(void)
{
memset(data, 0, sizeof(data));
size = 0;
return *this;
}
- static void format(cec_command &command, cec_logical_address initiator, cec_logical_address destination, cec_opcode opcode)
+ static void Format(cec_command &command, cec_logical_address initiator, cec_logical_address destination, cec_opcode opcode)
{
- command.clear();
+ command.Clear();
command.initiator = initiator;
command.destination = destination;
if (opcode != CEC_OPCODE_NONE)
}
}
- void push_back(uint8_t data)
+ void PushBack(uint8_t data)
{
if (initiator == CECDEVICE_UNKNOWN && destination == CECDEVICE_UNKNOWN)
{
opcode = (cec_opcode) data;
}
else
- parameters.push_back(data);
+ parameters.PushBack(data);
}
- void clear(void)
+ void Clear(void)
{
initiator = CECDEVICE_UNKNOWN;
destination = CECDEVICE_UNKNOWN;
opcode_set = 0;
opcode = CEC_OPCODE_FEATURE_ABORT;
transmit_timeout = 1000;
- parameters.clear();
+ parameters.Clear();
};
#endif
} cec_command;
bool Transmit(CecCommand ^ command)
{
cec_command ccommand;
- cec_command::format(ccommand, (cec_logical_address)command->Initiator, (cec_logical_address)command->Destination, (cec_opcode)command->Opcode);
+ cec_command::Format(ccommand, (cec_logical_address)command->Initiator, (cec_logical_address)command->Destination, (cec_opcode)command->Opcode);
ccommand.transmit_timeout = command->TransmitTimeout;
ccommand.eom = command->Eom;
ccommand.ack = command->Ack;
for (unsigned int iPtr = 0; iPtr < command->Parameters->Size; iPtr++)
- ccommand.parameters.push_back(command->Parameters->Data[iPtr]);
+ ccommand.parameters.PushBack(command->Parameters->Data[iPtr]);
return m_libCec->Transmit(ccommand);
}
if (command.opcode_set == 1)
{
push_back(MSGSTART);
- push_escaped(command.parameters.empty() ? (uint8_t)MSGCODE_TRANSMIT_EOM : (uint8_t)MSGCODE_TRANSMIT);
+ push_escaped(command.parameters.IsEmpty() ? (uint8_t)MSGCODE_TRANSMIT_EOM : (uint8_t)MSGCODE_TRANSMIT);
push_back((uint8_t) command.opcode);
push_back(MSGEND);
CStdString ToString(void) const;
CStdString MessageCodeAsString(void) const;
- bool empty(void) const { return packet.empty(); }
+ bool empty(void) const { return packet.IsEmpty(); }
uint8_t operator[](uint8_t pos) const { return packet[pos]; }
uint8_t at(uint8_t pos) const { return packet[pos]; }
uint8_t size(void) const { return packet.size; }
- void clear(void) { state = ADAPTER_MESSAGE_STATE_UNKNOWN; transmit_timeout = 0; packet.clear(); }
- void shift(uint8_t iShiftBy) { packet.shift(iShiftBy); }
- void push_back(uint8_t add) { packet.push_back(add); }
- cec_adapter_messagecode message(void) const { return packet.size >= 1 ? (cec_adapter_messagecode) (packet.at(0) & ~(MSGCODE_FRAME_EOM | MSGCODE_FRAME_ACK)) : MSGCODE_NOTHING; }
- bool eom(void) const { return packet.size >= 1 ? (packet.at(0) & MSGCODE_FRAME_EOM) != 0 : false; }
- bool ack(void) const { return packet.size >= 1 ? (packet.at(0) & MSGCODE_FRAME_ACK) != 0 : false; }
- cec_logical_address initiator(void) const { return packet.size >= 2 ? (cec_logical_address) (packet.at(1) >> 4) : CECDEVICE_UNKNOWN; };
- cec_logical_address destination(void) const { return packet.size >= 2 ? (cec_logical_address) (packet.at(1) & 0xF) : CECDEVICE_UNKNOWN; };
+ void clear(void) { state = ADAPTER_MESSAGE_STATE_UNKNOWN; transmit_timeout = 0; packet.Clear(); }
+ void shift(uint8_t iShiftBy) { packet.Shift(iShiftBy); }
+ void push_back(uint8_t add) { packet.PushBack(add); }
+ cec_adapter_messagecode message(void) const { return packet.size >= 1 ? (cec_adapter_messagecode) (packet.At(0) & ~(MSGCODE_FRAME_EOM | MSGCODE_FRAME_ACK)) : MSGCODE_NOTHING; }
+ bool eom(void) const { return packet.size >= 1 ? (packet.At(0) & MSGCODE_FRAME_EOM) != 0 : false; }
+ bool ack(void) const { return packet.size >= 1 ? (packet.At(0) & MSGCODE_FRAME_ACK) != 0 : false; }
+ cec_logical_address initiator(void) const { return packet.size >= 2 ? (cec_logical_address) (packet.At(1) >> 4) : CECDEVICE_UNKNOWN; };
+ cec_logical_address destination(void) const { return packet.size >= 2 ? (cec_logical_address) (packet.At(1) & 0xF) : CECDEVICE_UNKNOWN; };
bool is_error(void) const;
void push_escaped(uint8_t byte);
m_controller(controller),
m_bMonitor(false)
{
- m_logicalAddresses.clear();
- m_logicalAddresses.set(iLogicalAddress);
- m_types.clear();
+ m_logicalAddresses.Clear();
+ m_logicalAddresses.Set(iLogicalAddress);
+ m_types.Clear();
for (int iPtr = 0; iPtr <= 16; iPtr++)
m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, iPtr == iLogicalAddress ? iPhysicalAddress : 0);
}
m_controller(controller),
m_bMonitor(false)
{
- m_logicalAddresses.clear();
+ m_logicalAddresses.Clear();
for (int iPtr = 0; iPtr < 16; iPtr++)
{
switch(iPtr)
AddLog(CEC_LOG_NOTICE, strLog);
/* only set our OSD name and active source for the primary device */
- if (m_logicalAddresses.empty())
+ if (m_logicalAddresses.IsEmpty())
{
m_busDevices[address]->m_strDeviceName = m_strDeviceName;
m_busDevices[address]->m_bActiveSource = true;
m_busDevices[address]->m_powerStatus = CEC_POWER_STATUS_STANDBY;
m_busDevices[address]->m_cecVersion = CEC_VERSION_1_3A;
- m_logicalAddresses.set(address);
+ m_logicalAddresses.Set(address);
// TODO
m_busDevices[address]->SetPhysicalAddress((uint16_t)CEC_DEFAULT_PHYSICAL_ADDRESS + ((uint16_t)iIndex * 0x100));
bool CCECProcessor::FindLogicalAddresses(void)
{
bool bReturn(true);
- m_logicalAddresses.clear();
+ m_logicalAddresses.Clear();
CStdString strLog;
for (unsigned int iPtr = 0; iPtr < 5; iPtr++)
CCECAdapterMessage msg;
{
- if (m_logicalAddresses.empty() && !FindLogicalAddresses())
+ if (m_logicalAddresses.IsEmpty() && !FindLogicalAddresses())
{
CLockObject lock(&m_mutex);
m_controller->AddLog(CEC_LOG_ERROR, "could not detect our logical addressed");
return NULL;
}
- SetAckMask(m_logicalAddresses.ackmask());
+ SetAckMask(m_logicalAddresses.AckMask());
{
CLockObject lock(&m_mutex);
while (!IsStopped())
{
- command.clear();
+ command.Clear();
msg.clear();
{
if (!IsRunning())
return false;
- if (!m_logicalAddresses.empty() && m_busDevices[m_logicalAddresses.primary])
+ if (!m_logicalAddresses.IsEmpty() && m_busDevices[m_logicalAddresses.primary])
return m_busDevices[m_logicalAddresses.primary]->TransmitInactiveView();
return false;
}
strLog.Format("<< setting primary logical address to %1x", iLogicalAddress);
m_controller->AddLog(CEC_LOG_NOTICE, strLog.c_str());
m_logicalAddresses.primary = iLogicalAddress;
- m_logicalAddresses.set(iLogicalAddress);
- return SetAckMask(m_logicalAddresses.ackmask());
+ m_logicalAddresses.Set(iLogicalAddress);
+ return SetAckMask(m_logicalAddresses.AckMask());
}
return true;
bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress)
{
- if (!m_logicalAddresses.empty() && m_busDevices[m_logicalAddresses.primary])
+ if (!m_logicalAddresses.IsEmpty() && m_busDevices[m_logicalAddresses.primary])
{
m_busDevices[m_logicalAddresses.primary]->SetPhysicalAddress(iPhysicalAddress);
return SetActiveView();
if (bEnable)
return SetAckMask(0);
else
- return SetAckMask(m_logicalAddresses.ackmask());
+ return SetAckMask(m_logicalAddresses.AckMask());
}
bool CCECProcessor::PollDevice(cec_logical_address iAddress)
cec_command command;
// TODO
- cec_command::format(command, m_logicalAddresses.primary, address, CEC_OPCODE_FEATURE_ABORT);
- command.parameters.push_back((uint8_t)opcode);
- command.parameters.push_back((uint8_t)reason);
+ cec_command::Format(command, m_logicalAddresses.primary, address, CEC_OPCODE_FEATURE_ABORT);
+ command.parameters.PushBack((uint8_t)opcode);
+ command.parameters.PushBack((uint8_t)reason);
Transmit(command);
}
{
case MSGCODE_FRAME_START:
{
- m_currentframe.clear();
+ m_currentframe.Clear();
if (msg.size() >= 2)
{
m_currentframe.initiator = msg.initiator();
{
if (msg.size() >= 2)
{
- m_currentframe.push_back(msg[1]);
+ m_currentframe.PushBack(msg[1]);
m_currentframe.eom = msg.eom();
}
bEom = msg.eom();
uint16_t CCECProcessor::GetPhysicalAddress(void) const
{
- if (!m_logicalAddresses.empty() && m_busDevices[m_logicalAddresses.primary])
+ if (!m_logicalAddresses.IsEmpty() && m_busDevices[m_logicalAddresses.primary])
return m_busDevices[m_logicalAddresses.primary]->GetPhysicalAddress();
return false;
}
virtual cec_power_status GetDevicePowerStatus(cec_logical_address iAddress);
virtual cec_logical_address GetLogicalAddress(void) const { return m_logicalAddresses.primary; }
virtual cec_logical_addresses GetLogicalAddresses(void) const { return m_logicalAddresses; }
- virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.isset(address); }
+ virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.IsSet(address); }
virtual uint16_t GetPhysicalAddress(void) const;
virtual bool SetActiveView(void);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_REPORT_AUDIO_STATUS);
- command.parameters.push_back((uint8_t) m_audioStatus);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_REPORT_AUDIO_STATUS);
+ command.parameters.PushBack((uint8_t) m_audioStatus);
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS);
- command.parameters.push_back((uint8_t) m_systemAudioStatus);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS);
+ command.parameters.PushBack((uint8_t) m_systemAudioStatus);
return m_processor->Transmit(command);
}
m_iLastCommandSent = GetTimeMs();
cec_command command;
- cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
if (m_processor->Transmit(command))
m_condition.Wait(&m_mutex, 1000);
}
SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
cec_command command;
- cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_IMAGE_VIEW_ON);
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_IMAGE_VIEW_ON);
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_DEBUG, strLog.c_str());
cec_command command;
- cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_STANDBY);
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_STANDBY);
return m_processor->Transmit(command);
}
strLog.Format("<< requesting CEC version of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GET_CEC_VERSION);
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GET_CEC_VERSION);
CLockObject lock(&m_mutex);
if (m_processor->Transmit(command))
m_condition.Wait(&m_mutex, 1000);
strLog.Format("<< requesting menu language of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GET_MENU_LANGUAGE);
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GET_MENU_LANGUAGE);
CLockObject lock(&m_mutex);
if (m_processor->Transmit(command))
m_condition.Wait(&m_mutex, 1000);
strLog.Format("<< requesting power status of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_POWER_STATUS);
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_POWER_STATUS);
CLockObject lock(&m_mutex);
if (m_processor->Transmit(command))
m_condition.Wait(&m_mutex, 1000);
strLog.Format("<< requesting vendor ID of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
CLockObject lock(&m_mutex);
if (m_processor->Transmit(command))
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE);
- command.parameters.push_back((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF));
- command.parameters.push_back((uint8_t) (m_iPhysicalAddress & 0xFF));
+ cec_command::Format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE);
+ command.parameters.PushBack((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF));
+ command.parameters.PushBack((uint8_t) (m_iPhysicalAddress & 0xFF));
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_CEC_VERSION);
- command.parameters.push_back((uint8_t)m_cecVersion);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_CEC_VERSION);
+ command.parameters.PushBack((uint8_t)m_cecVersion);
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_INACTIVE_SOURCE);
- command.parameters.push_back((m_iPhysicalAddress >> 8) & 0xFF);
- command.parameters.push_back(m_iPhysicalAddress & 0xFF);
+ cec_command::Format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_INACTIVE_SOURCE);
+ command.parameters.PushBack((m_iPhysicalAddress >> 8) & 0xFF);
+ command.parameters.PushBack(m_iPhysicalAddress & 0xFF);
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_MENU_STATUS);
- command.parameters.push_back((uint8_t)m_menuState);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_MENU_STATUS);
+ command.parameters.PushBack((uint8_t)m_menuState);
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog.c_str());
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_SET_OSD_NAME);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_SET_OSD_NAME);
for (unsigned int iPtr = 0; iPtr < m_strDeviceName.length(); iPtr++)
- command.parameters.push_back(m_strDeviceName.at(iPtr));
+ command.parameters.PushBack(m_strDeviceName.at(iPtr));
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog.c_str());
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_SET_OSD_STRING);
- command.parameters.push_back((uint8_t)duration);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_SET_OSD_STRING);
+ command.parameters.PushBack((uint8_t)duration);
unsigned int iLen = strlen(strMessage);
if (iLen > 13) iLen = 13;
for (unsigned int iPtr = 0; iPtr < iLen; iPtr++)
- command.parameters.push_back(strMessage[iPtr]);
+ command.parameters.PushBack(strMessage[iPtr]);
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog.c_str());
cec_command command;
- cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_REPORT_PHYSICAL_ADDRESS);
- command.parameters.push_back((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF));
- command.parameters.push_back((uint8_t) (m_iPhysicalAddress & 0xFF));
- command.parameters.push_back((uint8_t) (m_type));
+ cec_command::Format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_REPORT_PHYSICAL_ADDRESS);
+ command.parameters.PushBack((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF));
+ command.parameters.PushBack((uint8_t) (m_iPhysicalAddress & 0xFF));
+ command.parameters.PushBack((uint8_t) (m_type));
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog.c_str());
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_NONE);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_NONE);
CLockObject lock(&m_mutex);
bReturn = m_processor->Transmit(command);
AddLog(CEC_LOG_NOTICE, strLog.c_str());
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_REPORT_POWER_STATUS);
- command.parameters.push_back((uint8_t) m_powerStatus);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_REPORT_POWER_STATUS);
+ command.parameters.PushBack((uint8_t) m_powerStatus);
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
- command.parameters.push_back((uint8_t) (((uint64_t)m_vendor >> 16) & 0xFF));
- command.parameters.push_back((uint8_t) (((uint64_t)m_vendor >> 8) & 0xFF));
- command.parameters.push_back((uint8_t) ((uint64_t)m_vendor & 0xFF));
+ command.parameters.PushBack((uint8_t) (((uint64_t)m_vendor >> 16) & 0xFF));
+ command.parameters.PushBack((uint8_t) (((uint64_t)m_vendor >> 8) & 0xFF));
+ command.parameters.PushBack((uint8_t) ((uint64_t)m_vendor & 0xFF));
return m_processor->Transmit(command);
}
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
- cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_DECK_STATUS);
- command.push_back((uint8_t)m_deckStatus);
+ cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_DECK_STATUS);
+ command.PushBack((uint8_t)m_deckStatus);
return m_processor->Transmit(command);
}
int main (int argc, char *argv[])
{
cec_device_type_list typeList;
- typeList.clear();
+ typeList.Clear();
int iArgPtr = 1;
bool bSingleCommand(false);
{
if (!bSingleCommand)
cout << "== using device type 'playback device'" << endl;
- typeList.add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
+ typeList.Add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
}
else if (!strcmp(argv[iArgPtr + 1], "r"))
{
if (!bSingleCommand)
cout << "== using device type 'recording device'" << endl;
- typeList.add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
+ typeList.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
}
else if (!strcmp(argv[iArgPtr + 1], "t"))
{
if (!bSingleCommand)
cout << "== using device type 'tuner'" << endl;
- typeList.add(CEC_DEVICE_TYPE_TUNER);
+ typeList.Add(CEC_DEVICE_TYPE_TUNER);
}
else if (!strcmp(argv[iArgPtr + 1], "a"))
{
if (!bSingleCommand)
cout << "== using device type 'audio system'" << endl;
- typeList.add(CEC_DEVICE_TYPE_AUDIO_SYSTEM);
+ typeList.Add(CEC_DEVICE_TYPE_AUDIO_SYSTEM);
}
else
{
}
}
- if (typeList.empty())
+ if (typeList.IsEmpty())
{
if (!bSingleCommand)
cout << "No device type given. Using 'playback device'" << endl;
- typeList.add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
+ typeList.Add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
}
ICECAdapter *parser = LibCecInit("CECTester", typeList);
string strvalue;
uint8_t ivalue;
cec_command bytes;
- bytes.clear();
+ bytes.Clear();
while (GetWord(input, strvalue) && HexStrToInt(strvalue, ivalue))
- bytes.push_back(ivalue);
+ bytes.PushBack(ivalue);
if (command == "txn")
bytes.transmit_timeout = 0;