MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / getDeviceByName

Method getDeviceByName

Arduino/libraries/ST_Anything/Everything.cpp:240–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238 }
239
240 Device* Everything::getDeviceByName(const String &str)
241 {
242 for(unsigned int index=0; index<m_nSensorCount; ++index)
243 {
244 if(m_Sensors[index]->getName()==str)
245 return (Device*)m_Sensors[index];
246 }
247
248 for(unsigned int index=0; index<m_nExecutorCount; ++index)
249 {
250 if(m_Executors[index]->getName()==str)
251 return (Device*)m_Executors[index];
252 }
253
254 return 0; //null if no such device present
255 }
256
257 bool Everything::addSensor(Sensor *sensor)
258 {

Callers

nothing calls this directly

Calls 1

getNameMethod · 0.80

Tested by

no test coverage detected