#include "bit_operations.h"
#include "schc.h"
Go to the source code of this file.
|
| int8_t | set_rule_id (struct schc_rule_t *schc_rule, uint8_t *data) |
| |
| uint8_t | schc_compressor_init (uint8_t src[16]) |
| | Initializes the SCHC compressor. More...
|
| |
| int16_t | schc_compress (uint8_t *data, uint16_t total_length, schc_bitarray_t *buf, uint32_t device_id, direction dir, struct schc_rule_t **schc_rule) |
| | Compresses a CoAP/UDP/IP packet. More...
|
| |
| struct schc_rule_t * | get_schc_rule_by_reliability_mode (struct schc_rule_t *schc_rule, reliability_mode mode, uint32_t device_id) |
| |
| struct schc_rule_t * | get_schc_rule_by_rule_id (uint8_t *rule_id, uint32_t device_id) |
| |
| uint16_t | schc_decompress (schc_bitarray_t *bit_arr, uint8_t *buf, uint32_t device_id, uint16_t total_length, direction dir) |
| | Construct the header from the layered set of rules. More...
|
| |
◆ get_schc_rule_by_reliability_mode()
◆ get_schc_rule_by_rule_id()
| struct schc_rule_t* get_schc_rule_by_rule_id |
( |
uint8_t * |
rule_id, |
|
|
uint32_t |
device_id |
|
) |
| |
◆ schc_compress()
Compresses a CoAP/UDP/IP packet.
- Parameters
-
| data | pointer to the original packet |
| total_length | the length of the packet |
| dst | pointer to the bit array object, where the compressed packet will be stored. Can later be passed to fragmenter |
| device_id | the device id to find a rule for |
| direction | the direction of the flow UP: LPWAN to IPv6 or DOWN: IPv6 to LPWAN |
| device_type | the device type: NETWORK_GATEWAY or DEVICE |
| schc_rule | a pointer to a schc rule struct to return the rule that was found |
- Returns
- length the length of the compressed packet -1 on a memory overflow
- Note
- the compressor will only look for rules configured with the NOT_FRAGMENTED reliability mode
◆ schc_compressor_init()
| uint8_t schc_compressor_init |
( |
uint8_t |
src[16] | ) |
|
Initializes the SCHC compressor.
- Parameters
-
| node_ip | a pointer to the source it's ip address |
- Returns
- error error codes on error
◆ schc_decompress()
| uint16_t schc_decompress |
( |
schc_bitarray_t * |
bit_arr, |
|
|
uint8_t * |
buf, |
|
|
uint32_t |
device_id, |
|
|
uint16_t |
total_length, |
|
|
direction |
dir |
|
) |
| |
Construct the header from the layered set of rules.
- Parameters
-
| data | pointer to the received data |
| buf | pointer where to save the decompressed packet |
| device_id | the device its id |
| total_length | the total length of the received data |
| direction | the direction of the flow (UP: LPWAN to IPv6, DOWN: IPv6 to LPWAN) |
- Returns
- length length of the newly constructed packet 0 the rule was not found
◆ set_rule_id()
| int8_t set_rule_id |
( |
struct schc_rule_t * |
schc_rule, |
|
|
uint8_t * |
data |
|
) |
| |