Network configuration and use. More...
Modules | |
Network configuration. | |
Values from ZASA example application, file sample_app.c, with modifications considering swra175a.pdf 6.3.1.2. | |
Network default parameters. | |
Values from ZASA example application, file sample_app.c, with modifications considering swra175a.pdf 6.3.9.2. | |
Files | |
file | nwk.c |
Network functions implementation. | |
file | nwk.h |
Network functions interface. | |
Classes | |
struct | nwk_neighbor |
Neighbor data. More... | |
Macros | |
#define | NWK_CFG_PANID "\xFF\xFF" |
swra175a.pdf - 6.2.4.1 ZCD_NV_PANID | |
#define | NWK_CFG_CHANLIST "\x00\x00\x01\x00" |
swra175a.pdf - 6.2.4.2 ZCD_NV_CHANLIST | |
#define | NWK_CFG_PRECFGKEY "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F" |
swra175a.pdf - 6.2.4.3 ZCD_NV_PRECFGKEY | |
#define | NWK_CFG_PRECFGKEYS_ENABLE "\x01" |
swra175a.pdf - 6.2.4.4 ZCD_NV_PRECFGKEYS_ENABLE | |
#define | NWK_CFG_SECURITY_MODE "\x00" |
swra175a.pdf - 6.2.4.5 ZCD_NV_SECURITY_MODE | |
#define | NWK_CFG_BCAST_RETRIES "\x02" |
swra175a.pdf - 6.2.4.6 ZCD_NV_BCAST_RETRIES | |
#define | NWK_CFG_PASSIVE_ACK_TIMEOUT "\x05" |
swra175a.pdf - 6.2.4.7 ZCD_NV_PASSIVE_ACK_TIMEOUT | |
#define | NWK_CFG_BCAST_DELIVERY_TIME "\x1E" |
swra175a.pdf - 6.2.4.8 ZCD_NV_BCAST_DELIVERY_TIME | |
#define | NWK_CFG_ROUTE_EXPIRY_TIME "\x3C" |
swra175a.pdf - 6.2.4.9 ZCD_NV_ROUTE_EXPIRY_TIME | |
#define | NWK_DEVTYPE_DEFALUT NWK_DEVTYPE_ROUTER |
The default device type on network initialization. | |
#define | NWK_NEIGHBORMAX 3 |
Max number of expected direct neighbors. | |
Typedefs | |
typedef enum nwk_devType | nwk_devType |
Device types. | |
typedef struct nwk_neighbor | nwk_neighbor |
Neighbor data. More... | |
Enumerations | |
enum | nwk_devType { NWK_DEVTYPE_COORDINATOR, NWK_DEVTYPE_ROUTER, NWK_DEVTYPE_ENDDEVICE, NWK_DEVTYPE_NONE } |
Device types. More... | |
Functions | |
void | nwk_init () |
Network initialization. More... | |
UInt16 | nwk_process () |
Network process. More... | |
void | nwk_suspend () |
network suspend More... | |
UInt8 | nwk_wakeUp () |
Network wake up. More... | |
void | nwk_setDeviceType (nwk_devType newType) |
Set device type. More... | |
nwk_devType | nwk_getDeviceType () |
This function gets the device type. More... | |
void | nwk_resetResume () |
Resume from CC2480 reset. More... | |
UInt8 | nwk_configureWrite () |
Write configuration. More... | |
void | nwk_configureWriteRsp (UInt8 status) |
Response to a configuration write. More... | |
UInt8 | nwk_register () |
Register application request. More... | |
void | nwk_registerRsp (UInt8 status) |
Register application response. More... | |
UInt8 | nwk_start () |
Start network request. More... | |
void | nwk_startRsp () |
Start network response. More... | |
void | nwk_startConfirm (UInt8 status) |
Start network confirmation. More... | |
UInt8 | nwk_allow_bind (UInt8 timeout) |
Allow bind request. More... | |
void | nwk_allow_bindRsp () |
Allow bind response. More... | |
void | nwk_allow_bindConfirm (char *pBuf) |
Allow bind confirmation. More... | |
UInt8 | nwk_bind_device (UInt8 create, UInt16 commandId, uint64_t destination) |
Bind device request. More... | |
void | nwk_bind_deviceRsp () |
Bind device response. More... | |
void | nwk_bind_deviceConfirm (char *pBuf) |
Bind device confirmation. More... | |
UInt8 | nwk_getDeviceInfo () |
Get device information request. More... | |
void | nwk_getDeviceInfoRsp (UInt8 param, void *pValue) |
Get device information response. More... | |
UInt8 | nwk_isClient () |
Is client. More... | |
UInt8 | nwk_isSink () |
Is sink. More... | |
UInt8 | nwk_isBound () |
Is bound. More... | |
void | nwk_setSink (UInt8 sink) |
Set sink. More... | |
UInt16 | nwk_getShortAddress () |
Get shotr address. More... | |
uint64_t | nwk_getIeeeAddress () |
Get IEEE address. More... | |
uint64_t * | nwk_getPIeeeAddress () |
Get pointer to the IEEE address. More... | |
UInt8 | nwk_setPermitJoin (UInt8 timeout) |
Permit join request. More... | |
void | nwk_setPermitJoinRsp () |
Permit join response. More... | |
UInt8 | nwk_allowJoin () |
Allow join. More... | |
UInt8 | nwk_disallowJoin () |
Disallow join. More... | |
UInt8 | nwk_startFrame (UInt16 destination, UInt16 cmdId, UInt8 radius, UInt8 len) |
Start Frame. More... | |
UInt8 | nwk_snd (UInt8 size, void *pBuf) |
Send data. More... | |
void | nwk_endFrame (UInt8 forwardToSerial) |
End frame. More... | |
UInt8 | nwk_sndUInt8 (UInt8 v) |
Send unsigned 8 bits integer. More... | |
UInt8 | nwk_sndUInt16 (UInt16 v) |
Send unsigned 16 bits integer. More... | |
UInt8 | nwk_sndUInt32 (UInt32 *p) |
Send unsigned 32 bits integer. More... | |
UInt8 | nwk_sndUInt48 (uint64_t *p) |
Send unsigned 48 bits integer. More... | |
UInt8 | nwk_sndUInt64 (uint64_t *p) |
Send unsigned 64 bits integer. More... | |
UInt8 | nwk_sndInt64 (int64_t *p) |
Send signed 64 bits integer. More... | |
void | nwk_send_dataConfirm (UInt8 dataHandle, UInt8 status) |
Send data confirmation. More... | |
void | nwk_rcv (char *pBuf) |
Network receive. More... | |
UInt8 | nwk_getNeighborPort (UInt16 a) |
Get neighbor port. More... | |
UInt8 | nwk_getNeighborForeignPort (UInt8 i) |
Get neighbor foreign port. More... | |
UInt16 | nwk_getNeighborAddress (UInt8 i) |
Get neighbor address. More... | |
UInt8 | nwk_registerNeighbor (UInt16 a) |
Register neighbor. More... | |
Variables | |
nwk_neighbor | nwk_neighbors [NWK_NEIGHBORMAX] |
Neighbors information. | |
Network configuration and use.
typedef struct nwk_neighbor nwk_neighbor |
Neighbor data.
Known neighbors data.
enum nwk_devType |
UInt8 nwk_allow_bind | ( | UInt8 | timeout | ) |
Allow bind request.
Set allow bind on the device for timeout seconds. if timeout is 0xFF, the bind is allowed indefinitely.
Documentation says "range from 1 through 65. If 0, the Allow Bind mode will be set false without timeout. If greater than 64, the Allow Bind mode will be true indefinitely.", but the device doesn't work this way. http://e2e.ti.com/support/wireless_connectivity/f/158/p/17331/67151#67151 and http://e2e.ti.com/support/wireless_connectivity/f/158/p/17331/67152#67152 .
[in] | timeout | amount of seconds to allow binding |
Definition at line 890 of file nwk.c.
References ccai_s_zb_allow_bind().
Referenced by nwk_process(), and nwk_setSink().
void nwk_allow_bindConfirm | ( | char * | pBuf | ) |
Allow bind confirmation.
This function takes action on a bind confirmation, that arrive when another device binds to this one.
[in] | pBuf | The complete message from cc2480 |
Definition at line 913 of file nwk.c.
References uart_forwardCmd().
Referenced by ccai_p_zb_allow_bind_confirm().
void nwk_allow_bindRsp | ( | ) |
Allow bind response.
Takes action on response of an allow bind request. The cc2480 is sending command 6600 instead of 6602 that would trigger this code, so it will not run.
Definition at line 901 of file nwk.c.
Referenced by ccai_r_zb_allow_bind().
UInt8 nwk_allowJoin | ( | ) |
Allow join.
This function permits new devices joining the network indefinitely.
Definition at line 1134 of file nwk.c.
References nwk_setPermitJoin().
UInt8 nwk_bind_device | ( | UInt8 | create, |
UInt16 | commandId, | ||
uint64_t | destination | ||
) |
Bind device request.
Bind The device to another one
[in] | create | 1 to create a binding, 0 to remove. |
[in] | commandId | Identifier of the bind. |
[in] | destination | 64-bit IEEE address of the device to bind to, set to 0 if unknown and destination device is set to allow bind mode. |
Definition at line 932 of file nwk.c.
References ccai_s_zb_bind_device().
Referenced by nwk_process().
void nwk_bind_deviceConfirm | ( | char * | pBuf | ) |
Bind device confirmation.
Takes action on a bind confirmation
Definition at line 950 of file nwk.c.
References CCAI_STA_ZSUCCESS, NWK_CMDIDRPT, and uart_forwardCmd().
Referenced by ccai_p_zb_bind_confirm().
void nwk_bind_deviceRsp | ( | ) |
Bind device response.
Response to a request to create or delete a binding.
Definition at line 941 of file nwk.c.
Referenced by ccai_r_zb_bind_device().
UInt8 nwk_configureWrite | ( | ) |
Write configuration.
This function configures the network. Only one configuration is written each time. When the result is received this function is called again to write next configuration.
Definition at line 572 of file nwk.c.
References CCAI_CFGD_BIT_STARTOPT_AUTO_START, CCAI_CFGD_BIT_STARTOPT_CLEAR_CONFIG, CCAI_CFGD_BIT_STARTOPT_CLEAR_STATE, CCAI_CFGD_LOGICAL_TYPE_COORDINATOR, CCAI_CFGD_LOGICAL_TYPE_ENDDEVICE, CCAI_CFGD_LOGICAL_TYPE_ROUTER, CCAI_CFGD_ZCD_NV_LOGICAL_TYPE, CCAI_CFGD_ZCD_NV_STARTUP_OPTION, CCAI_CFGN_ZCD_NV_BCAST_DELIVERY_TIME, CCAI_CFGN_ZCD_NV_BCAST_RETRIES, CCAI_CFGN_ZCD_NV_CHANLIST, CCAI_CFGN_ZCD_NV_PANID, CCAI_CFGN_ZCD_NV_PASSIVE_ACK_TIMEOUT, CCAI_CFGN_ZCD_NV_PRECFGKEY, CCAI_CFGN_ZCD_NV_PRECFGKEYS_ENABLE, CCAI_CFGN_ZCD_NV_ROUTE_EXPIRY_TIME, CCAI_CFGN_ZCD_NV_SECURITY_MODE, ccai_s_zb_write_configuration(), NWK_CFG_BCAST_DELIVERY_TIME, NWK_CFG_BCAST_RETRIES, NWK_CFG_CHANLIST, NWK_CFG_PANID, NWK_CFG_PASSIVE_ACK_TIMEOUT, NWK_CFG_PRECFGKEY, NWK_CFG_PRECFGKEYS_ENABLE, NWK_CFG_ROUTE_EXPIRY_TIME, NWK_CFG_SECURITY_MODE, nwk_currentDevType, nwk_currentState, NWK_DEVTYPE_COORDINATOR, NWK_DEVTYPE_ENDDEVICE, NWK_DEVTYPE_ROUTER, nwk_lastParam, and nwk_lastParamSuccess.
Referenced by nwk_process().
void nwk_configureWriteRsp | ( | UInt8 | status | ) |
Response to a configuration write.
This function takes action on response from a written configuration. If last configuration was written, set nwk_currentState to the next state.
[in] | status | Result of the request to write the configuration |
Definition at line 749 of file nwk.c.
References ccai_resetLight(), CCAI_STA_ZSUCCESS, nwk_currentState, nwk_lastParam, and nwk_lastParamSuccess.
Referenced by ccai_r_zb_write_configuration().
UInt8 nwk_disallowJoin | ( | ) |
Disallow join.
This function disallow new devices joining the network.
Definition at line 1145 of file nwk.c.
References nwk_setPermitJoin().
void nwk_endFrame | ( | UInt8 | forwardToSerial | ) |
End frame.
This function sends the written frame to the specified address over the network.
[in] | forwardToSerial | 1 to forward the message to the serial port 0 to do not. |
Definition at line 1300 of file nwk.c.
References ccai_s_zb_send_data_request_end(), and nwk_dataHandle.
Referenced by nwk_sendHeartBeat(), ptp_endFrame(), and rep_endFrame().
UInt8 nwk_getDeviceInfo | ( | ) |
Get device information request.
This function reads information from the device and network. Only one information is read each time. After receiving the information, this function is called again until all of the information has been requested.
Definition at line 975 of file nwk.c.
References CCAI_INFO_IEEEADDRESS, CCAI_INFO_PARENTIEEEADDRESS, CCAI_INFO_PARENTSHORTADDRESS, CCAI_INFO_SHORTADDRESS, CCAI_INFO_STATE, CCAI_INFO_ZBCHANNEL, CCAI_INFO_ZBEXTENDEDPANID, CCAI_INFO_ZBPANID, ccai_s_zb_get_device_info(), nwk_lastParam, and nwk_lastParamSuccess.
Referenced by nwk_process().
void nwk_getDeviceInfoRsp | ( | UInt8 | param, |
void * | pValue | ||
) |
Get device information response.
This function acts on a response from ZB_GET_DEVICE_INFO.
[in] | param | - the parameter that was read from CC2480. |
[in] | pValue | - pointer to the value of the parameter. |
Definition at line 1038 of file nwk.c.
References CCAI_INFO_IEEEADDRESS, CCAI_INFO_PARENTIEEEADDRESS, CCAI_INFO_PARENTSHORTADDRESS, CCAI_INFO_SHORTADDRESS, CCAI_INFO_STATE, CCAI_INFO_ZBCHANNEL, CCAI_INFO_ZBEXTENDEDPANID, CCAI_INFO_ZBPANID, led_redConfigure(), nwk_address, nwk_currentDevType, nwk_currentState, NWK_DEVTYPE_COORDINATOR, NWK_DEVTYPE_ENDDEVICE, NWK_DEVTYPE_ROUTER, nwk_ieeeAddress, nwk_lastParam, nwk_lastParamSuccess, and ptp_initEnd().
Referenced by ccai_r_zb_get_device_info().
nwk_devType nwk_getDeviceType | ( | ) |
This function gets the device type.
If network state is not NWK_S_RUNNING, the returned value will be NWK_DEVTYPE_NONE, else it will be the device type sent to the CC2480.
Definition at line 535 of file nwk.c.
References nwk_currentDevType, nwk_currentState, and NWK_DEVTYPE_NONE.
Referenced by ptp_portsSetListening().
uint64_t nwk_getIeeeAddress | ( | ) |
Get IEEE address.
This function returns the device IEEE address on the ZigBee network.
Definition at line 1230 of file nwk.c.
References nwk_ieeeAddress.
UInt16 nwk_getNeighborAddress | ( | UInt8 | portNumber | ) |
Get neighbor address.
This function gets short address of a neighbor.
[in] | portNumber | The number of the port associated to the neighbor |
Definition at line 1578 of file nwk.c.
References NWK_NEIGHBORMAX.
Referenced by ptp_bmc(), ptp_MsgPdelayReqSnd(), ptp_MsgPdelayRespSnd(), ptp_portUpdateDS(), and ptp_process().
UInt8 nwk_getNeighborForeignPort | ( | UInt8 | portNumber | ) |
Get neighbor foreign port.
This function gets the port that a neighbor associate to this device.
[in] | portNumber | The number of the port associated to the neighbor |
Definition at line 1562 of file nwk.c.
References NWK_NEIGHBORMAX.
Referenced by nwk_rcv(), ptp_MsgPdelayRespSnd(), and ptp_portUpdateDS().
UInt8 nwk_getNeighborPort | ( | UInt16 | a | ) |
Get neighbor port.
This function gets the port associated to a neighbor.
[in] | a | Short address of the neighbor to get the port |
Definition at line 1539 of file nwk.c.
References NWK_NEIGHBORMAX.
Referenced by nwk_rcv().
uint64_t* nwk_getPIeeeAddress | ( | ) |
Get pointer to the IEEE address.
This function returns a pointer to the device IEEE address on the ZigBee network. The value must not be overwritten, the address will not change.
Definition at line 1245 of file nwk.c.
References nwk_ieeeAddress.
Referenced by ptp_getClockIdentity(), and rep_proccess().
UInt16 nwk_getShortAddress | ( | ) |
Get shotr address.
This function returns the device short address on the ZigBee network.
Definition at line 1217 of file nwk.c.
References nwk_address.
void nwk_init | ( | ) |
Network initialization.
This function initializes the network variables.
Definition at line 277 of file nwk.c.
References nwk_address, nwk_currentDevType, nwk_currentState, nwk_dataHandle, NWK_DEVTYPE_DEFALUT, NWK_DEVTYPE_NONE, nwk_freezeDetect, nwk_ieeeAddress, nwk_lastParam, nwk_lastParamSuccess, NWK_NEIGHBORMAX, nwk_returnState, and nwk_runCounter.
Referenced by main(), and uart_proccessCmd().
UInt8 nwk_isBound | ( | ) |
Is bound.
This function checks if the device is bound to another device on the network
Definition at line 1182 of file nwk.c.
Referenced by rep_endFrame(), rep_proccess(), rep_snd(), rep_sndInt64(), rep_sndUInt16(), rep_sndUInt32(), rep_sndUInt48(), rep_sndUInt48sc(), rep_sndUInt64(), rep_sndUInt8(), and rep_startFrame().
UInt8 nwk_isClient | ( | ) |
Is client.
This function checks if the device is a client on the network and it is running.
Definition at line 1156 of file nwk.c.
References nwk_currentDevType, nwk_currentState, NWK_DEVTYPE_ENDDEVICE, and NWK_DEVTYPE_ROUTER.
UInt8 nwk_isSink | ( | ) |
Is sink.
This function checks if the device is configured as a sink on the network
Definition at line 1170 of file nwk.c.
Referenced by nwk_rcv(), rep_endFrame(), rep_proccess(), rep_snd(), rep_sndInt64(), rep_sndUInt16(), rep_sndUInt32(), rep_sndUInt48(), rep_sndUInt48sc(), rep_sndUInt64(), rep_sndUInt8(), and rep_startFrame().
UInt16 nwk_process | ( | ) |
Network process.
This function processes the tasks of the network.
Definition at line 311 of file nwk.c.
References ccai_resetFull(), led_redConfigure(), nwk_allow_bind(), nwk_bind_device(), NWK_CMDIDRPT, nwk_configureWrite(), nwk_currentDevType, nwk_currentState, NWK_DEVTYPE_COORDINATOR, NWK_DEVTYPE_ENDDEVICE, nwk_freezeDetect, nwk_getDeviceInfo(), nwk_ieeeAddress, NWK_NEIGHBORMAX, nwk_register(), nwk_runCounter, nwk_sendHeartBeat(), nwk_setDeviceType(), and nwk_start().
Referenced by main().
void nwk_rcv | ( | char * | pBuf | ) |
Network receive.
This function receives packets from the network and forward as appropriate
[in] | pBuf | Pointer to the received packet |
Definition at line 1430 of file nwk.c.
References nwk_address, NWK_CMDIDHEARTBEAT, NWK_CMDIDPTP, NWK_CMDIDRPT, nwk_freezeDetect, nwk_getNeighborForeignPort(), nwk_getNeighborPort(), nwk_ieeeAddress, nwk_isSink(), NWK_NEIGHBORHEARTBEATTIMEOUT, nwk_registerNeighbor(), ptp_rcvmessage(), and uart_forwardCmd().
Referenced by ccai_p_zb_receive_data_indication().
UInt8 nwk_register | ( | ) |
Register application request.
This function register the application on the network.
Definition at line 807 of file nwk.c.
References ccai_s_zb_app_register_request(), NWK_CFG_APPENDPOINT, NWK_CFG_APPPROFILEID, NWK_CFG_DEVICEID, NWK_CFG_DEVICEVERSION, NWK_CFG_INPUTCMDCOUNT, NWK_CFG_INPUTCMDLIST, NWK_CFG_OUTPUTCMDCOUNT, and NWK_CFG_OUTPUTCMDLIST.
Referenced by nwk_process().
UInt8 nwk_registerNeighbor | ( | UInt16 | a | ) |
Register neighbor.
This function associate a port to a neighbor.
[in] | a | Short address of the neighbor associate |
Definition at line 1595 of file nwk.c.
References NWK_NEIGHBORHEARTBEATTIMEOUT, and NWK_NEIGHBORMAX.
Referenced by nwk_rcv().
void nwk_registerRsp | ( | UInt8 | status | ) |
Register application response.
This function takes action on the response of a application register request.
[in] | status | The returning status from CC2480. |
Definition at line 823 of file nwk.c.
References CCAI_STA_ZSUCCESS, and nwk_currentState.
Referenced by ccai_r_zb_app_register_request().
void nwk_resetResume | ( | ) |
Resume from CC2480 reset.
This function sets state to NWK_S_SETDEVICETYPE.
Definition at line 549 of file nwk.c.
References led_redConfigure(), nwk_currentState, nwk_lastParam, and nwk_lastParamSuccess.
Referenced by ccai_p_sys_reset_ind().
void nwk_send_dataConfirm | ( | UInt8 | dataHandle, |
UInt8 | status | ||
) |
Send data confirmation.
This function acts on a send data confirmation
[in] | dataHandle | Data handle of the sent packet |
[in] | status | Status returned by cc2480 |
Definition at line 1407 of file nwk.c.
References CCAI_STA_ZAPSNOBOUNDDEVICE, and CCAI_STA_ZFAILURE.
Referenced by ccai_p_zb_send_data_confirm().
void nwk_setDeviceType | ( | nwk_devType | newType | ) |
Set device type.
This function sets a device type on the cc2480. The configuration may take up to the larger return value from mwk_proccess (ms).
[in] | newType | New device type to be set on the cc2480. |
Definition at line 517 of file nwk.c.
References led_redConfigure(), nwk_currentDevType, nwk_currentState, nwk_lastParam, and nwk_lastParamSuccess.
Referenced by but_proccess(), ccai_p_sys_reset_ind(), nwk_process(), and uart_proccessCmd().
UInt8 nwk_setPermitJoin | ( | UInt8 | timeout | ) |
Permit join request.
This function change permission to new devices join the network. The device address is passed as 0xFFFC, that means all routers and coordinator, this function may be changed by adding a parameter so that a single device can also be specified.
[in] | timeout | Time to extend the permission to join, if 0xFF, joining will be permitted indefinitely, if 0x00, joining will be prohibited. |
Definition at line 1107 of file nwk.c.
References ccai_s_zb_permit_joining_request(), and nwk_currentState.
Referenced by nwk_allowJoin(), and nwk_disallowJoin().
void nwk_setPermitJoinRsp | ( | ) |
Permit join response.
This function acts on a response from ZB_PERMIT_JOINING_REQUEST.
Definition at line 1121 of file nwk.c.
Referenced by ccai_r_zb_permit_joining_request().
void nwk_setSink | ( | UInt8 | sink | ) |
Set sink.
This function sets the sink state of the device on the network. On sink, device allows bind and forward received commands or reports to serial port. If a device bound to this one, it may not be enough to just make this device not a sink to stop the other device to send reports to this one.
[in] | sink | 1 to make device a sink, 0 to make device nota a sink |
Definition at line 1198 of file nwk.c.
References nwk_allow_bind().
Referenced by uart_proccessCmd().
UInt8 nwk_snd | ( | UInt8 | len, |
void * | pBuf | ||
) |
Send data.
This function write data to the buffer, the nwk_startFrame must be called prior to this function.
[in] | len | Amount of data, in bytes to write to the network buffer. |
[in] | pBuf | Pointer to source data buffer to copy to the network buffer. |
Definition at line 1285 of file nwk.c.
References ccai_s_zb_send_data_request_payload().
Referenced by nwk_sndInt64(), nwk_sndUInt16(), nwk_sndUInt32(), nwk_sndUInt48(), nwk_sndUInt64(), nwk_sndUInt8(), ptp_snd(), and rep_snd().
UInt8 nwk_sndInt64 | ( | int64_t * | p | ) |
Send signed 64 bits integer.
This function write a 64-bit value to the network buffer.
[in] | p | Pointer to the value to send. |
Definition at line 1394 of file nwk.c.
References nwk_snd().
Referenced by ptp_sndInt64(), and rep_sndInt64().
UInt8 nwk_sndUInt16 | ( | UInt16 | v | ) |
Send unsigned 16 bits integer.
This function write a 16-bit value to the network buffer.
[in] | v | Value to write. |
Definition at line 1333 of file nwk.c.
References nwk_snd().
Referenced by nwk_sendHeartBeat(), ptp_sndUInt16(), ptp_sndUInt48sc(), rep_sndUInt16(), and rep_sndUInt48sc().
UInt8 nwk_sndUInt32 | ( | UInt32 * | p | ) |
Send unsigned 32 bits integer.
This function write a 32-bit value to the network buffer.
[in] | p | Pointer to the value to write. |
Definition at line 1349 of file nwk.c.
References nwk_snd().
Referenced by ptp_sndUInt32(), ptp_sndUInt48sc(), rep_sndUInt32(), and rep_sndUInt48sc().
UInt8 nwk_sndUInt48 | ( | uint64_t * | p | ) |
Send unsigned 48 bits integer.
This function write a 48-bit value to the network buffer.
[in] | p | Pointer to the value to send, it is a 64-bit, but only the 48 less significant bits are sent. |
Definition at line 1366 of file nwk.c.
References nwk_snd().
Referenced by ptp_sndUInt48(), and rep_sndUInt48().
UInt8 nwk_sndUInt64 | ( | uint64_t * | p | ) |
Send unsigned 64 bits integer.
This function write a 64-bit value to the network buffer.
[in] | p | Pointer to the value to send. |
Definition at line 1380 of file nwk.c.
References nwk_snd().
Referenced by ptp_sndUInt64(), and rep_sndUInt64().
UInt8 nwk_sndUInt8 | ( | UInt8 | v | ) |
Send unsigned 8 bits integer.
This function write a 8-bit value to the network buffer.
[in] | v | Value to write. |
Definition at line 1317 of file nwk.c.
References nwk_snd().
Referenced by nwk_sendHeartBeat(), ptp_sndUInt8(), and rep_sndUInt8().
UInt8 nwk_start | ( | ) |
Start network request.
This function requests the start of network operations.
Definition at line 839 of file nwk.c.
References ccai_s_zb_start_request().
Referenced by nwk_process().
void nwk_startConfirm | ( | UInt8 | status | ) |
Start network confirmation.
This function takes action on a ZB_START_REQUEST confirmation.
[in] | status | The returning status from CC2480 |
Definition at line 868 of file nwk.c.
References CCAI_STA_ZSUCCESS, and nwk_currentState.
Referenced by ccai_p_zb_start_confirm().
UInt8 nwk_startFrame | ( | UInt16 | destination, |
UInt16 | cmdId, | ||
UInt8 | radius, | ||
UInt8 | len | ||
) |
Start Frame.
This function starts to write a frame (packet) to be send over the network.
[in] | destination | Destination of the frame. |
[in] | cmdId | Command id. |
[in] | radius | Radius of propagation. |
[in] | len | Lenght of the data. |
Definition at line 1264 of file nwk.c.
References ccai_s_zb_send_data_request_begin(), nwk_currentState, nwk_dataHandle, and NWK_DEFACK.
Referenced by nwk_sendHeartBeat(), ptp_startFrame(), and rep_startFrame().
void nwk_startRsp | ( | ) |
Start network response.
This function confirms that ZB_START_REQUEST has been received.
Definition at line 850 of file nwk.c.
References nwk_currentState.
Referenced by ccai_r_zb_start_request().
void nwk_suspend | ( | ) |
network suspend
This function saves the current network state and put it on the suspended state.
Definition at line 459 of file nwk.c.
References nwk_currentState, nwk_lastParam, nwk_lastParamSuccess, and nwk_returnState.
UInt8 nwk_wakeUp | ( | ) |
Network wake up.
This function try to go back to the state before suspend, if fail, a network reset is done.
Definition at line 475 of file nwk.c.
References led_redConfigure(), nwk_currentState, nwk_lastParam, nwk_lastParamSuccess, and nwk_returnState.
Referenced by ccai_p_sys_reset_ind().