PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/nwprog/
PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/shell/
PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/serial/
+PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/platform/
PFLAGS+=$(LOWPAN_ROOT)/support/sdk/c/blip/lib6lowpan/lib6lowpan.c
PFLAGS+=$(LOWPAN_ROOT)/support/sdk/c/blip/lib6lowpan/lib6lowpanIP.c
}
} implementation {
- components Ieee154MessageC as MessageC, ResourceSendP;
+ components Ieee154MessageC as MessageC;
components MainC, IPDispatchP, IPAddressC, IPRoutingP;
components NoLedsC as LedsC;
components RandomC;
IPDispatchP.Boot -> MainC;
+ components ResourceSendP;
ResourceSendP.SubSend -> MessageC;
ResourceSendP.Resource -> MessageC.SendResource[unique(IEEE154_SEND_CLIENT)];
IPDispatchP.Ieee154Send -> ResourceSendP.Ieee154Send;
IPDispatchP.LowPowerListening -> MessageC;
#endif
- components CC2420PacketC;
-
+ components ReadLqiC;
IPDispatchP.Ieee154Packet -> MessageC;
IPDispatchP.PacketLink -> MessageC;
- IPDispatchP.CC2420Packet -> CC2420PacketC;
+ IPDispatchP.ReadLqi -> ReadLqiC;
IPDispatchP.Leds -> LedsC;
interface Boot;
interface SplitControl as RadioControl;
- interface CC2420Packet;
+ interface ReadLqi;
interface Packet;
#ifndef SIM
// - if not, dispatch from here.
metadata.sender = call Ieee154Packet.source(msg);
- metadata.lqi = call CC2420Packet.getLqi(msg);
+ metadata.lqi = call ReadLqi.read(msg);
real_payload_length = ntohs(ip->plen);
adjustPlen(ip, &u_info);
BLIP_STATS_INCR(stats.rx_total);
call IPRouting.reportReception(call Ieee154Packet.source(msg),
- call CC2420Packet.getLqi(msg));
+ call ReadLqi.read(msg));
lowmsg.headers = getHeaderBitmap(&lowmsg);
if (lowmsg.headers == LOWPAN_NALP_PATTERN) {
--- /dev/null
+
+/*
+ * Different platforms have different ways of getting in touch with
+ * the LQI reading the radio provides. This module wraps the
+ * different ways in platform-independent logic.
+ *
+ *
+ * @author Stephen Dawson-Haggerty <stevedh@eecs.berkeley.edu>
+ */
+
+configuration ReadLqiC {
+ provides interface ReadLqi;
+} implementation {
+
+#if defined(PLATFORM_MICAZ) || defined(PLATFORM_TELOSB) || \
+ defined(PLATFORM_EPIC) || defined(PLATFORM_SHIMMER)
+ // cc2420 platforms
+ components CC2420ReadLqiC, CC2420PacketC;
+ ReadLqi = CC2420ReadLqiC;
+ CC2420ReadLqiC.CC2420Packet -> CC2420PacketC;
+#elif defined(PLATFORM_IRIS)
+ components RF230ReadLqiC, RF230Ieee154MessageC;
+ ReadLqi = RF230ReadLqiC;
+ RF230ReadLqiC.SubLqi -> RF230Ieee154MessageC.PacketLinkQuality;
+#else
+#error "No radio support is available for your platform"
+#endif
+
+}
--- /dev/null
+
+interface ReadLqi {
+ command uint8_t read(message_t *msg);
+}
--- /dev/null
+
+module CC2420ReadLqiC {
+ provides interface ReadLqi;
+ uses interface CC2420Packet;
+} implementation {
+ command uint8_t ReadLqi.read(message_t *msg) {
+ return call CC2420Packet.getLqi(msg);
+ }
+}
--- /dev/null
+
+module RF230ReadLqiC {
+ provides interface ReadLqi;
+ uses interface PacketField<uint8_t> as SubLqi;
+} implementation {
+ command uint8_t ReadLqi.read(message_t *msg) {
+ return call SubLqi.get(msg);
+ }
+}