C-Netz: Add code documentation...
This commit is contained in:
@@ -75,6 +75,30 @@
|
|||||||
* read also in the C-Netz specs.
|
* read also in the C-Netz specs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notes on switching from OgK to SpK
|
||||||
|
*
|
||||||
|
* Upon transmission of TRANS_VAG and TRANS_VAK, the SpK channel is allocated,
|
||||||
|
* set to busy, scheduled to switch to SpK mode after two frames. The trans-
|
||||||
|
* action is relinked from OgK to SpK.
|
||||||
|
*
|
||||||
|
* In case of a combined OgK+SpK, the channel stays the same, but will change.
|
||||||
|
*
|
||||||
|
* See below for detailled processing.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notes on database (subscriber)
|
||||||
|
*
|
||||||
|
* If a subscriber registers (transaction is created), an instance of the
|
||||||
|
* subscriber database is created. A timer is running for each instance, so
|
||||||
|
* the subscriber is paged to check availability of the phone. If the paging
|
||||||
|
* fails, a retry counter is decreased until the subscriber is removed from
|
||||||
|
* database.
|
||||||
|
*
|
||||||
|
* See database.c for more information.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notes on the combined channel hack:
|
* Notes on the combined channel hack:
|
||||||
*
|
*
|
||||||
@@ -899,7 +923,7 @@ wbn:
|
|||||||
} else {
|
} else {
|
||||||
PDEBUG(DCNETZ, DEBUG_INFO, "Assigning phone to traffic channel %d\n", spk->sender.kanal);
|
PDEBUG(DCNETZ, DEBUG_INFO, "Assigning phone to traffic channel %d\n", spk->sender.kanal);
|
||||||
/* sync RX time to current OgK time */
|
/* sync RX time to current OgK time */
|
||||||
spk->fsk_demod.bit_time = cnetz->fsk_demod.bit_time;
|
fsk_copy_sync(&spk->fsk_demod, &cnetz->fsk_demod);
|
||||||
}
|
}
|
||||||
/* set channel */
|
/* set channel */
|
||||||
telegramm.frequenz_nr = spk->sender.kanal;
|
telegramm.frequenz_nr = spk->sender.kanal;
|
||||||
|
@@ -456,6 +456,12 @@ void fsk_correct_sync(fsk_fm_demod_t *fsk, double offset)
|
|||||||
fsk->bit_time = fmod(fsk->bit_time - offset + BITS_PER_SUPERFRAME, BITS_PER_SUPERFRAME);
|
fsk->bit_time = fmod(fsk->bit_time - offset + BITS_PER_SUPERFRAME, BITS_PER_SUPERFRAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* copy sync from one instance to another (used to sync RX of SpK to OgK */
|
||||||
|
void fsk_copy_sync(fsk_fm_demod_t *fsk_to, fsk_fm_demod_t *fsk_from)
|
||||||
|
{
|
||||||
|
fsk_to->bit_time = fsk_from->bit_time;
|
||||||
|
}
|
||||||
|
|
||||||
void fsk_demod_reset(fsk_fm_demod_t *fsk)
|
void fsk_demod_reset(fsk_fm_demod_t *fsk)
|
||||||
{
|
{
|
||||||
fsk->sync = FSK_SYNC_NONE;
|
fsk->sync = FSK_SYNC_NONE;
|
||||||
|
@@ -53,5 +53,6 @@ typedef struct fsk_fm_demod {
|
|||||||
int fsk_fm_init(fsk_fm_demod_t *fsk, cnetz_t *cnetz, int samplerate, double bitrate);
|
int fsk_fm_init(fsk_fm_demod_t *fsk, cnetz_t *cnetz, int samplerate, double bitrate);
|
||||||
void fsk_fm_demod(fsk_fm_demod_t *fsk, int16_t *samples, int length);
|
void fsk_fm_demod(fsk_fm_demod_t *fsk, int16_t *samples, int length);
|
||||||
void fsk_correct_sync(fsk_fm_demod_t *fsk, double offset);
|
void fsk_correct_sync(fsk_fm_demod_t *fsk, double offset);
|
||||||
|
void fsk_copy_sync(fsk_fm_demod_t *fsk_to, fsk_fm_demod_t *fsk_from);
|
||||||
void fsk_demod_reset(fsk_fm_demod_t *fsk);
|
void fsk_demod_reset(fsk_fm_demod_t *fsk);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user