/**
	@file		msg.h
	@brief 		File containing the headers of the messaging functions passed between the nodes
	@author		Adrían Antoñana Gómez
	@author		Carlos Díaz Cánovas
	@version	rc-2008/12/07

*/
#ifndef _MSG_H
#define _MSG_H

#include <ScatterWeb.System.h>
#include <ScatterWeb.CC1020.h>
#include <string.h>
#include "constants.h"
#include "types.h"
#include "ScatterWeb.System.h"

#define MSG_ROUTELEN	0
#define MSG_JUMP	1
#define MSG_PAYLOADLEN	2

void msg_make(uint8_t *data, uint8_t *route, uint8_t routeLen, uint8_t *payload, uint8_t payloadLen, uint8_t msgId);
uint8_t *msg_process(uint8_t *d, uint8_t thisNode);
uint8_t msg_len(uint8_t *d);
uint8_t *msg_get_message(uint8_t *d);

#endif
