#ifndef __MAC_H__
#define __MAC_H__

#include <802_15_4.h>

#define MAC_TYPE_NEIGHBOR_ADVERTISEMENT 0x00
#define MAC_TYPE_NETWORK                0x01
#define MAC_TYPE_ROUTING                0x02

#ifdef __cplusplus
extern "C" {
#endif __cplusplus

  void mac_init();
  void mac_process_int(int intstat);

  int mac_can_send();
  void mac_send(saddr_t dst, unsigned char type, int ack_request,
		const unsigned char * payload, unsigned char payload_len);

  int mac_frame_available();
  void mac_recv(mac_frame * frame, unsigned char * rssi, unsigned char * lqi);

#ifdef __cplusplus
}
#endif __cplusplus

#endif /* __MAC_H__ */
