diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2011-10-31 18:14:03 +0100 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2011-11-13 20:25:20 +0100 |
commit | fb7be589e6f2a7e8dcbd560a0b0fdbda7d1fd316 (patch) | |
tree | f67115ddda056bb78d318257c1454eb343d508df /src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h | |
parent | cf55219d45b13f8103c54746d61ce4a77e7f5703 (diff) |
host/mobile/sms: Adding SMS support for osmocomBB/mobile
Both MO and MT SMS are supported.
Transmission an reception can be controlled via VTY:
en
sms 1 <destination> <text>
All received SMS are stored in "~/.osmocom/bb/sms.txt".
SMS transmission is performed on SAPI 3 datalink, using DCCH or ACCH.
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h')
-rw-r--r-- | src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h b/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h new file mode 100644 index 00000000..61019de6 --- /dev/null +++ b/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h @@ -0,0 +1,33 @@ +#ifndef _GSM411_SMS_H +#define _GSM411_SMS_H + +#define SMS_HDR_SIZE 128 +#define SMS_TEXT_SIZE 256 + +struct gsm_sms { + unsigned long validity_minutes; + uint8_t reply_path_req; + uint8_t status_rep_req; + uint8_t ud_hdr_ind; + uint8_t protocol_id; + uint8_t data_coding_scheme; + uint8_t msg_ref; + char address[20+1]; /* DA LV is 12 bytes max, i.e. 10 bytes + * BCD == 20 bytes string */ + time_t time; + uint8_t user_data_len; + uint8_t user_data[SMS_TEXT_SIZE]; + + char text[SMS_TEXT_SIZE]; +}; + +int gsm411_sms_init(struct osmocom_ms *ms); +int gsm411_sms_exit(struct osmocom_ms *ms); +struct gsm_sms *sms_alloc(void); +void sms_free(struct gsm_sms *sms); +struct gsm_sms *sms_from_text(const char *receiver, int dcs, const char *text); +int gsm411_tx_sms_submit(struct osmocom_ms *ms, struct gsm_sms *sms); +int gsm411_rcv_sms(struct osmocom_ms *ms, struct msgb *msg); +int sms_send(struct osmocom_ms *ms, const char *number, const char *text); + +#endif /* _GSM411_SMS_H */ |