I'm using a pair of MRF24J40 radio chips to get one PIC32 microcontroller board to communicate with another via RF transmission. I've got all my code to compile fine but I keep getting an error associated with this code.
typedef struct
{
union
{
BYTE Val;
struct
{
BYTE packetType :2; // type of packet. Possible types are
// * PACKET_TYPE_DATA - Data type
// * PACKET_TYPE_COMMAND - Command type
// * PACKET_TYPE_ACK - Acknowledgement type
// * PACKET_TYPE_RESERVE - Reserved type
BYTE broadcast :1; // 1: broadcast, 0: unicast
BYTE secEn :1; // 1: secure the MAC payload, 0: send plain text
BYTE repeat :1; // 1: allow repeaters to forward the message, 0: send message directly
BYTE ackReq :1; // 1: acknowledgement required, 0: no acknowldgement
BYTE destPrsnt :1; // 1: destination address in the packet, 0: destination address not in the packet
BYTE sourcePrsnt :1; // 1: source address in the packet, 0: source address not in the packet
} bits;
} flags;
BYTE * SourceAddress; // Address of the Sender
BYTE * Payload; // Pointer to the payload
BYTE PayloadLen; // Payload size
BYTE RSSIValue; // RSSI value for the received packet
BYTE LQIValue; // LQI value for the received packet
#if defined(IEEE_802_15_4)
BOOL altSourceAddress; // Source address is the alternative network address
WORD_VAL SourcePANID; // PAN ID of the sender
#endif
} MAC_RECEIVED_PACKET;
Basically I've tried everything on earth to be able to change the values of the variables packetType
, secEn
, ackReq
etc. I've tried changing the value directly after their declarations but that seems to be the bit length, not the value. The code (straight from microchip's website) has comments that say 1 = this and 0 = that but I haven't found anywhere where I can change those values. Any help from anyone familiar with these MRF24J40 chips would be greatly appreciated. Thank you.