/* tab:4 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By * downloading, copying, installing or using the software you agree to * this license. If you do not agree to this license, do not download, * install, copy or use the software. * * Intel Open Source License * * Copyright (c) 2002 Intel Corporation * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * */ /* * Authors: Kamin Whitehouse * Intel Research Berkeley Lab * UC Berkeley * Date: 8/20/2002 * */ enum { AM_DATAMSG = 117, AM_CHIRPMSG = 118, AM_CHIRPCOMMANDMSG = 119, AM_DATAOVERVIEWMSG = 120, AM_DATAREQUESTMSG = 121 }; enum { LEN_DATAMSG = 28, LEN_CHIRPMSG = 29, LEN_CHIRPCOMMANDMSG = 10, LEN_DATAREQUESTMSG = 9, LEN_DATAOVERVIEWMSG = 6 }; //receiverAction values enum { SIGNAL_RANGING_INTERRUPT=1, STORE_TO_EEPROM=0, SEND_DATA_TO_UART=0x7e, BCAST_DATA=0xFFFF }; enum { MAX_RSSI_MSGS=150, NUM_RSSI_PER_MSG=10 }; enum { RETURNING_RSSI_DATA=0, COLLECTING_RSSI_DATA=1, CHIRPING=2, IDLE=3 }; enum { OVERVIEW=0, ALL_RSSI=1, SOME_RSSI=2 }; struct ChirpMsg{ uint16_t transmitterId; uint8_t msgNumber; uint16_t receiverAction; uint8_t empty[24]; } ; typedef struct ChirpMsg ChirpMsg; typedef struct DataMsg DataMsg; struct DataMsg{ uint16_t transmitterId; uint16_t receiverId; uint8_t msgNumber;//this is the msg id of the sent message uint8_t msgIndex; //this is the order in which this message was received uint16_t rssi[NUM_RSSI_PER_MSG]; }; typedef struct DataOverviewMsg DataOverviewMsg; struct DataOverviewMsg{ uint16_t transmitterId; uint16_t receiverId; uint16_t msgCnt; }; typedef struct ChirpCommandMsg ChirpCommandMsg; struct ChirpCommandMsg{ uint8_t startStop; uint16_t transmitterId; uint8_t numberOfChirps; uint32_t timerPeriod; uint16_t receiverAction; }; typedef struct DataRequestMsg DataRequestMsg; struct DataRequestMsg{ uint8_t startStop; uint8_t typeOfData; uint8_t msgIndex; uint32_t timerPeriod; uint16_t receiverAction; };