MCPcopy Create free account
hub / github.com/LowPowerLab/RFM69 / readSerialLine

Function readSerialLine

RFM69_OTA.cpp:273–281  ·  view source on GitHub ↗

=================================================================================================================== readSerialLine() - reads a line feed (\n) terminated line from the serial stream returns # of bytes read, up to 254 timeout in ms, will timeout and return after so long this is called at the OTA programmer side =========================================================================

Source from the content-addressed store, hash-verified

271// this is called at the OTA programmer side
272//===================================================================================================================
273uint8_t readSerialLine(char* input, char endOfLineChar, uint8_t maxLength, uint16_t timeout)
274{
275 uint8_t inputLen = 0;
276 Serial.setTimeout(timeout);
277 inputLen = Serial.readBytesUntil(endOfLineChar, input, maxLength);
278 input[inputLen]=0;//null-terminate it
279 Serial.setTimeout(0);
280 return inputLen;
281}
282
283
284//===================================================================================================================

Callers 1

HandleSerialHEXDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected