Ti exampleProgramFor the document found in, perform a simple translation
This is the basicrfcfg_t struct. If you want to use this API, you must use the struct.
Myaddr 16-bit short address, which is the address of the ZigBee module.
PanidThe ZigBee protocol uses a 16-bit regional network identifier (Pan ID) to identify a network. Different panids indicate different networks, which can be called network names.
Channel RF channel (must be between 11 and 26 );
If ackrequest is true, obtain the ACK signal from the ZigBee module of the target address.
The last two are used for security. Because I do not need security information, I have no details.
Function:
Void basicrfinit (basicrfcfg_t * prfconfig); initializes the struct.
Uint8 basicrfsendpacket (uint16 destaddr, uint8 * ppayload, uint8 length)
Send packet to the given destination short address. returns true if packet was sent
Successfully, and failed otherwise. If ackrequest is true the return value of this function
Will only be true if an acknowledgment is already ed from the destination.
Send the package to the specified address-destaddr. If true is returned, the packet is successfully sent. If false, the opposite is returned.
Uint8 basicrfpacketisready (void)
Returns true if a received ed packet is ready to be retrieved by higher layer.
If the upper layer is ready to receive the sent package, the returned result is true.
Int8 basicrfgetarg (void)
Returns the receipt value of the last modified ed Packet
Returns the final packet's HTTP/HTTPS value. This function is generally used to obtain the network condition to determine whether the transmit power should be increased or decreased.
Uint8 basicrfreceive (uint8 * prxdata, uint8 Len, int16 * prssi)
Retrieve packet from basic RF layer. The caller is responsible for allocating buffer space
Data and the ARG value.
// Neither do I understand
Void basicrfreceiveon (void)
Turn on receiveron radio. After calling this function the radio is kept on
Basicrfreceiveoff is called.
Open the RF module, as long as this function is called, if you do not call the following function, the RF module will remain on
Void basicrfreceiveoff (void)
Turn Off receiver er on radio, and keep it off unless for transmitting a packet with Clear Channel
Assessment.
Disable the RF module.
,,,,,