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

Table 13-2. Parameters
ParameterDescription
payloadPointer to payload
payloadLengthLength of Payload
devIndexIndex of device in application Device table
msduHandleHandle for MSDU payload
unicastboolean indicating if a packet is unicast or broadcast
ackReqboolean to indicate if an ack is requested
frameRetryBoolean 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

Table 13-3. Parameters
ParameterDescription
srcAddressModeAddresing Mode of Source device (16bits/64 bits)
destAddressModeAddressing 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

Table 13-4. Parameters
ParameterDescription
frameTypeType 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

Table 13-5. Parameters
ParameterDescription
appModeSwitchPointer 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

Table 13-6. Parameters
ParameterDescription
nPacketsSentPackets which received TX Done CB
nBytesSentBytes which received TX Done CB
nPacketsRecAckPackets 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

Table 13-7. Return Values
Return ValueDescription
PHY_Retval_tReturns 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

Table 13-8. Parameters
ParameterDescription
dev_indexDevice 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

Table 13-9. Parameters
ParameterDescription
dev_indexDevice table info corresponding to device table index
devTablePointer 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

Table 13-10. Parameters
ParameterDescription
appnwkParamPointer to struct APP_NWK_PARAM

Return Values

Table 13-11. Return Values
Return ValueDescription
APP_OP_STATE_TPointer to struct APP_OP_STATE_T