Fork of my original MQTTGateway

Dependencies:   mbed-http

Embed: (wiki syntax)

« Back to documentation index

Pkt Basic Private Functions

Pkt Basic Private Functions
[SPIRIT_PktBasic]

Functions

void SpiritPktBasicInit (PktBasicInit *pxPktBasicInit)
 Initializes the SPIRIT Basic packet according to the specified parameters in the PktBasicInit struct.
void SpiritPktBasicGetInfo (PktBasicInit *pxPktBasicInit)
 Returns the SPIRIT Basic packet structure according to the specified parameters in the registers.
void SpiritPktBasicAddressesInit (PktBasicAddressesInit *pxPktBasicAddresses)
 Initializes the SPIRIT Basic packet addresses according to the specified parameters in the PktBasicAddressesInit struct.
void SpiritPktBasicGetAddressesInfo (PktBasicAddressesInit *pxPktBasicAddresses)
 Returns the SPIRIT Basic packet addresses structure according to the specified parameters in the registers.
void SpiritPktBasicSetFormat (void)
 Configures the Basic packet format as packet used by SPIRIT.
void SpiritPktBasicAddressField (SpiritFunctionalState xAddressField)
 Sets the address length for SPIRIT Basic packets.
SpiritFunctionalState SpiritPktBasicGetAddressField (void)
 Specifies if the Address field for SPIRIT Basic packets is enabled or disabled.
void SpiritPktBasicSetPayloadLength (uint16_t nPayloadLength)
 Sets the payload length for SPIRIT Basic packets.
uint16_t SpiritPktBasicGetPayloadLength (void)
 Returns the payload length for SPIRIT Basic packets.
uint16_t SpiritPktBasicGetReceivedPktLength (void)
 Returns the packet length field of the received packet.
void SpiritPktBasicSetVarLengthWidth (uint16_t nMaxPayloadLength, SpiritFunctionalState xAddressField, BasicControlLength xControlLength)
 Computes and sets the variable payload length for SPIRIT Basic packets.

Function Documentation

void SpiritPktBasicAddressesInit ( PktBasicAddressesInit *  pxPktBasicAddresses )

Initializes the SPIRIT Basic packet addresses according to the specified parameters in the PktBasicAddressesInit struct.

Parameters:
pxPktBasicAddressesBasic packet addresses init structure. This parameter is a pointer to PktBasicAddresses.
Return values:
None.

Definition at line 279 of file SPIRIT_PktBasic.c.

void SpiritPktBasicAddressField ( SpiritFunctionalState  xAddressField )

Sets the address length for SPIRIT Basic packets.

Parameters:
xAddressFieldlength of ADDRESS in bytes. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 411 of file SPIRIT_PktBasic.c.

void SpiritPktBasicGetAddressesInfo ( PktBasicAddressesInit *  pxPktBasicAddresses )

Returns the SPIRIT Basic packet addresses structure according to the specified parameters in the registers.

Parameters:
pxPktBasicAddressesBasic packet addresses init structure. This parameter is a pointer to PktBasicAddresses.
Return values:
None.

Definition at line 344 of file SPIRIT_PktBasic.c.

SpiritFunctionalState SpiritPktBasicGetAddressField ( void   )

Specifies if the Address field for SPIRIT Basic packets is enabled or disabled.

Parameters:
None.
Return values:
SpiritFunctionalStateNotifies if the address field is enabled or disabled.

Definition at line 442 of file SPIRIT_PktBasic.c.

void SpiritPktBasicGetInfo ( PktBasicInit *  pxPktBasicInit )

Returns the SPIRIT Basic packet structure according to the specified parameters in the registers.

Parameters:
pxPktBasicInitBasic packet init structure. This parameter is a pointer to PktBasicInit.
Return values:
None.

Definition at line 225 of file SPIRIT_PktBasic.c.

uint16_t SpiritPktBasicGetPayloadLength ( void   )

Returns the payload length for SPIRIT Basic packets.

Since the packet length depends from the address and the control field size, this function reads the correspondent registers in order to determine the correct payload length to be returned.

Parameters:
None.
Return values:
uint16_tPayload length in bytes.

Definition at line 503 of file SPIRIT_PktBasic.c.

uint16_t SpiritPktBasicGetReceivedPktLength ( void   )

Returns the packet length field of the received packet.

Parameters:
None.
Return values:
uint16_tPacket length.

Definition at line 527 of file SPIRIT_PktBasic.c.

void SpiritPktBasicInit ( PktBasicInit *  pxPktBasicInit )

Initializes the SPIRIT Basic packet according to the specified parameters in the PktBasicInit struct.

Notice that this function sets the autofiltering option on CRC if it is set to any value different from BASIC_NO_CRC.

Parameters:
pxPktBasicInitBasic packet init structure. This parameter is a pointer to PktBasicInit.
Return values:
None.

Definition at line 119 of file SPIRIT_PktBasic.c.

void SpiritPktBasicSetFormat ( void   )

Configures the Basic packet format as packet used by SPIRIT.

Parameters:
None.
Return values:
None.

Definition at line 371 of file SPIRIT_PktBasic.c.

void SpiritPktBasicSetPayloadLength ( uint16_t  nPayloadLength )

Sets the payload length for SPIRIT Basic packets.

Since the packet length depends from the address and the control field size, this function reads the correspondent registers in order to determine the correct packet length to be written.

Parameters:
nPayloadLengthpayload length in bytes. This parameter is an uint16_t.
Return values:
None.

Definition at line 471 of file SPIRIT_PktBasic.c.

void SpiritPktBasicSetVarLengthWidth ( uint16_t  nMaxPayloadLength,
SpiritFunctionalState  xAddressField,
BasicControlLength  xControlLength 
)

Computes and sets the variable payload length for SPIRIT Basic packets.

Parameters:
nMaxPayloadLengthpayload length in bytes. This parameter is an uint16_t.
xAddressFieldEnable or Disable Address Field. This parameter can be S_ENABLE or S_DISABLE.
xControlLengthControl length in bytes. This parameter can be any value of BasicControlLength.
Return values:
None.

Definition at line 556 of file SPIRIT_PktBasic.c.