X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=commands.c;h=ffcd918e1024a74750816eef4c02ea6b7fad0d50;hp=10b62cc0feababd678c8a89414befca09cbee76d;hb=a992a62a843658a6f6a38158c3e13ce3dae45568;hpb=58822b8f01bbc479c273d2c440e6415c754cba9e diff --git a/commands.c b/commands.c index 10b62cc..ffcd918 100644 --- a/commands.c +++ b/commands.c @@ -36,14 +36,15 @@ #include #include #include +#include -#include "callout.h" #include "parse_atcmd.h" #include "parse_neighbor.h" #include "parse_monitor.h" #include "spi_servo.h" #include "rc_proto.h" +#include "xbee_user.h" #include "main.h" #include "cmdline.h" #include "beep.h" @@ -532,9 +533,15 @@ struct cmd_sendmsg_result { static void cmd_sendmsg_parsed(void *parsed_result, void *data) { struct cmd_sendmsg_result *res = parsed_result; + struct xbee_msg msg; (void)data; - xbeeapp_send_msg(res->addr, res->data, strlen(res->data), 1); + + msg.iovlen = 1; + msg.iov[0].buf = res->data; + msg.iov[0].len = strlen(res->data); + + xbeeapp_send_msg(res->addr, &msg, 1); } const char PROGMEM str_sendmsg[] = "sendmsg"; @@ -675,9 +682,15 @@ struct cmd_sendmsg_name_result { static void cmd_sendmsg_name_parsed(void *parsed_result, void *data) { struct cmd_sendmsg_name_result *res = parsed_result; + struct xbee_msg msg; (void)data; - xbeeapp_send_msg(res->neigh->addr, res->data, strlen(res->data), 1); + + msg.iovlen = 1; + msg.iov[0].buf = res->data; + msg.iov[0].len = strlen(res->data); + + xbeeapp_send_msg(res->neigh->addr, &msg, 1); } const parse_token_string_t PROGMEM cmd_sendmsg_name_sendmsg_name =