13.7.3 15_4_P2P_Phy_App Functions
C
void app_P2P_Phy_TransmitFrame(uint8_t *payload, uint8_t payloadLength, uint8_t devIndex, uint8_t msduHandle, bool unicast, bool ackReq, bool frameRetry);
Description
This function is used to transmit a frame from application layer.
Parameters
Parameter | Description |
---|---|
payload | Pointer to payload |
payloadLength | Length of Payload |
devIndex | Index of device in application Device table |
msduHandle | Handle for MSDU payload |
unicast | boolean indicating if a packet is unicast or broadcast |
ackReq | boolean to indicate if an ack is requested |
frameRetry | Boolean to indicate if MAC level frame retry is requested or not |
Return Values
None
C
void app_P2P_Phy_setAddressModes(uint8_t srcAddressMode, uint8_t dstAddressMode);
Description
This function is used to set addressing modes - short (16 bit) or Extended addressing mode(64 bits) throughout the application.
Parameters
Parameter | Description |
---|---|
srcAddressMode | Addresing Mode of Source device (16bits/64 bits) |
destAddressMode | Addressing Mode of Destination device(16bits/64 bits) |
Return Values
None
C
void app_P2P_Phy_setFrameType(uint8_t frameType);
Description
This function is used to set frame types of payload-beacon, data, Ack, Command, LLDN, Multipurpose frame.
Parameters
Parameter | Description |
---|---|
frameType | Type of frame to be transmitted |
Return Values
None
C
void app_P2P_Phy_ConfigDataReception(void);
Description
This function is used to configure Receiver.
Parameters
None
Return Values
None
C
void app_P2P_Phy_TaskHandler(APP_Msg_T *appModeSwitch);
Description
This function is used to switch to different application modes.
Parameters
Parameter | Description |
---|---|
appModeSwitch | Pointer to the structure APP_Msg_T |
Return Values
None
C
void app_P2P_Phy_packetErrorRateCal(uint64_t nPacketsSent, uint64_t nBytesSent, uint64_t nPacketsRecAck);
Description
This function is used to calculate Packet Error Rate from below mentioned input parameters.
Parameters
Parameter | Description |
---|---|
nPacketsSent | Packets which received TX Done CB |
nBytesSent | Bytes which received TX Done CB |
nPacketsRecAck | Packets which received Ack from peer device |
Return Values
None
C
PHY_Retval_t app_P2P_Phy_StartEdScan(void);
Description
This function is used to initiate Energy Detection scan in the current set Channel.
Parameters
None
Return Values
Return Value | Description |
---|---|
PHY_Retval_t | Returns the result of ED scan if the channel is idle or busy |
C
void app_P2P_Phy_GetDeviceTableInfo(uint8_t dev_index);
void app_P2P_Phy_SetDeviceTableInfo(uint8_t dev_index, DEVICE_TABLE *devTable);
Description
This function is used to get/retain the device table parameters corresponding to device table index like IEEE address, short address(16 bits), LQI value and RSSI value of received payload.
Parameters
Parameter | Description |
---|---|
dev_index | Device table info corresponding to device table index |
Return Values
None
C
void app_P2P_Phy_SetDeviceTableInfo(uint8_t dev_index, DEVICE_TABLE *devTable);
Description
This function is used to set the device table parameters corresponding to device table index like IEEE address, short address(16 bits), LQI value and RSSI value of received payload.
Parameters
Parameter | Description |
---|---|
dev_index | Device table info corresponding to device table index |
devTable | Pointer to struct DEVICE_TABLE |
Return Values
None
C
APP_OP_STATE_T app_P2P_Phy_SetNWKParams(APP_NWK_PARAM *appnwkParam);
Description
This function is used to set Network parameters like Channel, Channel Page, no. of frame retries and other PIB attributes, etc.,
Parameters
Parameter | Description |
---|---|
appnwkParam | Pointer to struct APP_NWK_PARAM |
Return Values
Return Value | Description |
---|---|
APP_OP_STATE_T | Pointer to struct APP_OP_STATE_T |