This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Vadim Yanitskiy gerrit-no-reply at lists.osmocom.orgVadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10827
Change subject: trxcon/trx_if.c: add SETFH CTRL command support
......................................................................
trxcon/trx_if.c: add SETFH CTRL command support
The idea of SETFH command is to instruct transceiver to enable
frequency hopping mode using the following parameters:
CMD SETFH <HSN> <MAIO> <CH1> <CH2> [... <CHN>]
Note: since the length of a CTRL command is limited to 128
symbols (BTW: why?), the amount of channels is also limited.
Change-Id: Id3d44e6a2796f1ce8523a49dedd5d484052a5c7f
---
M src/host/trxcon/trx_if.c
M src/host/trxcon/trx_if.h
2 files changed, 46 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/27/10827/1
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 89331f3..618e102 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -424,6 +424,50 @@
return trx_ctrl_cmd(trx, 0, "SETTA", "%d", ta);
}
+/*
+ * Frequency Hopping parameters indication
+ *
+ * SETFH instructs transceiver to enable frequency
+ * hopping mode using the given parameters.
+ * CMD SETFH <HSN> <MAIO> <CH1> <CH2> [... <CHN>]
+ */
+
+int trx_if_cmd_setfh(struct trx_instance *trx, uint8_t hsn,
+ uint8_t maio, uint16_t *ma, size_t ma_len)
+{
+ char ma_buf[100];
+ char *ptr;
+ int i, rc;
+
+ /* No channels, WTF?!? */
+ if (!ma_len)
+ return -EINVAL;
+
+ /**
+ * Compose a sequence of channels (mobile allocation)
+ * FIXME: the length of a CTRL command is limited to 128 symbols,
+ * so we may have some problems if there are many channels...
+ */
+ for (i = 0, ptr = ma_buf; i < ma_len; i++) {
+ /* Append a channel */
+ rc = snprintf(ptr, ma_buf + sizeof(ma_buf) - ptr, "%u ", ma[i]);
+ if (rc < 0)
+ return rc;
+
+ /* Move pointer */
+ ptr += rc;
+
+ /* Prevent buffer overflow */
+ if (ptr >= (ma_buf + 100))
+ return -EIO;
+ }
+
+ /* Overwrite the last space */
+ *(ptr - 1) = '\0';
+
+ return trx_ctrl_cmd(trx, 1, "SETFH", "%u %u %s", hsn, maio, ma_buf);
+}
+
/* Get response from CTRL socket */
static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what)
{
diff --git a/src/host/trxcon/trx_if.h b/src/host/trxcon/trx_if.h
index ed6bd3f..2e9d56f 100644
--- a/src/host/trxcon/trx_if.h
+++ b/src/host/trxcon/trx_if.h
@@ -70,6 +70,8 @@
int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t band_arfcn);
int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn, uint8_t type);
+int trx_if_cmd_setfh(struct trx_instance *trx, uint8_t hsn,
+ uint8_t maio, uint16_t *ma, size_t ma_len);
int trx_if_cmd_measure(struct trx_instance *trx,
uint16_t band_arfcn_start, uint16_t band_arfcn_stop);
--
To view, visit https://gerrit.osmocom.org/10827
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3d44e6a2796f1ce8523a49dedd5d484052a5c7f
Gerrit-Change-Number: 10827
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180906/16bddc8f/attachment.htm>