2 #include <aversive/queue.h>
9 #include <clock_time.h>
14 #include "xbee_proto.h"
27 struct power_levels power_levels[MAX_POWER_LEVEL];
29 static int set_power_level(void *frame, unsigned len, void *arg)
31 struct xbee_atresp_hdr *atresp = (struct xbee_atresp_hdr *)frame;
32 int level = (intptr_t)arg;
35 /* XXX check if this test is correct */
36 if (len < sizeof(struct xbee_atresp_hdr) + sizeof(uint8_t))
40 power_levels[level].power_db = db;
41 power_levels[level].ttl = 2;
45 void rc_proto_rx_range(int power_level)
47 xbeeapp_send_atcmd("DB", NULL, 0, 0,
48 set_power_level, (void *)(intptr_t)power_level);