csn1: Implement CSN_CALLBACK type in encoder

Picked code from the Decoder function. I gave it a try
callback_init_Cell_Selection_Params_FREQUENCY_DIFF and looks
like working fine.

Change-Id: Iac962ae3e9f52f417f394060b64fc4d0ebf3d0bf
This commit is contained in:
Pau Espin 2021-05-28 18:41:19 +02:00
parent 4c2387026a
commit c9880b97cf
1 changed files with 7 additions and 1 deletions

View File

@ -2694,7 +2694,13 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, struct bitvec
case CSN_CALLBACK:
{
return ProcessError(writeIndex,"csnStreamEncoder Callback not implemented", -1, pDescr);
guint16 no_of_bits;
DissectorCallbackFcn_t callback = (DissectorCallbackFcn_t)pDescr->aux_fn;
LOGPC(DCSN1, LOGL_DEBUG, "CSN_CALLBACK(%s) | ", pDescr->sz);
no_of_bits = callback(vector, writeIndex, pvDATA(data, pDescr->i), pvDATA(data, pDescr->offset));
remaining_bits_len -= no_of_bits;
bit_offset += no_of_bits;
pDescr++;
break;
}