You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
678 B
C++
34 lines
678 B
C++
//
|
|
// ZigBeeͨÐÅ
|
|
//
|
|
|
|
#include "ZigBeeOperator.h"
|
|
|
|
void ZigBeeOperatorClass::Initialization()
|
|
{
|
|
ExtSRAMInterface.Initialization();
|
|
}
|
|
|
|
void ZigBeeOperatorClass::SendCommand(uint8_t* cmd, uint16_t siz)
|
|
{
|
|
ExtSRAMInterface.ExMem_Write_Bytes(zigbee_address, cmd, siz);
|
|
}
|
|
|
|
bool ZigBeeOperatorClass::ReciveCommand(uint8_t recv[], uint16_t siz, uint16_t timeout)
|
|
{
|
|
uint16_t passed_time = 0;
|
|
while (ExtSRAMInterface.ExMem_Read(zigbee_read_address) == 0x00)
|
|
{
|
|
delay(1);
|
|
passed_time++;
|
|
if ((timeout != 0) && (passed_time >= timeout))
|
|
return false;
|
|
}
|
|
ExtSRAMInterface.ExMem_Read_Bytes(zigbee_read_address, recv, siz);
|
|
return true;
|
|
}
|
|
|
|
|
|
ZigBeeOperatorClass ZigBeeOperator;
|
|
|