;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;---------------------------------------- #DEFINES ---------------------------------------;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Protocol Rev E constants
; note: use of MSB and LSB implies Byte, not Bit in this.
; Rev B, Kent Anderson, May 15 2008

;;;;;;;;;;;;;;;;; Framing ;;;;;;;;;;;;;;;;;;;;;;;;;;
#define	START_BYTE		0x7E
#define	LENGTH_MSB		0x00
#define	LENGTH_LSB		0x08

;;;;;;;;;;;;;;;;; API identifier ;;;;;;;;;;;;;;;;;;;
#define	API_RX		0x81
#define	API_TX		0x01

	; Frame ID:  change this to non-zero if you wish 
	; your xBee to respond with a Tx Status message
#define	FRAME_ID_NO_ACK		0x00

	; Options - no acknowldge
#define	OPTIONS_NO_ACK		0x01	

;;;;;;;;;;;;;;;;; Addresses ;;;;;;;;;;;;;;;;;;;;;;;;
#define	ADMIRAL_ADDRESS_MSB	0xBC
#define	ADMIRAL_ADDRESS_LSB	0xFF

#define	HELM_MSB		0xBC
;#define	CRAFT_MSB		0xAF
;#define	CRAFT_LSB		0x07	;take this out later...it will be determined by iButton
#define	BROADCAST_MSB		0xFF      
#define	BROADCAST_LSB		0xFF

#define	TEAM_1		0x01
#define	TEAM_2		0x02
#define	TEAM_3		0x03
#define	TEAM_4		0x04
#define	TEAM_5		0x05
#define	TEAM_6		0x06
#define	TEAM_7		0x07
#define	TEAM_8		0x08
#define	TEAM_9		0x09
#define	TEAM_10		0x0A
#define	TEAM_11		0x0B			
#define	TEAM_12		0x0C

;;;;;;;;;;;;;;;;; for ME218C Data Byte 0 Header ;;;;
#define	IBUTTON		0x01
#define	NAVIGATION		0x02
#define	ADMIRAL		0x04
#define	WATERCRAFT		0x08
#define	PING_RESPONSE		0x10
#define	ACK		0x80

;;;;;;;;;;;;;;;;; Admiral Messages ;;;;;;;;;;;;;;;;;
#define	STAND_DOWN		0x01
#define	START_GAME		0x02
#define	END_GAME		0x04
#define	BLUE_GOAL		0x08
#define	RED_GOAL		0x10
#define	SOFT_RESET		0x20
#define	HARD_RESET		0x40
#define	ADMIRAL_PING		0x80

;;;;;;;;;;;;;;;;; Commands from Helm to Watercraft ;
#define	NO_ACTION_1		0x88
#define	NO_ACTION_2		0x00

;;;;;;;;;;;;;;;;; Commands from Watercraft to Helm ;
#define	STAND_DOWN_RECEIVED_1	0x00
#define	STAND_DOWN_RECEIVED_2	0x02

#define	MATCHED_1		0x00
#define	MATCHED_2		0x01

;;;;;;;;;;;;;;;;; Ping Responses ;;;;;;;;;;;;;;;;;;;
#define	WAITING_IBUTTON		0x01
#define	WAITING_PAIR		0x02
#define	PAIRED		0x04