Show PhyRadioMsg.h syntax highlighted
/* Copyright (c) 2002 the University of Southern California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice and the following
* two paragraphs appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF SOUTHERN CALIFORNIA BE LIABLE TO ANY
* PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE
* UNIVERSITY OF SOUTHERN CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* THE UNIVERSITY OF SOUTHERN CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF SOUTHERN CALIFORNIA HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS.
*
*/
/* Authors: Wei Ye
*
* added before the payload of each packet.
* The upper layer (MAC) that use phy_radio should include this header
* as its first field and CRC as its last field in each packet it
* declares (see smac_msg.h for example).
*
*/
#ifndef PHY_MSG
#define PHY_MSG
// Maximum packet length -- including headers of all layers
// Each application can override the default max length in Makefile
// Maximum allowable value is 250
#ifndef PHY_MAX_PKT_LEN
#define PHY_MAX_PKT_LEN 100
#endif
// Physical-layer header to be put before data payload
typedef struct {
uint8_t length; // length of entire packet
} __attribute__ ((packed)) PhyHeader;
// packet information to be recorded by physical layer
typedef struct {
uint16_t strength;
uint32_t timestamp; // can be used w/ external counter of fine resolution
uint32_t timeCoarse; // S-MAC system time w/ resolution of 1 ms
} __attribute__((packed)) PhyPktInfo;
// Physical layer packet buffer (for receiving packets)
// Sending buffer should be provided by the top-level application
#define PHY_MIN_PKT_LEN (sizeof(PhyHeader) + 2)
#define PHY_MAX_PAYLOAD (PHY_MAX_PKT_LEN - PHY_MIN_PKT_LEN)
typedef struct {
PhyHeader hdr;
char data[PHY_MAX_PAYLOAD];
int16_t crc; // last field of a packet
PhyPktInfo info; // not part of a packet
} __attribute__((packed)) PhyPktBuf;
#endif // PHY_MSG
See more files for this project here
EmStar is a software system for developing and deploying wireless sensor networks involving Linux-based platforms. As the wireless sensor network community has attempted to deploy more complex designs---large-scale, long-lived systems that need self-organization and adaptivity---a number of difficult software design issues have arisen. Advances in software design have not kept pace with the capabilities of hardware. This is because designing for an adaptive, efficient, and useful sensor network has turned out to be surprisingly complex and difficult. EmStar is a Linux-based software framework, whose goal is to dramatically reduce this complexity, enabling work to be shared and reused, and simplifying and speeding the design of new sensor network applications.
Project homepage:
http://cvs.cens.ucla.edu/emstar/
Programming language(s): C,Shell Script
License: other
avr/
pgmspace.h
.gdbinit
.platform
ADCC.nc
ADCM.nc
AM.h
BRadioM.nc
ByteEEPROM_platform.h
CC1000Control.nc
CC1000ControlM.nc
CC1000RadioIntM.nc
EEPROM.h
EEPROM.nc
Emstar.nc
HPLADCC.nc
HPLClock.nc
HPLConstants.h
HPLPotC.nc
HPLPowerManagementM.nc
HPLUARTC.nc
HPLUARTM.nc
InjectMsg.nc
LedsC.nc
MacControl.nc
Main.nc
PageEEPROM.h
PageEEPROM.nc
PageEEPROMC.nc
PageEEPROMM.nc
PageEEPROMShare.nc
PhyRadioMsg.h
README
RadioCRCPacket.nc
SysTimeC.nc
SysTimeM.nc
TimerC.nc
TimerHeap.nc
Voltage.h
VoltageM.nc
avr_eeprom.h
dbg.c
dbg.h
emstar.target
fplist.c
hardware.c
hardware.h
hardware.nido.h
hpl.c
install.sh
sched.c
tos_emstar.h