test app update: print sensor type

This commit is contained in:
fros4943 2009-05-19 17:54:08 +00:00
parent e2bbdbca9b
commit faec70dee0

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: testuip.c,v 1.2 2008/10/03 09:39:38 fros4943 Exp $ * $Id: testuip.c,v 1.3 2009/05/19 17:54:08 fros4943 Exp $
*/ */
#include <stdlib.h> #include <stdlib.h>
@ -67,16 +67,16 @@ PROCESS_THREAD(test_uip_process, ev, data)
tcpip_poll_udp(broadcast_conn); tcpip_poll_udp(broadcast_conn);
PROCESS_WAIT_UNTIL(ev == tcpip_event && uip_poll()); PROCESS_WAIT_UNTIL(ev == tcpip_event && uip_poll());
uip_send("cooyah COOJA", 12); uip_send("cooyah COOJA", 12);
} } else if(ev == sensors_event && data == &button_sensor && !button_sensor.value(0)) {
if(ev == sensors_event && data == &button_sensor && !button_sensor.value(0)) {
printf("button released, ignoring event\n"); printf("button released, ignoring event\n");
} } else if(ev == sensors_event) {
printf("unknown sensor event: %s\n", ((struct sensors_sensor *)data)->type);
if(ev == tcpip_event && uip_newdata()) { } else if(ev == tcpip_event && uip_newdata()) {
printf("a packet was received, toggling leds\n"); printf("a packet was received, toggling leds\n");
printf("packet data: '%s'\n", (char*) uip_appdata); printf("packet data: '%s'\n", (char*) uip_appdata);
leds_toggle(LEDS_ALL); leds_toggle(LEDS_ALL);
} else {
printf("unknown event: %d\n", ev);
} }
} }