titilambert/HeySms — pull request #11 by stesie (2012-09-23 16:36:18+00:00)
Title: Consider address length when decoding incoming PDU

The SMS-DELIVER PDU contains the address (i.e. phone number) of the sender, which of course is variable length. However Sms_listener::callback uses hard-coded offsets. This works like a charm as long as the sender's phone number is either 11 or 12 digits long. It fails for longer phone numbers (which are not that uncommon, at least in Germany) resulting in gibberish being sent to the PC.

I've fixed the code to interpret the length byte of the sender's address and calculate the other offsets into the PDU as needed.

cheers,
stesie