1 /*
2 * Copyright (c) 2005 The Regents of the University of California. All
3 * rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * - Neither the name of the University nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
19 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 *
29 * Authors: Mohammad Rahimi mhr@cens.ucla.edu
30 * Shaun Ahmadian
31 * Alan Jern
32 * David Zats
33 * History: created 07/25/05
34 *
35 * These structures define the query and response format. They also
36 * set the TOSH_DATA LENGTH and provide the enumeration for the interface
37 * used to receive packets over the radio.
38 */
39
40 //Enumeration for parameterized interface for receiving packets over
41 //the radio
42 enum {
43 AM_MSG=6
44 };
45
46 //Size of header for queries
47 #ifndef QUERY_HEADER
48 #define QUERY_HEADER 10
49 #endif
50
51 //Query data size should be equal to the size of
52 //the data portion of the largest query
53 #ifndef QUERY_DATA
54 #define QUERY_DATA 14
55 #endif
56
57 //Calculation of total packet size based upon header and total size
58 #ifndef QUERY_PACKET_SIZE
59 #define QUERY_PACKET_SIZE (QUERY_HEADER + QUERY_DATA)
60 #endif
61
62 //Header for response messages
63 #ifndef RESPONSE_HEADER
64 #define RESPONSE_HEADER 2
65 #endif
66
67 //Payload for large packets. Should be set to 128 once I2C is fixed
68 #ifndef RESPONSE_DATA
69 #define RESPONSE_DATA 64
70 #endif
71
72 //Total length for large packets = Header + Payload
73 #ifndef TOSH_DATA_LENGTH
74 #define TOSH_DATA_LENGTH (RESPONSE_HEADER + RESPONSE_DATA)
75 #endif
76
77 //Definition of Query_Msg. This is the structure of the message
78 //sent from the stargate to the mote.
79 typedef struct Query_Msg {
80 uint16_t local_addr; //address of stargate
81 uint8_t queryID; //unique id of query
82 uint8_t start; //boolean whether to start or cancel the query
83 uint8_t nSignal; //specification of the neuronSignal to use (snap, activeEye, ...)
84 uint16_t numTimes; //the total number of times that the query is to be resolved
85 uint16_t samplePer; //The time between samples (in seconds)
86 uint8_t dataLength; //The length of the data in the message
87 uint8_t data[0]; //Pointer to the data in the message
88 } __attribute__((packed)) Query_Msg;
89
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.