📄 plmesap.nc
字号:
/** * this interface are physical layer management entity-service access point * */ #include "ZBTYPES.h"interface PlmeSap{/** * if detect success(cc2420 must be in rxOn status),return SUCCESS;otherwise FAIL * when return SUCCESS, status can be PHY_BUSY,PHY_IDLE,PHY_TRX_OFF,PHY_BUSY_TX */ /* because csma implement in physical layer module, current not support cca detect command error_t phyCCADetect(phy_enum_t* status); *//** * scan for a certain period and calculte the average RSSI register's low 8 bit value * energyLevel range from 0-255 * not yet implement */ /* command error_t phyEnergyDetect();event void phyEnergyDetectDone(error_t error, uint8_t energyLevel); *//** * phyPib get and set function */ /** * return value range from 0-26 */command uint8_t getCurrentChannel();/** * currentChannel must range from 0-26 and be supported by physical layer. */ /** * need to use sync command to write into cc2420 */ command void setCurrentChannel(uint8_t currentChannel);/** * direct write into cc2420 */ command error_t directSetCurrentChannel(uint8_t currentChannel);event void directSetCurrentChannelDone(error_t error);/** * beacause there are 27 channels * low16bit 0-15 bit indicate 0-15 channel * high16bit 0-10 bit bitindicate 16-26 channel */ command uint32_t* getSupportChannels();/** * get and set txPower * getTxPower return value and txPower define as below: * 0-5bit indicate txPower of -32dBm-0dBm * 6-7bit indicate tolerance, 00=1DB;01=3DB;10=6DB (currently reserved) */ command uint8_t getTxPower();/** * need to use sync command to write into cc2420 */ command void setTxPower(uint8_t txPower);/** * direct write into cc2420 */ command error_t directSetTxPower(uint8_t txPower);event void directSetTxPowerDone(error_t error);/** * get and set CCAMode * getCCAMode return value and ccaMode define as below: * 1 indicate energy above threshold * 2 indicate have detected IEEE802.15.4 characters * 3 indicate energy above threshold AND have detected IEEE802.15.4 characters */ command uint8_t getCCAMode();/** * need to use sync command to write into cc2420 */ command void setCCAMode(uint8_t ccaMode);/** * direct write into cc2420 */ command error_t directSetCCAMode(uint8_t ccaMode);event void directSetCCAModeDone(error_t error);command saddr_t* getShortAddr();/** * need to use sync command to write into cc2420 */ command void setShortAddr(saddr_t address);/** * direct write into cc2420 */ command error_t directSetShortAddr(saddr_t address);event void directSetShortAddrDone(error_t error);command panid_t* getPanId();/** * need to use sync command to write into cc2420 */ command void setPanId(panid_t panId);/** * direct write into cc2420 */ command error_t directSetPanId(panid_t panId);event void directSetPanIdDone(error_t error);command error_t sync();event void syncDone(error_t error);command laddr_t* getLongAddr();/** * rf control */command error_t rxControl(bool isRxOn);event void rxControlDone(error_t error); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -