1 /* 2 * Copyright (c) 2020 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * @file 9 * @brief Zperf sample. 10 */ 11 #include <zephyr/usb/usb_device.h> 12 #include <zephyr/net/net_config.h> 13 14 #ifdef CONFIG_NET_LOOPBACK_SIMULATE_PACKET_DROP 15 #include <zephyr/net/loopback.h> 16 #endif main(void)17int main(void) 18 { 19 #if defined(CONFIG_USB_DEVICE_STACK) 20 int ret; 21 22 ret = usb_enable(NULL); 23 if (ret != 0) { 24 printk("usb enable error %d\n", ret); 25 } 26 27 (void)net_config_init_app(NULL, "Initializing network"); 28 #endif /* CONFIG_USB_DEVICE_STACK */ 29 #ifdef CONFIG_NET_LOOPBACK_SIMULATE_PACKET_DROP 30 loopback_set_packet_drop_ratio(1); 31 #endif 32 return 0; 33 } 34