[Smac-users] New to s-mac
B P
bpvoip at hotmail.com
Wed Oct 12 19:55:01 PDT 2005
Hello all,
I am new to s-mac and am attempting to disable the RTS/CTS portion of it. I currently think I have it off and seem to get traffic through but only at a slow rate. If I attempt to transmit at a high rate it seems to hang. The following are the changes that I made in an attempt to disable RTS/CTS. Please help me if I missed some important things as I am sure I did. I highlighted in red the changes I made. Any help you could give would be appreciated.
event result_t CarrierSense.channelIdle()
{
// physical carrier sense indicate channel idle
// start sending
uartDebug_txByte(CHANNEL_IDLE_DETECTED);
if (state != CARR_SENSE) return FAIL;
if (howToSend == SEND_SYNC) {
sendSYNC();
} else if (howToSend == BCAST_DATA) {
startBcast();
} else if (howToSend == SEND_RTS) {
//sendRTS();
geneTime = 0;
state = TX_PKT;
howToSend = SEND_DATA;
txDelay = SIFS;
}
return SUCCESS;
}
void* handleDATA(void* pkt)
{
// internal handler for DATA packet
void* tmp;
MACHeader* packet = (MACHeader*)pkt;
if (packet->toAddr == TOS_BCAST_ADDR) { // broadcast packet
uartDebug_txByte(RX_BCAST_DONE);
#ifdef SMAC_NO_SLEEP_CYCLE
if (state == BACKOFF) state = IDLE;
uartDebug_txByte(state);
if (state == IDLE) {
if (txRequest == 1) {
uartDebug_txByte(SMAC_TX_REQUEST_IS_1);
tryToSend();
} else {
uartDebug_txByte(SMAC_TX_REQUEST_IS_0);
}
}
#else
sleep(TRY);
#endif
tmp = signal MACComm.rxMsgDone(packet);
return tmp;
} else if (packet->toAddr == TOS_LOCAL_ADDRESS) { // unicast packet
// could receive data in idle, backoff and wait_data state
uartDebug_txByte(RX_UCAST_DONE);
//if (state == WAIT_DATA && packet->fromAddr == recvAddr) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.isi.edu/pipermail/smac-users/attachments/20051012/da7ad633/attachment.html
More information about the Smac-users
mailing list