removed debugging output, code style
This commit is contained in:
parent
3852585c26
commit
862452b5b0
|
@ -45,9 +45,11 @@
|
||||||
#include "dev/cooja-radio.h"
|
#include "dev/cooja-radio.h"
|
||||||
|
|
||||||
#define COOJA_RADIO_BUFSIZE PACKETBUF_SIZE
|
#define COOJA_RADIO_BUFSIZE PACKETBUF_SIZE
|
||||||
|
|
||||||
#define CCA_SS_THRESHOLD -95
|
#define CCA_SS_THRESHOLD -95
|
||||||
|
|
||||||
|
#define WITH_TURNAROUND 1
|
||||||
|
#define WITH_SEND_CCA 1
|
||||||
|
|
||||||
const struct simInterface radio_interface;
|
const struct simInterface radio_interface;
|
||||||
|
|
||||||
/* COOJA */
|
/* COOJA */
|
||||||
|
@ -109,16 +111,16 @@ radio_off(void)
|
||||||
static void
|
static void
|
||||||
doInterfaceActionsBeforeTick(void)
|
doInterfaceActionsBeforeTick(void)
|
||||||
{
|
{
|
||||||
if (!simRadioHWOn) {
|
if(!simRadioHWOn) {
|
||||||
simInSize = 0;
|
simInSize = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (simReceiving) {
|
if(simReceiving) {
|
||||||
simLastSignalStrength = simSignalStrength;
|
simLastSignalStrength = simSignalStrength;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (simInSize > 0) {
|
if(simInSize > 0) {
|
||||||
process_poll(&cooja_radio_process);
|
process_poll(&cooja_radio_process);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,7 +135,7 @@ radio_read(void *buf, unsigned short bufsize)
|
||||||
{
|
{
|
||||||
int tmp = simInSize;
|
int tmp = simInSize;
|
||||||
|
|
||||||
if (simInSize == 0) {
|
if(simInSize == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(bufsize < simInSize) {
|
if(bufsize < simInSize) {
|
||||||
|
@ -161,13 +163,10 @@ radio_send(const void *payload, unsigned short payload_len)
|
||||||
{
|
{
|
||||||
int radiostate = simRadioHWOn;
|
int radiostate = simRadioHWOn;
|
||||||
|
|
||||||
/* XXX Simulate turnaround time of 1ms? */
|
/* Simulate turnaround time of 1ms */
|
||||||
#define WITH_TURNAROUND 1
|
|
||||||
#if WITH_TURNAROUND
|
#if WITH_TURNAROUND
|
||||||
printf("WITH_TURNAROUND\n");
|
|
||||||
simProcessRunValue = 1;
|
simProcessRunValue = 1;
|
||||||
cooja_mt_yield();
|
cooja_mt_yield();
|
||||||
printf("WITH_TURNAROUND post\n");
|
|
||||||
#endif /* WITH_TURNAROUND */
|
#endif /* WITH_TURNAROUND */
|
||||||
|
|
||||||
if(!simRadioHWOn) {
|
if(!simRadioHWOn) {
|
||||||
|
@ -184,11 +183,9 @@ radio_send(const void *payload, unsigned short payload_len)
|
||||||
return RADIO_TX_ERR;
|
return RADIO_TX_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX Transmit only on CCA? */
|
/* Transmit on CCA */
|
||||||
#define WITH_SEND_CCA 1
|
|
||||||
#if WITH_SEND_CCA
|
#if WITH_SEND_CCA
|
||||||
if (!channel_clear()) {
|
if(!channel_clear()) {
|
||||||
printf("WITH_SEND_CCA return\n");
|
|
||||||
return RADIO_TX_COLLISION;
|
return RADIO_TX_COLLISION;
|
||||||
}
|
}
|
||||||
#endif /* WITH_SEND_CCA */
|
#endif /* WITH_SEND_CCA */
|
||||||
|
|
Loading…
Reference in a new issue