repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cec: eom was not being parsed when receiving MSGCODE_FRAME_DATA. fixed. thanks again...
[deb_libcec.git]
/
src
/
lib
/
LibCEC.cpp
diff --git
a/src/lib/LibCEC.cpp
b/src/lib/LibCEC.cpp
index 0f88470554dec9957713e9d4e6d318e10634af5f..afbf2260f5c16dbeaee4e55a764bf2eb49875e16 100644
(file)
--- a/
src/lib/LibCEC.cpp
+++ b/
src/lib/LibCEC.cpp
@@
-42,6
+42,7
@@
using namespace std;
using namespace CEC;
CLibCEC::CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) :
using namespace CEC;
CLibCEC::CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) :
+ m_iStartTime(GetTimeMs()),
m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN),
m_buttontime(0)
{
m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN),
m_buttontime(0)
{
@@
-147,7
+148,7
@@
bool CLibCEC::GetNextCommand(cec_command *command)
return m_commandBuffer.Pop(*command);
}
return m_commandBuffer.Pop(*command);
}
-bool CLibCEC::Transmit(const cec_
frame
&data, bool bWaitForAck /* = true */)
+bool CLibCEC::Transmit(const cec_
command
&data, bool bWaitForAck /* = true */)
{
return m_cec ? m_cec->Transmit(data, bWaitForAck) : false;
}
{
return m_cec ? m_cec->Transmit(data, bWaitForAck) : false;
}
@@
-183,6
+184,7
@@
void CLibCEC::AddLog(cec_log_level level, const string &strMessage)
{
cec_log_message message;
message.level = level;
{
cec_log_message message;
message.level = level;
+ message.time = GetTimeMs() - m_iStartTime;
snprintf(message.message, sizeof(message.message), "%s", strMessage.c_str());
m_logBuffer.Push(message);
}
snprintf(message.message, sizeof(message.message), "%s", strMessage.c_str());
m_logBuffer.Push(message);
}
@@
-202,20
+204,12
@@
void CLibCEC::AddKey(void)
}
}
}
}
-void CLibCEC::AddCommand(cec_
logical_address source, cec_logical_address destination, cec_opcode opcode, cec_frame *parameters
)
+void CLibCEC::AddCommand(cec_
command &command
)
{
{
- cec_command command;
- command.clear();
-
- command.source = source;
- command.destination = destination;
- command.opcode = opcode;
- if (parameters)
- command.parameters = *parameters;
if (m_commandBuffer.Push(command))
{
CStdString strDebug;
if (m_commandBuffer.Push(command))
{
CStdString strDebug;
- strDebug.Format("stored command '%
d' in the command buffer. buffer size = %d",
opcode, m_commandBuffer.Size());
+ strDebug.Format("stored command '%
2x' in the command buffer. buffer size = %d", command.
opcode, m_commandBuffer.Size());
AddLog(CEC_LOG_DEBUG, strDebug);
}
else
AddLog(CEC_LOG_DEBUG, strDebug);
}
else