# WM_SetPortCallback

## C Specification

      #include <nitro/wm.h>

      WMErrCode WM_SetPortCallback(
              u16             port ,
              WMCallbackFunc  callback ,
              void*           arg );

## Description

Sets the callback function that is called when the data for the specified port is received

This is a synchronous function that immediately returns `WM_ERRCODE_SUCCESS` when the process succeeds.

## Arguments

`port` | Port number
`callback` | Callback function that is called as the communication frames arrive.
`arg` | Argument passed to the callback function.

## Return Values

Returns the process result as a `WMErrCode` enumerated type.

## See Also

`WM_SetMPDataToPort`, `WMPort`

## Revision History

10/22/2004 Changed return value type
08/11/2004 Initial version