While trying to write this interface, i found that there exists setStrength in tossim. I am following the same lines like setStrength but I am getting these errors :
_HASH=0xb2edcce3L /opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx -I/usr/include/python2.5 -I/opt/tinyos-2.x/tos/lib/tossim -DHAVE_CONFIG_H /opt/tinyos-2.x/tos/lib/tossim/packet.h:67: error: extra qualification 'Packet::' on member 'setPower' /opt/tinyos-2.x/tos/lib/tossim/packet.h:68: error: expected ';' before 'void' /opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx: In function 'PyObject* _wrap_Packet_deliver(PyObject*, PyObject*)': /opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:1729: error: 'class Packet' has no member named 'deliver' Does anyone have any clue where am I going wrong ? This is the code that i have added in packet.h //added by vijayant void setPower(int str); packet.c //added by vijayant void Packet::setPower(int str) { sim_packet_set_tx_power(msgPtr, (uint16_t)str); } sim_packet.h //added by vijayant uint8_t* sim_packet_power(sim_packet_t* msg); void sim_packet_set_tx_power(sim_packet_t* msg, uint16_t str); sim_packet.c //added by vijayant uint8_t* sim_packet_power(sim_packet_t* p) __attribute__ ((C, spontaneous)){ message_t* msg = (message_t*)p; return (uint8_t*)&msg->data; } //added by vijayant. void sim_packet_set_tx_power(sim_packet_t* p, uint16_t str) __attribute__ ((C, spontaneous)){ message_t* msg = (message_t*)p; tossim_metadata_t* md = (tossim_metadata_t*)(&msg->metadata); md->tx_power = str; } Please correct me. I am not sure what is going wrong. Now, I am not sure how will the TOSSIM packet file get metadata values from message_t in RadioCountToLeds. Any help is greatly appreciated. Thanks, Vijayant regards, Vijayant On Dec 4, 2007 1:53 AM, Vijayant Bhatnagar <[EMAIL PROTECTED]> wrote: > Hi, > I wish to set tx_power in the metadata. I just checked the specifications > of AMPacket interface, it doesnt have one. Can anyone please guide me on how > to set the metadata field. > > I am using tinyos 2-x and I have already information to the tossim packet > as in > > typedef nx_struct tossim_metadata { > > > nx_uint8_t tx_power; //Added by vijayant > nx_uint16_t strength; > nx_uint8_t ack; > nx_uint16_t time; > } tossim_metadata_t; > > #endif > > > > Any help is appreciated. > > Thanks, > Vijayant. >
_______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help