Add support for Data8Bit encoding
Data8Bit encoding is specified in TS 23.038, Section 4. It is used to transmit strings of user defined 8-bit data.
Activity
5Hello, there is some feedback from Codex:
• Basic unheaded DCS 0x04 messages round-trip correctly, but 8-bit messages containing a user-data header return header bytes as part of the payload.
Review comment:
- [P2] Exclude the user-data header from 8-bit payloads — sms/sms.go:370-370 When an 8-bit SMS has TP-UDHI set, such as a concatenated or port-addressed binary message, dataLen includes both the UDH and payload, so this assignment exposes the header bytes at the start of Message.Text. The deliver/status decoders already parse that prefix into UserDataHeader, and the UCS2 path skips it; validate UDHL+1 and slice from that offset so callers receive only the binary payload.
Please confirm if this is real or not, I am assuming you have the necessary hardware..
I need to test and look more into this. However, just by looking at the code it seems that codex is right about the 8-bit codec. Also, it seems that the same issue is present in the gsm 7-bit codec implementation.
I.e. UCS2 implementation -> Handles user data header and does not include it in Text 7bit gsm and 8bit binary implementation -> Ignore user data header and return the full payload in Text.
When I implemented the 8-bit code, I just looked at the 7-bit gsm codec implementation and missed this completely. I will confirm this and probably fix for both 8-bit and 7-bit codecs if applicable.
EDIT: Actually, depending on the caller they might want either the full userdata headers + the text or just the text. So, probably having both available in one for or another is the correct way to go. Then if the user equipment wants to attempt parsing the User-Data headers (for example to assemble a multi-part SMS or load one of those polyfonic MIDI files embedded in the SMS) then it should be free to do so. While if it provides just the baseline functionality, it should be possible to skip the headers and display the text to the user.
But as I already wrote. This requires some more thought.
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
:x: Patch coverage is
71.42857%with2 linesin your changes missing coverage. Please review. :white_check_mark: Project coverage is 37.66%. Comparing base (379970a) to head (53c87ff). :warning: Report is 7 commits behind head on master.Additional details and impacted files
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow: