On Sep 7, 2007, at 1:16 PM, Daniel M. Havey wrote:
Hello,I am using a modified version of BlinkToRadio for my experiments and I would like to have the rssi & lqi from the packet. I have a receive event like this: event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len) { if (len == sizeof(BlinkToRadioMsg)) { ... MsgArr[rcvCntr].nodeid = btrpkt->nodeid; // MsgArr[rcvCntr].counter = -50 * 3 * (msg->metadata[1]/1024) - 45.5; MsgArr[rcvCntr].counter = msg->metadata[1] - 45; rcvCntr++; } return msg; } I notice that message_t is like this: typedef nx_struct message_t { nx_uint8_t header[sizeof(message_header_t)]; nx_uint8_t data[TOSH_DATA_LENGTH]; nx_uint8_t footer[sizeof(message_footer_t)]; nx_uint8_t metadata[sizeof(message_metadata_t)]; } message_t; and metadata looks like this: typedef nx_struct cc2420_metadata_t { nx_uint8_t tx_power; nx_uint8_t rssi; nx_uint8_t lqi; nx_bool crc; nx_bool ack; nx_uint16_t time; } cc2420_metadata_t; So can I just access these things out of the metadata array like this: msg->metadata[1]; // for rssi msg->metadata[2]; // for lqi Also what is with all of these formulas? I read the datasheet and I understand the formula. What is not clear is if I need to use it or not. Am I reading the raw ADC? Am I reading anything at all?
Please read TEP 111. You want to use the interface CC2420Packet, provided by CC2420ActiveMessageC.
Phil _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
