You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
{<br />
switch (frame->data[0] & 0xF0) {<br />
case 0x80 :<br />
return CMD_REQUEST;<br />
case 0xC0 :<br />
return CMD_RESPONSE;<br />
case 0xA0 :<br />
return DATA_REQUEST;<br />
case 0xE0 :<br />
return DATA_ACK;<br />
default :<br />
return -1;<br />
}<br />
}<br />
unsigned short zb_getFrameSrcSmac(zb_Frame * frame)<br />
{<br />
unsigned short smac;<br />
smac = ((unsigned short)frame->data[2] data[3];<br />
return smac;<br />
}<br />
int zb_getFrameData(zb_Frame * frame, void * dest, size_t *<br />
dataLength)<br />
{<br />
size_t srcLength = frame->data[4];<br />
*dataLength = srcLength;<br />
memcpy(dest, &frame->data[5], srcLength);<br />
return true;<br />
}<br />
26