# WBT_SetPacketSize

## Syntax

  `#include <nitro/wbt.h>`
  `BOOL WBT_SetPacketSize(int send_packet_size, int recv_packet_size );`

## Arguments

`send_packet_size` | Parent packet size for MP communication that can be used for WBT. This size must be at least `WBT_PACKET_SIZE_MIN` bytes.
`recv_packet_size` | Child packet size for MP communication that can be used for WBT. This size must be at least `WBT_PACKET_SIZE_MIN` bytes.

## Return Values

Returns `TRUE` if the current packet size can be changed. Otherwise, returns `FALSE`.

## Description

At any time after initialization, use this function to dynamically change the packet size that a WBT library parent device specified with the `WBT_InitParent` function. If the function succeeds, it returns control immediately. You can adjust the transfer efficiency by changing the packet size with this function, in accordance with data sharing and the presence or absence of the simultaneous use of communication ports other than WBT.

## Note

This function presupposes logical control on the application side, so there is no guarantee that it will always operate stably.
Each child device calculates the transfer unit size and bitmap buffer size for the `WBT_GetBlock` function based on the packet size settings most recently received from the parent using the `WBT_RequestSync` function. Therefore, you cannot change the packet size while a `WBT_GetBlock` data receive is under way.
This function can be used safely only when the following conditions are met.
Enbsp;When the parent calls this function, no devices are running data transfers using `WBT_GetBlock`.
Enbsp;After the parent calls this function, children always call `WBT_RequestSync` at least once before `WBT_GetBlock`.
Note: Only some of these conditions can actually be verified within this function. The fact that this function returns `TRUE` does not mean that all of these conditions have been met.

## See Also

`WBT_InitParent`
`WBT_RequestSync`
`WBT_GetBlock`

## Revision History

2004/09/21 Initial version.

CONFIDENTIAL