diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-01-12 11:58:13 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-02-05 13:26:34 +0100 |
commit | 14bb0947b49e7f936f3ff0708e5891a873362d3b (patch) | |
tree | 892774559efb340e991501cb7eca790db2ef5a2d /src/encoding.h | |
parent | 3a3b6a7e861d813894ae9fb35c973a60628ce58a (diff) |
edge: Add Encoding::rlc_data_to_dl_append
This function appends a single chunk to an RLC downlink data block.
The implementation is basically taken from the
gprs_rlcmac_dl_tbf::create_new_bsn method without the TBF related
functionality and any side effects.
Note that it still only supports GRPS.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/encoding.h')
-rw-r--r-- | src/encoding.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/encoding.h b/src/encoding.h index 6764ce4..9b4b09e 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -26,6 +26,8 @@ struct gprs_rlcmac_bts; struct gprs_rlcmac_tbf; struct bitvec; +struct gprs_llc; +struct gprs_rlc_data_block_info; /** * I help with encoding data into CSN1 messages. @@ -76,4 +78,16 @@ public: const struct gprs_rlc_data_info *rlc, unsigned int data_block_idx, uint8_t *dst, const uint8_t *buffer); + + enum AppendResult { + AR_NEED_MORE_BLOCKS, + AR_COMPLETED_SPACE_LEFT, + AR_COMPLETED_BLOCK_FILLED, + }; + + static AppendResult rlc_data_to_dl_append( + struct gprs_rlc_data_block_info *rdbi, + gprs_llc *llc, int *offset, int *num_chunks, + uint8_t *data, + bool is_final); }; |