Microchip® Advanced Software Framework

miwi_p2p_star.h File Reference

MiWi P2P Star header defintions.

Copyright (c) 2018 - 2022 Microchip Technology Inc. and its subsidiaries.

#include "system.h"
#include "miwi_config.h"
#include "miwi_config_p2p.h"
#include "sysTimer.h"
#include "miwi_api.h"

Data Structures

struct  _DataFrame_t
 
struct  _P2PStarDataFrame_t
 
union  P2P_STATUS
 

Macros

#define aMaxSIFSFrameSize   (18)
 
#define aTurnaroundTime   (12)
 
#define aUnitBackoffPeriod   (20)
 
#define CMD_CHANNEL_HOPPING   0x84
 
#define CMD_DATA_REQUEST   0x83
 
#define CMD_MAC_DATA_REQUEST   0x04
 
#define CMD_P2P_ACTIVE_SCAN_REQUEST   0x87
 
#define CMD_P2P_ACTIVE_SCAN_RESPONSE   0x97
 
#define CMD_P2P_CONNECTION_REMOVAL_REQUEST   0x82
 
#define CMD_P2P_CONNECTION_REMOVAL_RESPONSE   0x92
 
#define CMD_P2P_CONNECTION_REQUEST   0x81
 
#define CMD_P2P_CONNECTION_RESPONSE   0x91
 
#define CMD_TIME_SYNC_COMMAND_PACKET   0x8B
 
#define CMD_TIME_SYNC_DATA_PACKET   0x8A
 
#define CMD_TIME_SYNCHRONIZATION_NOTIFICATION   0x86
 
#define CMD_TIME_SYNCHRONIZATION_REQUEST   0x85
 
#define INPUT
 
#define IOPUT
 
#define MAC_OVERHEAD   (23)
 
#define macMinLIFSPeriod_def   (40)
 
#define macMinSIFSPeriod_def   (12)
 
#define MAX_PAYLOAD   76
 
#define MAX_SCAN_DURATION   14
 
#define MICRO_SECOND_PER_COUNTER_TICK   (1000000ul / ( COUNTER_CRYSTAL_FREQ / 8 ))
 
#define OUTPUT
 
#define PACKETLEN_CMD_CHANNEL_HOPPING   3
 
#define PACKETLEN_CMD_DATA_TO_ENDDEV_SUCCESS   1
 
#define PACKETLEN_CMD_IAM_ALIVE   1
 
#define PACKETLEN_MAC_DATA_REQUEST   TX_BUFFER_SIZE
 
#define PACKETLEN_P2P_ACTIVE_SCAN_REQUEST   2
 
#define PACKETLEN_P2P_ACTIVE_SCAN_RESPONSE   (2 + ADDITIONAL_NODE_ID_SIZE)
 
#define PACKETLEN_P2P_CONNECTION_REMOVAL_REQUEST   1
 
#define PACKETLEN_P2P_CONNECTION_REMOVAL_RESPONSE   2
 
#define PACKETLEN_P2P_CONNECTION_REQUEST   (4 + ADDITIONAL_NODE_ID_SIZE)
 
#define PACKETLEN_TIME_SYNC_DATA_PACKET   TX_BUFFER_SIZE
 
#define PAYLOAD_START   0
 
#define PHY_OVERHEAD   (5)
 
#define STATUS_ACTIVE_SCAN   0x02
 
#define STATUS_ENTRY_NOT_EXIST   0xF0
 
#define STATUS_EXISTS   0x01
 
#define STATUS_NOT_ENOUGH_SPACE   0xF1
 
#define STATUS_NOT_PERMITTED   0xF3
 
#define STATUS_NOT_SAME_PAN   0xF2
 
#define STATUS_SUCCESS   0x00
 

Typedefs

typedef struct _DataFrame_t DataFrame_t
 
typedef struct _P2PStarDataFrame_t P2PStarDataFrame_t
 
typedef enum meshState_ p2pStarState_t
 

Enumerations

enum  meshState_ {
  INITIAL_STATE,
  INIT_STATE,
  STARTING_NETWORK,
  SEARCHING_NETWORK,
  ESTABLISHING_NETWORK,
  SEARCH_COMPLETE,
  PANC_IN_NETWORK_STATE,
  IN_NETWORK_STATE,
  DISCONNECTED,
  RESYNC_IN_PROGRESS
}
 

Functions

bool isSameAddress (INPUT uint8_t *Address1, INPUT uint8_t *Address2)
 

