Hello people,
i need to create a simple wireless protocol that just sends data, gets ACK, and receives data. Simple, rite? Anyway im using CC2430 which is 802.15.4 compliant and as far as i know i have a RF regisiter called RFD which writes to a 128 Byte TX or RX FIFO for transmission/receiving. I believe according to the specs i have to send the MPDU (MAC Protocol Data Unit) and its length into this FIFO which gets transmitted, the PHY uses CSMA/CA, and the 802.15.4 MAC layer frame looks like:
MAC:
So i have a data struct like:
As a struct lies in a contiguous space in MCU memory, am i rite as to just have a pointer to the beginnig of the struct like to '&flags' ? So then i would have a uint8 pointer that just traverses thru the MPDU with length of the MPDU ??
So like to send it i would have:
Is it this simple? With anyone with wireless programming experience please comment about the above?
i need to create a simple wireless protocol that just sends data, gets ACK, and receives data. Simple, rite? Anyway im using CC2430 which is 802.15.4 compliant and as far as i know i have a RF regisiter called RFD which writes to a 128 Byte TX or RX FIFO for transmission/receiving. I believe according to the specs i have to send the MPDU (MAC Protocol Data Unit) and its length into this FIFO which gets transmitted, the PHY uses CSMA/CA, and the 802.15.4 MAC layer frame looks like:
MAC:
Rich (BB code):
Byte- 2 1 0-20 n 1
Frame_Cntrl_F SeqNo AddrInfo FramePayload FCS
| MAC Header | MAC Payload | MAC Ftr|
So i have a data struct like:
Rich (BB code):
typedef struct
{
unsigned char flags;
unsigned char seqNo;
unsigned char destH;
unsigned char destL;
unsigned char *pDataBuffer;
unsigned char status;
}SPP_TXPACKET;
So like to send it i would have:
Rich (BB code):
void writeTxFifo(uint8 *pData, uint8 len)
{
if(len == 0); /* pointless to write zero bytes */
return;
do
{
RFD = *pData;
pData++;
len--;
}
while (len);
in .c file:
writeTxFifo(&(SPP_TXPACKET.flags), 7) //this doesn't look rite, but you get the idea......