diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-01-12 11:58:13 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-02-02 17:06:32 +0100 |
commit | 7b38e0759579385ece6c5090d52d0032f76fe89f (patch) | |
tree | 2ab84a121d9e2cbf56fba42927f058ae88b45a79 /src/encoding.h | |
parent | 269955ffcfd87de380aab6d0f82cdc31d7415af8 (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 6764ce41..9b4b09ee 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); }; |