PFN_DECODE (Compact 2013)

10/16/2014

This function is called to decode a frame received from a KITLTRANSPORT structure and return a pointer to the data portion of the frame.

Syntax

typedef LPBYTE (* PFN_DECODE) (
  LPBYTE pbFrame,
  PUSHORT pcbData
);

Parameters

  • pbFrame
    [in] Pointer to the complete frame.
  • pcbData
    [in, out] Pointer to a variable that stores the length of the data only inside the frame. On entry, this contains the size of the whole frame.

Return Value

If the frame can be decoded, a pointer to the start of the data is returned; otherwise, returns NULL.

Remarks

The decode function must check if the frame is valid and put the length of the data in pcbData and return the pointer to the data.

The function returns NULL if it is not a valid frame.

You implement a function of this type and assign it to the pfnDecode member of KITLTRANSPORTduring your Board Support Package (BSP) KITL initialization. For an example of the implementation of this function, see the KitlEthDecode function in %_WINCEROOT%\Platform\Common\Src\Common\Kitl\Kitleth.c. If you are using the common KITL library in conjunction with Ethernet or serial transport, this function is already implemented for you.

Requirements

Header

kitl.h

Library

Kitl.lib

See Also

Reference

Required KITL Functions
KITLTRANSPORT