Ref: "Ap1400ProgGuide1_2.docx"
Page 42 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
KrnlSendData
Send data without flow control
Prototype
int
WINAPI KrnlSendData(
int
iHandle,
LPCTSTR
pData);
Description.
KrnlSendData sends data over the bulk endpoint but unlike SendData, there is no
flow control. It is primarily available for firmware based tools from Able Systems, but
in conjunction with SendCtrl could be used to allow end users to define their own
flow control strategies.
KrnlSendData, in isolation, will send data to the device irrespective of the devices
buffer state. If the buffer becomes full, then buffer overwrites will occur.
KernelSendData will send data in the buffer until the first NULL character is
received. For this reason, it is not possible to send data which contains null
characters, SendData must be used.
Arguments
ihandle – Handle of an open device. This handle must have been issued by a
previous call to OpenDevice.
pData - Pointer to the buffer containing the data to be sent. The data must be
terminated with a NULL character.
Returns
ERROR_SUCCESS if successful, otherwise the system error code is returned.
Example
//Get the status byte
CString
csLine=_T(
"This is a line of data\r\n"
);
dwStatusCode=KrnlSendData(m_iOpenHandle,csLine);
TRACE(_T(
"Sent a line of data. Return code=%d\n"
),dwStatusCode);
if
(dwStatusCode)
{
//We have an error
CString
csError;
csError.Format(_T(“KrnlSendData failed with code=%d.\n”),
dwStatusCode);
AfxMessageBox(csError,MB_ICONSTOP|MB_OK);
//Close the printer
CloseDevice(&m_iOpenHandle);
return
;
}
You are always welcome to contact Able Systems or your local supplier for specific assistance.
We would also appreciate reports of any errors in our documentation, or suggested improvements.
For technical support please contact:
or call +44 (0) 1606 48621 and
select option 4 for Technical Support.
Copyright © Able Systems Limited 2013. All Rights Reserved
[End]