📄 xnp.nc
字号:
// $Id: Xnp.nc,v 1.3 2003/10/07 21:46:27 idgay Exp $/***************************************************************************MODULE NetProgXFILE Xnp.ncPURPOSE In Network Programming/Boot Component InterfacePLATFORM MICA2 TOS NesCREVISION 02mar03 mm created==============================================================================DESCRIPTIONProvides In-Network Programming services to client/application.There are 2 main phases:1. Program/code download from network/host via radio.2. Local reprogram of UP and reboot.These operations are independent and coordinated with Mote Application (client)to avoid resource conflicts.RESOURCESNP uses -EEPROM (External Flash memory).-GENERIC_COMM / Active Message Handler#47NOTES-EEPROM resource is shared by NP and Client. TClient must release EEPROM resource before acknowledging NP_DOWNLOAD_REQ.Client must filter/check for propoer (owned) hInstance on all EEPROM signals/event inorder todiscriminate against NP messages. This is a shared wiring.-Only 1 Program image in EEPROM is currently support.-Client must INIT and TUNE radio. I.e. establish wireless link.INTERFACES-Download PhaseNP_DOWNLOAD_REQSignal to Client that an in-network program download operation has beenreceived (over-air using AM#??).Passes to client planned EEPROM start pageand number of pages to be used to store download programNP_DOWNLOAD_ACKAcknowledge from Client that NP download operation can/cannot proceed withdownload.NP_DOWNLOAD_DONESignal to Client that in-network program download operation has completed.Supplies actual EEROM Start Page, NofPages used to store downloaded programClient is now responsible for maintaining integrity of code image downloadedinto EEPROM (i.e. must not overwrite/modify the section of EEPROM)-Reprogram PhaseNP_REPROG_MSGSignal to client that a in-network reprogram/reboot message has been receivedNP_REPROG_REQCommand from client to initiate a reprogram/reboot operation.Client passes ProgramID which is matched with ID found in EEPROM. If matchUP reprogramming/reboot operation is started. Client should release all resources/ before issuing request.===============================================================================******************************************************************************/interface Xnp{ command result_t NPX_DOWNLOAD_ACK(uint8_t cAck ); command result_t NPX_SENDSTATUS(uint16_t wAck ); command result_t NPX_ISP_REQ(uint16_t wProgID, uint16_t wEEPageStart, uint16_t nwProgID); command result_t NPX_SET_IDS(); event result_t NPX_DOWNLOAD_REQ(uint16_t wProgramID, uint16_t wEEStartP, uint16_t wEENofP); event result_t NPX_DOWNLOAD_DONE(uint16_t wProgramID, uint8_t bRet, uint16_t wEENofP);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -