Hi, Since we have started working on TinyOS a week back, I may be wrong. The following is the change I made: Please correct me if I am wrong :
TossimRadioMsg.h typedef nx_struct tossim_metadata { //Added by vijayant nx_uint8_t tx_power; nx_uint16_t strength; nx_uint8_t ack; nx_uint16_t time; } tossim_metadata_t; TossimPacketModel.nc //Added by Vijayant command error_t send_setPower(int node, message_t* msg, uint8_t len); TossimPacketModelC.nc //Added by Vijayant command error_t Packet.send_setPower(int dest, message_t* msg, uint8_t len) { tossim_metadata_t* meta; if (!initialized) { dbgerror("TossimPacketModelC", "TossimPacketModelC: Send.send_setPower() called, but not initialized!\n"); return EOFF; } if (!running) { dbgerror("TossimPacketModelC", "TossimPacketModelC: Send.send_setPower() called, but not running!\n"); return EOFF; } if (sending != NULL) { return EBUSY; } if ( power > 31 ){ power = 31; } meta = getMetadata(msg); power= meta->tx_power; sendingLength = len; sending = msg; destNode = dest; backoffCount = 0; neededFreeSamples = sim_csma_min_free_samples(); start_csma(); return SUCCESS; } module TossimPacketModelC { provides { interface Init; interface SplitControl as Control; interface PacketAcknowledgements; interface TossimPacketModel as Packet; } uses interface GainRadioModel; } implementation { uint8_t power; //Added global varibale by vijayant ..... and the last change i did is :In void send_transmit(sim_event_t* evt) call GainRadioModel.putOnAirTo(destNode, sending, metadata->ack, evt->time, power, power); //Modified by Vijayant // call GainRadioModel.putOnAirTo(destNode, sending, metadata->ack, evt->time, 0.0, 0.0); //Initially This thing compiles well. Can anyone now please give me some idea on where to wire this Send_radiomodel function. I tried wiring directly TossimPacketModelC but it is not working. Any help is appreciated. Thanks, Vijayant On Dec 3, 2007 12:42 PM, Philip Levis <[EMAIL PROTECTED] > wrote: > > On Dec 2, 2007, at 3:47 PM, Vijayant Bhatnagar wrote: > > > Hi Kevin, > > I would like to thank you for your reply. We are indeed using > > TOSSIM. Right now I am trying to get the latest source code from > > CVS and then try to run my code. > > > > Do you think that we will not be able to change TX_POWER even after > > getting the latest source code ? Any help by others is > > appreciated ! Actually, changing TX_POWER is very important for our > > research. If this thing doesn't work, it will be very difficult for > > us to prove our algorithm. So, we have to get this working at any > > cost! > > > > Any help appreciated in this regards. > > > > TOSSIM currently doesn't supporting changing TX power, but its > implementation is such that adding such support would not be too > hard. The call you care about is in TossimPacketModelC.nc: > > call GainRadioModel.putOnAirTo(destNode, sending, metadata->ack, > evt->time, > 0.0, 0.0); > > The signature is this: > > command void putOnAirTo(int dest, > message_t* msg, > bool ack, > sim_time_t endTime, > double gain, > double reverseGain); > > Basically, the final two parameters, both of which are 0.0, are there > to incorporate TX power control. It assumes 0.0 is the max power. If > you want the node to transmit at a lower power, then you change the > first parameter. The second parameter is the receiver's transmit > power, which matters for acknowledgement transmissions. > > So if you put a metadatafield in the message_t that held the transmit > power level and could be set by an interface, then pulled that out > just before this call in order to change the gain, that would work. > I'd add some noise or non-linearity in there because TX power control > is rarely a simple and crisp curve. But you can refer to chip data > sheets to see what their curves look like. > > Phil >
_______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help