#define aMaxSIFSFrameSize   (18)

Referenced by P2PTasks().

#define aTurnaroundTime   (12)

Referenced by P2PTasks().

#define aUnitBackoffPeriod   (20)

Referenced by P2PTasks().

#define CMD_CHANNEL_HOPPING   0x84

Referenced by frameParse().

#define CMD_DATA_REQUEST   0x83
#define CMD_MAC_DATA_REQUEST   0x04

Referenced by frameParse().

#define CMD_P2P_ACTIVE_SCAN_REQUEST   0x87

Referenced by frameParse().

#define CMD_P2P_ACTIVE_SCAN_RESPONSE   0x97

Referenced by frameParse().

#define CMD_P2P_CONNECTION_REMOVAL_REQUEST   0x82

Referenced by frameParse(), and removeConnection().

#define CMD_P2P_CONNECTION_REMOVAL_RESPONSE   0x92

Referenced by frameParse().

#define CMD_P2P_CONNECTION_REQUEST   0x81
#define CMD_P2P_CONNECTION_RESPONSE   0x91

Referenced by frameParse().

#define CMD_TIME_SYNC_COMMAND_PACKET   0x8B
#define CMD_TIME_SYNC_DATA_PACKET   0x8A
#define CMD_TIME_SYNCHRONIZATION_NOTIFICATION   0x86
#define CMD_TIME_SYNCHRONIZATION_REQUEST   0x85
#define INPUT
#define IOPUT
#define MAC_OVERHEAD   (23)

Referenced by P2PTasks().

#define macMinLIFSPeriod_def   (40)

Referenced by P2PTasks().

#define macMinSIFSPeriod_def   (12)

Referenced by P2PTasks().

#define MAX_PAYLOAD   76

Referenced by MiApp_SendData().

#define MAX_SCAN_DURATION   14
#define MICRO_SECOND_PER_COUNTER_TICK   (1000000ul / ( COUNTER_CRYSTAL_FREQ / 8 ))
#define OUTPUT
#define PACKETLEN_CMD_CHANNEL_HOPPING   3
#define PACKETLEN_CMD_DATA_TO_ENDDEV_SUCCESS   1

Referenced by macAckOnlyDataCallback().

#define PACKETLEN_CMD_IAM_ALIVE   1
#define PACKETLEN_MAC_DATA_REQUEST   TX_BUFFER_SIZE
#define PACKETLEN_P2P_ACTIVE_SCAN_REQUEST   2
#define PACKETLEN_P2P_ACTIVE_SCAN_RESPONSE   (2 + ADDITIONAL_NODE_ID_SIZE)

Referenced by frameParse().

#define PACKETLEN_P2P_CONNECTION_REMOVAL_REQUEST   1

Referenced by removeConnection().

#define PACKETLEN_P2P_CONNECTION_REMOVAL_RESPONSE   2

Referenced by frameParse().

#define PACKETLEN_P2P_CONNECTION_REQUEST   (4 + ADDITIONAL_NODE_ID_SIZE)

Referenced by sendConnectionRequest().

#define PACKETLEN_TIME_SYNC_DATA_PACKET   TX_BUFFER_SIZE
#define PAYLOAD_START   0
#define PHY_OVERHEAD   (5)

Referenced by P2PTasks().

#define STATUS_ACTIVE_SCAN   0x02

Referenced by AddConnection(), and frameParse().

#define STATUS_ENTRY_NOT_EXIST   0xF0

Referenced by frameParse().

#define STATUS_EXISTS   0x01

Referenced by AddConnection(), and frameParse().

#define STATUS_NOT_ENOUGH_SPACE   0xF1

Referenced by AddConnection().

#define STATUS_NOT_PERMITTED   0xF3

Referenced by frameParse().

#define STATUS_NOT_SAME_PAN   0xF2

Referenced by frameParse().

#define STATUS_SUCCESS   0x00

Referenced by AddConnection(), and frameParse().

typedef struct _DataFrame_t DataFrame_t
typedef enum meshState_ p2pStarState_t

enum meshState_
Enumerator
INITIAL_STATE 
INIT_STATE 
STARTING_NETWORK 
SEARCHING_NETWORK 
ESTABLISHING_NETWORK 
SEARCH_COMPLETE 
PANC_IN_NETWORK_STATE 
IN_NETWORK_STATE 
DISCONNECTED 
RESYNC_IN_PROGRESS 

bool isSameAddress ( INPUT uint8_t *  Address1,
INPUT uint8_t *  Address2 
)