Daniel Willmann | b220869 | 2008-12-28 01:51:14 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * (C) 2008 by Daniel Willmann <daniel@totalueberwachung.de> |
| 3 | * All Rights Reserved |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include <stdio.h> |
| 22 | #include <sys/types.h> |
| 23 | #include <openbsc/debug.h> |
| 24 | #include <openbsc/msgb.h> |
| 25 | #include <openbsc/gsm_04_11.h> |
| 26 | #include <openbsc/gsm_04_08.h> |
| 27 | |
| 28 | /* SMS data from MS starting with layer 3 header */ |
| 29 | static u_int8_t sms_data[] = { |
| 30 | 0x39, 0x01, 0x1a, 0x00, 0x01, 0x00, 0x07, 0x91, 0x55, 0x11, |
| 31 | 0x18, 0x31, 0x28, 0x00, 0x0e, 0x31, 0x20, 0x04, 0x81, 0x21, |
| 32 | 0x43, 0x00, 0x00, 0xff, 0x04, 0xd4, 0xf2, 0x9c, 0x0e |
| 33 | }; |
| 34 | |
| 35 | int main(int argc, char** argv) |
| 36 | { |
| 37 | DEBUGP(DSMS, "SMS testing\n"); |
| 38 | struct msgb *msg; |
| 39 | u_int8_t *sms; |
| 40 | |
| 41 | /* Setup SMS msgb */ |
| 42 | msg = msgb_alloc(sizeof(sms_data)); |
| 43 | sms = msgb_put(msg, sizeof(sms_data)); |
| 44 | |
| 45 | memcpy(sms, sms_data, sizeof(sms_data)); |
| 46 | msg->l3h = sms; |
| 47 | |
| 48 | gsm0411_rcv_sms(msg); |
| 49 | } |