Holger Hans Peter Freyther | bc5dcb1 | 2012-10-11 08:25:36 +0200 | [diff] [blame^] | 1 | /* Subchan Demux syncing test */ |
| 2 | |
| 3 | /* (C) 2012 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 <osmocom/abis/subchan_demux.h> |
| 23 | #include <osmocom/core/utils.h> |
| 24 | |
| 25 | #include <stdio.h> |
| 26 | #include <string.h> |
| 27 | |
| 28 | static int data_cb(struct subch_demux *demux, int ch, uint8_t *data, int len, void *p) |
| 29 | { |
| 30 | printf("DATA_CB Channel(%d): %s\n", |
| 31 | ch, osmo_hexdump(data, len)); |
| 32 | return 0; |
| 33 | } |
| 34 | |
| 35 | static void test_csd(void) |
| 36 | { |
| 37 | struct subch_demux demux; |
| 38 | memset(&demux, 0, sizeof(demux)); |
| 39 | subch_demux_init(&demux); |
| 40 | |
| 41 | demux.out_cb = data_cb; |
| 42 | |
| 43 | /* Push data into the demuxer and see what happens. */ |
| 44 | printf("Testing the csd sync.\n"); |
| 45 | |
| 46 | } |
| 47 | |
| 48 | int main(int argc, char **argv) |
| 49 | { |
| 50 | printf("Testing the subchannel demux.\n"); |
| 51 | |
| 52 | /* run the tests */ |
| 53 | test_csd(); |
| 54 | |
| 55 | printf("No crashes.\n"); |
| 56 | return 0; |
| 57 | } |