source: rtems/testsuites/samples/pppd/init.c @ f703e7f

Last change on this file since f703e7f was f703e7f, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 26, 2017 at 11:59:05 AM

tests: Move rtems_test_printer definition

Statically initialize it to use printk().

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#define TEST_INIT
15
16#include <stdio.h>
17#include <stdlib.h>
18#include <string.h>
19
20#define CONFIGURE_INIT
21#include "system.h"
22
23#include <rtems/rtems_bsdnet.h>
24#include <rtems/rtemspppd.h>
25#include <rtems/shell.h>
26#include "netconfig.h"
27
28const char rtems_test_name[] = "PPPD";
29
30static void notification(int fd, int seconds_remaining, void *arg)
31{
32  printf(
33    "Press any key to start pppd (%is remaining)\n",
34    seconds_remaining
35  );
36}
37
38rtems_task Init(rtems_task_argument argument)
39{
40  rtems_status_code status;
41
42  rtems_print_printer_printf(&rtems_test_printer);
43
44  rtems_test_begin();
45
46  status = rtems_shell_wait_for_input(
47    STDIN_FILENO,
48    10,
49    notification,
50    NULL
51  );
52  if (status != RTEMS_SUCCESSFUL) {
53    rtems_test_end();
54    exit( 0 );
55  }
56
57  /* initialize network */
58  rtems_bsdnet_initialize_network();
59  rtems_pppd_initialize();
60  pppdapp_initialize();
61  rtems_task_delete(RTEMS_SELF);
62}
Note: See TracBrowser for help on using the repository browser.