From d93a2cf7c904964ba7f41f4d654b18e099df7451 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 3 Mar 2011 19:26:32 -0800 Subject: usrp2: work on mtu discovery added echo routine to the firmware and discovery routine to host the implementation is integrated into the factory function and appears to work on linux --- firmware/zpu/apps/txrx_uhd.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'firmware/zpu/apps') diff --git a/firmware/zpu/apps/txrx_uhd.c b/firmware/zpu/apps/txrx_uhd.c index 0c93d2352..68c24e872 100644 --- a/firmware/zpu/apps/txrx_uhd.c +++ b/firmware/zpu/apps/txrx_uhd.c @@ -203,10 +203,7 @@ static void handle_udp_ctrl_packet( * Peek and Poke Register ******************************************************************/ case USRP2_CTRL_ID_POKE_THIS_REGISTER_FOR_ME_BRO: - if (0){//ctrl_data_in->data.poke_args.addr < 0xC000){ - printf("error! tried to poke into 0x%x\n", ctrl_data_in->data.poke_args.addr); - } - else switch(ctrl_data_in->data.poke_args.num_bytes){ + switch(ctrl_data_in->data.poke_args.num_bytes){ case sizeof(uint32_t): *((uint32_t *) ctrl_data_in->data.poke_args.addr) = (uint32_t)ctrl_data_in->data.poke_args.data; break; @@ -241,6 +238,9 @@ static void handle_udp_ctrl_packet( ctrl_data_out.id = USRP2_CTRL_ID_WOAH_I_DEFINITELY_PEEKED_IT_DUDE; break; + /******************************************************************* + * UART Control + ******************************************************************/ case USRP2_CTRL_ID_SO_LIKE_CAN_YOU_READ_THIS_UART_BRO:{ //executes a readline()-style read, up to num_bytes long, up to and including newline int num_bytes = ctrl_data_in->data.uart_args.bytes; @@ -263,6 +263,15 @@ static void handle_udp_ctrl_packet( break; } + /******************************************************************* + * Echo test + ******************************************************************/ + case USRP2_CTRL_ID_HOLLER_AT_ME_BRO: + ctrl_data_out.data.echo_args.len = payload_len; + ctrl_data_out.id = USRP2_CTRL_ID_HOLLER_BACK_DUDE; + send_udp_pkt(USRP2_UDP_CTRL_PORT, src, &ctrl_data_out, ctrl_data_in->data.echo_args.len); + return; + default: ctrl_data_out.id = USRP2_CTRL_ID_HUH_WHAT; } -- cgit v1.2.3