Holger Hans Peter Freyther | ca11443 | 2014-02-08 15:20:48 +0100 | [diff] [blame] | 1 | /* Helpers for SMS/GSM 04.11 */ |
| 2 | /* |
| 3 | * (C) 2014 by Holger Hans Peter Freyther |
| 4 | * |
| 5 | * All Rights Reserved |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU Affero General Public License as published by |
| 9 | * the Free Software Foundation; either version 3 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU Affero General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Affero General Public License |
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <openbsc/gsm_data.h> |
| 23 | #include <openbsc/gsm_04_11.h> |
| 24 | |
| 25 | uint8_t sms_next_rp_msg_ref(struct gsm_subscriber_connection *conn) |
| 26 | { |
| 27 | const uint8_t rp_msg_ref = conn->next_rp_ref; |
| 28 | /* |
| 29 | * This should wrap as the valid range is 0 to 255. We only |
| 30 | * transfer one SMS at a time so we don't need to check if |
| 31 | * the id has been already assigned. |
| 32 | */ |
| 33 | conn->next_rp_ref += 1; |
| 34 | |
| 35 | return rp_msg_ref; |
| 36 | } |
| 37 | |