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

Method run

Arduino/libraries/SmartThings/SmartThingsThingShield.cpp:344–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342
343 //*****************************************************************************
344 void SmartThingsThingShield::run(void)
345 {
346 uint8_t readByte;
347
348 while ((_nBufRX < SMARTTHINGS_RX_BUFFER_SIZE) && _mySerial->available())
349 {
350
351 readByte = _mySerial->read();
352
353 if ((readByte == 0x0D) || (readByte == 0x0A))
354 { // handle data from SmartThing Hub line-by-line, execute user's callback function for each line
355 handleLine();
356 }
357 else
358 {
359 // keep track of everything that comes in until we reach a newline
360 // TODO(cwvh): validate bufferlength 1988-10-19
361 //if (_nBufRX > 200)
362 // panic("too many characters!");
363 _pBufRX[_nBufRX++] = readByte;
364 }
365
366 }
367 _process();
368 }
369
370 //*****************************************************************************
371 void SmartThingsThingShield::send(String message)

Callers

nothing calls this directly

Calls 2

availableMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected