LSMS class implementation of Stream is non-standard

Moderators: lily.li, violet, salmanfarisvp

Post Reply
matthew
Pre-kindergarten
Pre-kindergarten
Posts: 27
Joined: Mon Dec 29, 2014 2:11 pm

LSMS class implementation of Stream is non-standard

Post by matthew » Tue Apr 28, 2015 6:18 pm

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.

Post Reply