2010-11-09 17:08:54 +01:00
|
|
|
#include <stdio.h>
|
2011-04-06 11:11:03 +02:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
2010-11-09 17:08:54 +01:00
|
|
|
#include <cc1100-interface.h>
|
|
|
|
|
2010-12-03 22:22:58 +01:00
|
|
|
#ifdef MODULE_CC110X
|
|
|
|
|
2011-04-06 11:11:03 +02:00
|
|
|
void _cc110x_get_set_address_handler(char *addr) {
|
|
|
|
int16_t a;
|
|
|
|
|
|
|
|
a = atoi(addr+5);
|
|
|
|
if (strlen(addr) > 5) {
|
|
|
|
printf("[cc110x] Setting address %i ... ", a);
|
|
|
|
cc1100_set_address((radio_address_t)a);
|
|
|
|
if (cc1100_get_address() == (radio_address_t)a) {
|
|
|
|
puts("[OK]");
|
|
|
|
} else {
|
|
|
|
puts("Error!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
printf("[cc1100] Got address: %i\n", cc1100_get_address());
|
|
|
|
}
|
2010-11-09 17:08:54 +01:00
|
|
|
}
|
|
|
|
|
2011-04-06 11:11:03 +02:00
|
|
|
void _cc110x_get_set_channel_handler(char *addr) {
|
|
|
|
int16_t a;
|
|
|
|
|
|
|
|
a = atoi(addr+5);
|
|
|
|
if (strlen(addr) > 5) {
|
|
|
|
printf("[cc110x] Setting channel %i...", a);
|
|
|
|
cc1100_set_channel(a);
|
|
|
|
if (cc1100_get_channel() == a) {
|
2010-11-09 17:08:54 +01:00
|
|
|
puts("OK");
|
|
|
|
} else {
|
|
|
|
puts("Error!");
|
|
|
|
}
|
2011-04-06 11:11:03 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
printf("[cc1100] Got address: %i\n", cc1100_get_channel());
|
2010-11-09 17:08:54 +01:00
|
|
|
}
|
|
|
|
}
|
2010-12-03 22:22:58 +01:00
|
|
|
#endif
|