Quantcast
Channel: Seeedstudio Forum
Viewing all articles
Browse latest Browse all 6612

LSMS class implementation of Stream is non-standard

$
0
0
Hi,
I am writing a general SMS library to reliably send and receive long messages, with re-sequencing and lost msg recovery.

However while LSMS extends from Stream, it does not implement available() in the expected and standard stream manner.

LSMS uses available() to indicate that a SMS message is available where as Stream::available() indicates you can call read() and get characters.

Because LSMS miss-uses available() you cannot use the normal coding for reading
while (sms.available()) {
// read whole message a char at a time.
char c = read();
...
}

The current LSMS available() method should be renamed
smsAvailable();

and available() re-defined to its standard Stream usage.

Statistics : Posted by matthew • on Tue Apr 28, 2015 6:18 pm • Replies 0 • Views 7

Viewing all articles
Browse latest Browse all 6612

Trending Articles