# WBT_SetPacketSize

## C Specification

      #include <nitro/wbt.h>

      BOOL WBT_SetPacketSize(int send_packet_size, int recv_packet_size );

## Description

Any time after initialization, you can use this function to dynamically change the packet size specified by the the WBT library parent device using 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.

## Notes

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 of the `WBT_GetBlock` function based on the packet size settings received from the parent using the `WBT_RequestSync` function. Therefore, you cannot change the packet size while a `WBT_GetBlock` data receive is underway.

This function can be used safely only when the following conditions are met:

- No one is executing a data transfer using the `WBT_GetBlock` function when the parent calls this function.
- After the parent calls this function, the child must call the `WBT_RequestSync` function once before calling the `WBT_GetBlock` function.

Note that the decision this function makes internally is only one part of the conditions. This function returning TRUE is not equivalent to fulfilling all the conditions.

## Arguments

`send_packet_size` | The parent device packet size of the MP communication that can be used for WBT. This value must be larger than `WBT_PACKET_SIZE_MIN`.
`recv_packet_size` | The child device packet size of the MP communication that can be used for WBT. This value must be larger than `WBT_PACKET_SIZE_MIN`.

## Return Values

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

## See Also

`WBT_InitParent, WBT_RequestSync, WBT_GetBlock`

## Revision History

09/21/2004 Initial version