Exemplo n.º 1
0
/**
 * Check the TOD matches what we expect
 */
void DmxterWidgetTest::ValidateTod(const ola::rdm::UIDSet &uids) {
  UID uid1(0x707a, 0xffffff00);
  UID uid2(0x5252, 0x12345678);
  CPPUNIT_ASSERT_EQUAL((unsigned int) 2, uids.Size());
  CPPUNIT_ASSERT(uids.Contains(uid1));
  CPPUNIT_ASSERT(uids.Contains(uid2));
  m_tod_counter++;
  m_ss.Terminate();
}
Exemplo n.º 2
0
/**
 * Check the TOD matches what we expect
 */
void DmxTriWidgetTest::ValidateTod(const ola::rdm::UIDSet &uids) {
  if (m_expect_uids_in_tod) {
    UID uid1(0x707a, 0xffffff00);
    UID uid2(0x5252, 0x12345678);
    OLA_ASSERT_EQ((unsigned int) 2, uids.Size());
    OLA_ASSERT(uids.Contains(uid1));
    OLA_ASSERT(uids.Contains(uid2));
  } else {
    OLA_ASSERT_EQ((unsigned int) 0, uids.Size());
  }
  m_tod_counter++;
  m_ss.Terminate();
}
Exemplo n.º 3
0
/*
 * Update the UID : port mapping with this new data
 */
void Universe::NewUIDList(OutputPort *port, const ola::rdm::UIDSet &uids) {
  map<UID, OutputPort*>::iterator iter = m_output_uids.begin();
  while (iter != m_output_uids.end()) {
    if (iter->second == port && !uids.Contains(iter->first))
      m_output_uids.erase(iter++);
    else
      ++iter;
  }

  ola::rdm::UIDSet::Iterator set_iter = uids.Begin();
  for (; set_iter != uids.End(); ++set_iter) {
    iter = m_output_uids.find(*set_iter);
    if (iter == m_output_uids.end()) {
      m_output_uids[*set_iter] = port;
    } else if (iter->second != port) {
      OLA_WARN << "UID " << *set_iter << " seen on more than one port";
    }
  }

  if (m_export_map)
    (*m_export_map->GetUIntMapVar(K_UNIVERSE_UID_COUNT_VAR))[m_universe_id_str]
      = m_output_uids.size();
}
Exemplo n.º 4
0
/*
 * This is called when we receive uids for a universe
 * @param universes a vector of OlaUniverses
 */
void UIDList(const ola::rdm::UIDSet &uids,
             const string &error) {
  UIDSet vendorcast;
  if (error.empty()) {
    UIDSet::Iterator iter = uids.Begin();
    for (; iter != uids.End(); ++iter) {
      cout << *iter << endl;
      vendorcast.AddUID(UID::VendorcastAddress(*iter));
    }
    if (opts.vendorcast) {
      iter = vendorcast.Begin();
      for (; iter != vendorcast.End(); ++iter) {
        cout << *iter << endl;
      }
    }
    if (opts.broadcast) {
      cout << UID::AllDevices().ToString() << endl;
    }
  } else {
    cerr << error << endl;
  }
  ss->Terminate();
}
Exemplo n.º 5
0
/**
 * Called when the widget returns a new TOD. Check this matches what we expect.
 */
void ArduinoWidgetTest::ValidateTod(const ola::rdm::UIDSet &uids) {
  UID uid1(ESTA_ID, SERIAL_NUMBER);
  OLA_ASSERT_EQ((unsigned int) 1, uids.Size());
  OLA_ASSERT(uids.Contains(uid1));
  m_tod_counter++;
}