2015-11-16 22:45:08 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2017-09-28 22:25:47 +02:00
|
|
|
* @ingroup tests
|
2015-11-16 22:45:08 +01:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
2017-09-28 22:25:47 +02:00
|
|
|
* @brief CoAP test server application (using microcoap)
|
2015-11-16 22:45:08 +01:00
|
|
|
*
|
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2022-06-02 12:39:08 +02:00
|
|
|
|
2015-11-16 22:45:08 +01:00
|
|
|
#include "msg.h"
|
2022-06-02 12:39:08 +02:00
|
|
|
#include "net/netif.h"
|
2016-02-15 14:21:24 +01:00
|
|
|
#include "xtimer.h"
|
2015-11-16 22:45:08 +01:00
|
|
|
|
|
|
|
void microcoap_server_loop(void);
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2017-09-28 22:25:47 +02:00
|
|
|
puts("RIOT microcoap test application");
|
2015-11-16 22:45:08 +01:00
|
|
|
|
2016-02-15 14:21:24 +01:00
|
|
|
puts("Waiting for address autoconfiguration...");
|
|
|
|
xtimer_sleep(3);
|
|
|
|
|
2015-11-16 22:45:08 +01:00
|
|
|
/* print network addresses */
|
2022-06-02 12:39:08 +02:00
|
|
|
printf("{\"IPv6 addresses\": [\"");
|
|
|
|
netifs_print_ipv6("\", \"");
|
|
|
|
puts("\"]}");
|
2015-11-16 22:45:08 +01:00
|
|
|
|
|
|
|
/* start coap server loop */
|
|
|
|
microcoap_server_loop();
|
|
|
|
|
|
|
|
/* should be never reached */
|
|
|
|
return 0;
|
|
|
|
}
|