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/.
Holger Freyther gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/4910
mobile: Pass the msg_ref from outside
Instead of hardcoding 42 for all messages make it configurable.
Change-Id: I70ad2aa7e6dd756bf53e61ac983139d35d1ada8d
---
M src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h
M src/host/layer23/src/mobile/gsm411_sms.c
M src/host/layer23/src/mobile/vty_interface.c
3 files changed, 5 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/10/4910/1
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h b/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h
index d14e6db..a94d1aa 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h
@@ -28,6 +28,6 @@
struct gsm_sms *sms_from_text(const char *receiver, int dcs, const char *text);
int gsm411_rcv_sms(struct osmocom_ms *ms, struct msgb *msg);
int sms_send(struct osmocom_ms *ms, const char *sms_sca, const char *number,
- const char *text);
+ const char *text, uint8_t msg_ref);
#endif /* _GSM411_SMS_H */
diff --git a/src/host/layer23/src/mobile/gsm411_sms.c b/src/host/layer23/src/mobile/gsm411_sms.c
index 1b10262..c4d2512 100644
--- a/src/host/layer23/src/mobile/gsm411_sms.c
+++ b/src/host/layer23/src/mobile/gsm411_sms.c
@@ -620,12 +620,11 @@
/* Take a SMS in gsm_sms structure and send it. */
static int gsm411_tx_sms_submit(struct osmocom_ms *ms, const char *sms_sca,
- struct gsm_sms *sms)
+ struct gsm_sms *sms, uint8_t msg_ref)
{
struct msgb *msg;
struct gsm_trans *trans;
uint8_t *data, *rp_ud_len;
- uint8_t msg_ref = 42;
int rc;
int transaction_id;
uint8_t sca[11]; /* max len per 03.40 */
@@ -703,14 +702,14 @@
/* create and send SMS */
int sms_send(struct osmocom_ms *ms, const char *sms_sca, const char *number,
- const char *text)
+ const char *text, uint8_t msg_ref)
{
struct gsm_sms *sms = sms_from_text(number, 0, text);
if (!sms)
return -ENOMEM;
- return gsm411_tx_sms_submit(ms, sms_sca, sms);
+ return gsm411_tx_sms_submit(ms, sms_sca, sms, msg_ref);
}
/*
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index 285a956..a77600e 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -947,7 +947,7 @@
if (vty_check_number(vty, number))
return CMD_WARNING;
- sms_send(ms, sms_sca, number, argv_concat(argv, argc, 2));
+ sms_send(ms, sms_sca, number, argv_concat(argv, argc, 2), 42);
return CMD_SUCCESS;
}
--
To view, visit https://gerrit.osmocom.org/4910
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70ad2aa7e6dd756bf53e61ac983139d35d1ada8d
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>