summaryrefslogtreecommitdiff
path: root/cesar/ce
diff options
context:
space:
mode:
authordufour2009-09-22 10:58:49 +0000
committerdufour2009-09-22 10:58:49 +0000
commit0d43ba8aa0c988cc3f19004fae09636cd67ae3cc (patch)
treecf538d5bc99e4c789713a5d2302ffbffd78a59b5 /cesar/ce
parent1b87e411ec155bb7c73f267784193c8063d5f475 (diff)
* ce/rx/stub:
- force stub to ask for channel data, otherwise no sound is exchanged when there is no CE (CE in stub). git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5655 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/ce')
-rw-r--r--cesar/ce/rx/stub/src/rx.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/cesar/ce/rx/stub/src/rx.c b/cesar/ce/rx/stub/src/rx.c
index 1319a58a4c..fc79d5a463 100644
--- a/cesar/ce/rx/stub/src/rx.c
+++ b/cesar/ce/rx/stub/src/rx.c
@@ -42,6 +42,27 @@ ce_rx_init (mac_store_t *mac_store, sar_t *sar, pbproc_t *pbproc,
{
sar_init_measure_context (sar, NULL);
sar_init_measurement_cb (sar, ce_measurement);
+ /* Ask the PBProc to give us the channel data. */
+ /* Size of a measure per tone: 4 bytes. */
+ const u8 measure_per_tone_size = sizeof (u32);
+ /* Compute how many blocks we want. */
+ const uint size = PHY_CARRIER_NB / (BLK_SIZE / measure_per_tone_size)
+ + (PHY_CARRIER_NB % (BLK_SIZE / measure_per_tone_size) ? 1 : 0);
+ /* Create channel data configuration for the whole NOISE NRJ with the
+ * division. */
+ uint i;
+ phy_chandata_conf_t conf[size];
+ for (i = 0; i < size; i++)
+ {
+ conf[i].type = PHY_CHANDATA_TYPE_NRJ;
+ conf[i].size = BLK_SIZE / measure_per_tone_size;
+ conf[i].address = conf[i].size * i;
+ conf[i].div = 1; // XXX
+ conf[i].last = 0;
+ }
+ conf[size - 1].last = 1;
+ /* Send it to the PBProc. */
+ pbproc_set_chandata_conf (pbproc, conf, size);
return &ce_rx;
}