# WMPortSendCallback

## Definitions

  `#include <nitro/wm.h>`

      typedef struct WMPortSendCallback
      {
          u16             apiid;
          u16             errcode;
          u16             wlCmdID;
          u16             wlResult;
          u16             state;
          u16             port;
          u16             destBitmap;
          u16             restBitmap;
          u16             sentBitmap;
          u16             rsv;
          const u16       *data;
          u16             length;
          u16             seqNo;
          WMCallbackFunc  callback;
          void            *arg;

      } WMPortSendCallback;

## Elements

apiid | This is the ID of the API that acts as the source for the callback generation. It is synonymous to the `WMApiid` enumerated type. In this case, it is fixed in `WM_APIID_PORT_SEND`.
errcode | This is the result of the asynchronous process. It is synonymous to the `WMErrCode` enumerated type.
wlCmdID | If errcode is `WM_ERRCODE_FAILED`, this function will store the ID of the command that was in error in the wireless firmware.
wlResult | If errcode is `WM_ERRCODE_FAILED`, this function will store the code was the source of the error in the wireless firmware.
state | If `errcode` is `WM_ERRCODE_SUCCESS`, the `WM Cause Code` generated by the callback is stored. Currently, only `WM_STATECODE_PORT_SEND` is generated.
port | The port that sends the data is stored here.
destBitmap | The bitmap of the AID assigned to the send destination is stored here.
restBitmap | The bitmap of the AID of the send destination that has to perform a retry is stored here. This bitmap is not included in an AID for which it is clear that the send was not a success due to disconnection or not yet being connected.
sentBitmap | This is the bitmap of the AID for the communications partner which was actually able to send from among the send destinations designated by `destBitmap`. While it is guaranteed that the data will arrive at a communications partner that includes the `sentBitmap`, there is no such guarantee for a communications partner that does not include the `sentBitmap`.
rsv | Reserved.
data | The address of the buffer that sent the data is stored here.
length | The data length that was sent is stored here.
seqNo | Stores the sequence number.
callback | This is a field that the library uses internally. The address of the called callback function is stored here.
arg | The argument designated with the `WM_SetMPDataToPortEx` function is stored here.

## Description

This is a structure passed to the callback function for each of the `WM_SetMPDataToPort`, `WM_SetMPDataToPortEx`, and `WM_SetMPData` functions.

`WM_ERRCODE_SUCCESS` goes in the errcode field if the send was a success, `WM_ERRCODE_SEND_FAILED` goes in if the send failed, and `WM_ERRCODE_SEND_QUEUE_FULL` goes in if the send queue is full. Even if an AID is included that is incapable of sending to the send destination designated with destBitmap due to a disconnect during the send or a connection not yet existing, be sure that `WM_ERRCODE_SUCCESS` is returned in the event that everything is sent to the remaining communications partners that are capable of sending. Compare the `destBitmap` and the `sentBitmap` to confirm that everything was actually sent to the designated send destination.

## Revision History

03/04/2005 Initial version

CONFIDENTIAL