IMbnDeviceService::WriteData method

Write data to a device service data session.

Syntax


HRESULT WriteData(
  [in]   SAFEARRAY(BYTE) deviceServiceData,
  [out]  ULONG *requestID
);

Parameters

deviceServiceData [in]

A byte array that is passed in to the device to write.

requestID [out]

A unique request ID assigned by the Mobile Broadband service to identify this request.

Return value

The method can return one of the following values.

Return codeDescription
S_OK

The method completed successfully.

E_ACCESSDENIED

This device service command is not allowed for calling process privileges.

HRESULT_FROM_WIN32(ERROR_BUFFER_OVERFLOW)

The length of the deviceServiceData is greater than the supported MaxDataSize.

HRESULT_FROM_WIN32(ERROR_OPEN_FAILED)

The device service session is not open.

Other

An error was encountered when executing this method.

 

Remarks

WriteData passes a bulk data to a vendor-specific device service on the device. The Mobile Broadband service will forward this request to the device. deviceServiceData will be copied byte-by-byte into the data buffer passed in to the request. This data buffer must be less than MaxDataSize bytes.

The data session must be opened before the application can call WriteData. The operating system does not provide guarantees on the latency or performance of WriteData.

This is an asynchronous operation and WriteData will return immediately. On completion of the operation, the Mobile Broadband service will call the OnWriteDataComplete method of the IMbnDeviceServicesEvents interface.

See also

IMbnDeviceService

 

 

Community Additions

ADD
Show:
© 2014 Microsoft