Data Structures | Defines | Enumerations
p2p_protocol.h File Reference

The file contains macros and types of the P2P (peer to peer) protocol. More...

Go to the source code of this file.

## Data Structures
struct | p2p_chsweep_exec_req_t
struct | p2p_chsweep_result_cnf_t
struct | p2p_chsweep_result_req_t
struct | p2p_chsweep_sweep_req_t
struct | p2p_hdr_t
struct | p2p_jump_bootl_t
struct | p2p_ping_cnf_t
struct | p2p_ping_req_t
struct | p2p_wibo_data_t
struct | p2p_wibo_exit_t
struct | p2p_wibo_finish_t
struct | p2p_wibo_reset_t
struct | p2p_wibo_target_t
struct | p2p_wuart_data_t
struct | p2p_xmpl_led_t
## Defines
#define | __FILL_P2P_HEADER__(hdr, vfcf, vpan, vdst, vsrc, vcmd)
#define | FILL_P2P_HEADER_ACK(hdr, pan, dst, src, cmd) __FILL_P2P_HEADER__(hdr, 0x8861, pan, dst, src, cmd)
#define | FILL_P2P_HEADER_NOACK(hdr, pan, dst, src, cmd) __FILL_P2P_HEADER__(hdr, 0x8841, pan, dst, src, cmd)
#define | INC_P2P_HEADER_SEQNB(hdr, seq) do {hdr->seq ++;} while(0)
#define | P2P_CHSWEEP_EXEC_REQ (0x53)
#define | P2P_CHSWEEP_RESULT_CNF (0x52)
#define | P2P_CHSWEEP_RESULT_REQ (0x51)
#define | P2P_CHSWEEP_SWEEP_REQ (0x50)
#define | P2P_JUMP_BOOTL (0x03)
#define | P2P_PING_CNF (0x02)
#define | P2P_PING_REQ (0x01)
#define | P2P_WIBO_DATA (0x20)
#define | P2P_WIBO_EXIT (0x23)
#define | P2P_WIBO_FINISH (0x21)
#define | P2P_WIBO_RESET (0x22)
#define | P2P_WIBO_TARGET (0x24)
#define | P2P_WUART_DATA (0x40)
#define | P2P_XMPL_LED (0x30)
#define | SET_P2P_HEADER_DESTADD(hdr, seq) do {hdr->dst = dst;} while(0)
#define | SET_P2P_HEADER_SEQNB(hdr, seq) do {hdr->seq = (seq);} while(0)
## Enumerations
enum | p2p_error_t { P2P_ERROR_NONE = 0x00, P2P_ERROR_NONE_DATAMISS, P2P_ERROR_SUCCESS }
enum | p2p_status_t { P2P_STATUS_IDLE = 0x00, P2P_STATUS_RECEIVINGDATA = 0x01, P2P_STATUS_ERROR = 0xFF }

## Detailed Description

The file contains macros and types of the P2P (peer to peer) protocol.

## Define Documentation

#define __FILL_P2P_HEADER__ | ( |  | hdr,
|  |  | vfcf,
|  |  | vpan,
|  |  | vdst,
|  |  | vsrc,
|  |  | vcmd
| ) |  |

Value:

    do{\
            hdr->fcf = (vfcf);\
            hdr->seq += 1;\
            hdr->pan = (vpan);\
            hdr->dst = (vdst);\
            hdr->src = (vsrc);\
            hdr->cmd = (vcmd);\
        }while(0)

#define FILL_P2P_HEADER_ACK | ( |  | hdr,
|  |  | pan,
|  |  | dst,
|  |  | src,
|  |  | cmd
| ) |  | __FILL_P2P_HEADER__(hdr, 0x8861, pan, dst, src, cmd)

This macro fill the P2P frame header with set ack req in the FCF

#define FILL_P2P_HEADER_NOACK | ( |  | hdr,
|  |  | pan,
|  |  | dst,
|  |  | src,
|  |  | cmd
| ) |  | __FILL_P2P_HEADER__(hdr, 0x8841, pan, dst, src, cmd)

This macro fill the P2P frame header without ack req in the FCF

#define P2P_CHSWEEP_EXEC_REQ (0x53)

measurement frame

#define P2P_CHSWEEP_RESULT_CNF (0x52)

result data from a node

#define P2P_CHSWEEP_RESULT_REQ (0x51)

request result data from a node

#define P2P_CHSWEEP_SWEEP_REQ (0x50)

This commands requests a channel sweep

#define P2P_JUMP_BOOTL (0x03)

forces the application to jump to bootloader

#define P2P_PING_CNF (0x02)

Reply to a ping request

#define P2P_PING_REQ (0x01)

Frame Command Bytes for P2P applications. Ping a node which replies and delivers information about itself

#define P2P_WIBO_DATA (0x20)

Feed a node with data

#define P2P_WIBO_EXIT (0x23)

Exit bootloader and jump to application vector

#define P2P_WIBO_FINISH (0x21)

Force a write of all received data

#define P2P_WIBO_RESET (0x22)

Reset data stream

#define P2P_WIBO_TARGET (0x24)

Set programming target

#define P2P_WUART_DATA (0x40)

data frame containing data

#define P2P_XMPL_LED (0x30)

P2P Example command