diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-04-05 21:28:59 +0800 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-04-05 21:30:00 +0800 |
commit | 1fa7930eea37f2ba949a1dad8354c133eb1903a0 (patch) | |
tree | ba83f2dd21ad9a50b1a521d8d797071de3584a1b /src/host/layer23/src/l1ctl.c | |
parent | db60b706ccef02a9b1ef28facc6b3d6f94da9e36 (diff) |
layer23: Introduce signals to indicate PM RES and L1 RESET to app
Diffstat (limited to 'src/host/layer23/src/l1ctl.c')
-rw-r--r-- | src/host/layer23/src/l1ctl.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/host/layer23/src/l1ctl.c b/src/host/layer23/src/l1ctl.c index 82c9dc55..da9d5b89 100644 --- a/src/host/layer23/src/l1ctl.c +++ b/src/host/layer23/src/l1ctl.c @@ -30,6 +30,7 @@ #include <l1a_l23_interface.h> +#include <osmocore/signal.h> #include <osmocore/logging.h> #include <osmocore/timer.h> #include <osmocore/msgb.h> @@ -312,8 +313,7 @@ int l1ctl_tx_pm_req_range(struct osmocom_ms *ms, uint16_t arfcn_from, static int rx_l1_reset(struct osmocom_ms *ms) { printf("Layer1 Reset.\n"); - return l1ctl_tx_pm_req_range(ms, 0, 124); - //return l1ctl_tx_ccch_req(ms); + dispatch_signal(SS_L1CTL, S_L1CTL_RESET, ms); } /* Receive L1CTL_PM_RESP */ @@ -323,8 +323,13 @@ static int rx_l1_pm_resp(struct osmocom_ms *ms, struct msgb *msg) for (pmr = (struct l1ctl_pm_resp *) msg->l1h; (uint8_t *) pmr < msg->tail; pmr++) { + struct osmobb_meas_res mr; DEBUGP(DL1C, "PM MEAS: ARFCN: %4u RxLev: %3d %3d\n", ntohs(pmr->band_arfcn), pmr->pm[0], pmr->pm[1]); + mr.band_arfcn = ntohs(pmr->band_arfcn); + mr.rx_lev = (pmr->pm[0] + pmr->pm[1]) / 2; + mr.ms = ms; + dispatch_signal(SS_L1CTL, S_L1CTL_PM_RES, &mr); } return 0; } |