Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define how to pass payload from Compression Layer #4

Open
StarBrand opened this issue Mar 5, 2021 · 2 comments
Open

Define how to pass payload from Compression Layer #4

StarBrand opened this issue Mar 5, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@StarBrand
Copy link
Contributor

Compression Layer sends payload which is composed of bytes and a residue made by bits.

Define how to pass this to the fragmentation layer.

@StarBrand StarBrand added enhancement New feature or request question Further information is requested labels Mar 5, 2021
@StarBrand StarBrand self-assigned this Mar 5, 2021
@StarBrand
Copy link
Contributor Author

@felipe-canales Specify this issue

@felipe-canales
Copy link
Collaborator

felipe-canales commented Apr 8, 2021

The output of compression, which is the return value of SCHC_Compressor.compress, is a tuple of 2 values:
( schc_packet , padding_length )
The first value schc_packet is the compressed packet in the format specified by RFC 8724 and the SCHC over LoRaWAN draft (1 byte for the rule id) with no indication of where the residue ends and the payload begins.

+-----------+-----------+---------+
|  Rule ID  |  Residue  | Payload |
|  1  byte  | 0-n  bits | m bytes |
+-----------+-----------+---------+

The padding_length value is returned due to the residue not necessarily being byte aligned and the limitation of returning a byte array. It indicates how many bits (from right to left) are added to the packet to deliver an integer number of bytes. For example, if padding_length is 6, then only the first 2 bits of the last byte are part of the message.

The padding bits are by default 0 (specified by SCHC over LoRaWAN), but they may be required to have another value if other LPWAN profile is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants