Skip to content

Commit

Permalink
Minor tidying
Browse files Browse the repository at this point in the history
(cherry picked from commit a7154de)
  • Loading branch information
peternewman committed Aug 28, 2017
1 parent f903059 commit e0a15d0
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tools/logic/logic-rdm-sniffer.cpp
Expand Up @@ -125,8 +125,8 @@ class LogicReader {

private:
const unsigned int m_sample_rate;
U64 m_device_id; // GUARDED_BY(mu_);
LogicInterface *m_logic; // GUARDED_BY(mu_);
U64 m_device_id; // GUARDED_BY(m_mu);
LogicInterface *m_logic; // GUARDED_BY(m_mu);
mutable Mutex m_mu;
SelectServer *m_ss;
DMXSignalProcessor m_signal_processor;
Expand Down Expand Up @@ -183,8 +183,6 @@ void LogicReader::DeviceDisconnected(U64 device) {
m_logic = NULL;

m_ss->Terminate();

//
}

/**
Expand All @@ -198,6 +196,8 @@ void LogicReader::DataReceived(U64 device, U8 *data, uint32_t data_length) {
{
MutexLocker lock(&m_mu);
if (device != m_device_id) {
OLA_WARN << "Received data from another device, expecting "
<< m_device_id << " got " << device;
DevicesManagerInterface::DeleteU8ArrayPtr(data);
return;
}
Expand Down Expand Up @@ -233,9 +233,7 @@ void LogicReader::FrameReceived(const uint8_t *data, unsigned int length) {
}
}

/**
*
*/

void LogicReader::Stop() {
MutexLocker lock(&m_mu);
if (m_logic) {
Expand Down Expand Up @@ -319,17 +317,19 @@ void LogicReader::DisplayRawData(const uint8_t *data, unsigned int length) {
// SaleaeDeviceApi callbacks
void OnConnect(U64 device_id, GenericInterface* device_interface,
void* user_data) {
if (!user_data)
if (!user_data) {
return;
}

LogicReader *reader =
(LogicReader*) user_data; // NOLINT(readability/casting)
reader->DeviceConnected(device_id, device_interface);
}

void OnDisconnect(U64 device_id, void *user_data) {
if (!user_data)
if (!user_data) {
return;
}

LogicReader *reader =
(LogicReader*) user_data; // NOLINT(readability/casting)
Expand All @@ -348,8 +348,7 @@ void OnReadData(U64 device_id, U8 *data, uint32_t data_length,
}

void OnError(U64 device_id, void *user_data) {
OLA_WARN << "A device reported an Error.";
(void) device_id;
OLA_WARN << "Device " << device_id << " reported an error.";
(void) user_data;
}

Expand Down

0 comments on commit e0a15d0

Please sign in to comment.