RIOT/projects/WEAtHeR_stable/weather_protocol.h
Oliver Hahm c1a1ea405a [projects WEAtHeR_stable]
* initial commit for WEAtHeR project in stable branch
2011-04-14 13:52:46 +02:00

44 lines
881 B
C

#ifndef WEATHER_PROTOCOL_H_
#define WEATHER_PROTOCOL_H_
#include <stdint.h>
#include <radio/radio.h>
#define WEATHER_PROTOCOL_NR 6
#define MAX_HOP_LIST (11)
typedef enum {
WEATHER_HELLO,
WEATHER_CHAT,
WEATHER_DATA
} packet_types;
typedef struct {
uint16_t seq_nr;
uint8_t src;
uint8_t type;
} weather_packet_header_t;
typedef struct __attribute__ ((packed)) {
weather_packet_header_t header;
} weather_hello_pkt_t;
typedef struct {
weather_packet_header_t header;
uint8_t len;
char mesg[40];
} weather_chat_pkt_t;
typedef struct __attribute__ ((packed)) {
weather_packet_header_t header;
time_t timestamp;
double temperature;
double relhum;
double relhum_temp;
double energy;
uint8_t hop_counter;
uint8_t hops[MAX_HOP_LIST];
} weather_data_pkt_t;
#endif