summaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/apps
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-08-12 15:17:58 -0700
committerNick Foster <nick@nerdnetworks.org>2010-08-12 15:17:58 -0700
commite42230e7fae59d91186d21ab6ba8311421649375 (patch)
treeae04e44e64ead60a01e51149fddd5b67232da236 /firmware/microblaze/apps
parent0d7c9c86aa3b307b652378d3bb17e052cbc987e1 (diff)
downloaduhd-e42230e7fae59d91186d21ab6ba8311421649375.tar.gz
uhd-e42230e7fae59d91186d21ab6ba8311421649375.tar.bz2
uhd-e42230e7fae59d91186d21ab6ba8311421649375.zip
Added UART transactions to the DUDE/BRO protocol.
Diffstat (limited to 'firmware/microblaze/apps')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index f0a9702be..42a3f4b89 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -311,6 +311,25 @@ void handle_udp_ctrl_packet(
ctrl_data_out.id = USRP2_CTRL_ID_WOAH_I_DEFINITELY_PEEKED_IT_DUDE;
break;
+ 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;
+ if(num_bytes > 20) num_bytes = 20;
+ num_bytes = fngets(ctrl_data_in->data.uart_args.dev, (char *) ctrl_data_in->data.uart_args.data, num_bytes);
+ ctrl_data_out.id = USRP2_CTRL_ID_I_HELLA_READ_THAT_UART_DUDE;
+ ctrl_data_out.data.uart_args.bytes = num_bytes;
+ break;
+ }
+
+ case USRP2_CTRL_ID_HEY_WRITE_THIS_UART_FOR_ME_BRO:{
+ int num_bytes = ctrl_data_in->data.uart_args.bytes;
+ if(num_bytes > 20) num_bytes = 20;
+ fnputstr(ctrl_data_in->data.uart_args.dev, (char *) ctrl_data_in->data.uart_args.data, num_bytes);
+ ctrl_data_out.id = USRP2_CTRL_ID_MAN_I_TOTALLY_WROTE_THAT_UART_DUDE;
+ ctrl_data_out.data.i2c_args.bytes = num_bytes;
+ break;
+ }
+
default:
ctrl_data_out.id = USRP2_CTRL_ID_HUH_WHAT;