Read Failed at cupsBackChannelRead

Michael Sweet msweet at apple.com
Tue Nov 17 08:26:30 PST 2009


On Nov 17, 2009, at 4:48 AM, Zebra wrote:
> Hi,
> 
>    i changed the program still i having same problem and also i have some questions pls clarify my doubts please sir,
> 
>    Question Number 1) the command "/033V/r" Returns the Firmware Version of the Printer i send this code by following way from "filter/rastertolabel.c"
> 
> 
> fputs("\033V\r",stdout);
> fflush(stdout);
> cupsSideChannelDoRequest(CUPS_SC_CMD_DRAIN_OUTPUT, buff, &bufflen,10.0);
> bufflen =(int)cupsBackChannelRead(buff, sizeof(buff), 10.0);
> 
> 
> In this way the "buff" contains nothing and also "bufflen" is -1.

How is the printer connected?

> 
> 
>     Question Number 2) I am sending command to printer from filter for that the printer gives response where i can receive that response.
> 
>     Question Number 3) cupsSideChannelRead(-------),cupsBackChannelWrite(----) always return -1.
> 
> Thanking you Sir
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>> If you use stdio you need to fflush(stdout) to force the data to the =
>> backend, and then you do NOT want to have a timeout of 0.0 when calling =
>> cupsBackChannelRead - use at least 10 seconds to allow for =
>> interface/network delays.
>> 
>> For synchronized queries, you probably also want to use =
>> cupsSideChannelDoRequest() to tell the backend to drain all pending =
>> output before reading the data back, e.g.:
>> 
>>    fputs("something", stdout);
>>    fflush(stdout);
>> 
>>    char buff[256];
>>    int bufflen =3D 0;
>>    cupsSideChannelDoRequest(CUPS_SC_CMD_DRAIN_OUTPUT, buff, &bufflen, =
>> 10.0);
>> 
>>    bufflen =3D (int)cupsBackChannelRead(buff, sizeof(buff), 10.0);
>> 
>> On Nov 16, 2009, at 12:57 AM, Zebra wrote:
>> 
>>> Hi,
>>> =20
>>> =20
>>>   I written following code to read the printer response,
>>> =20
>>> char buff[256] =3D {0};
>>> memset(buff,0,sizeof(buff));
>>> fputs("\033!RIBLEN\r",stdout);
>>> =20
>>> memset(buff,0,sizeof(buff));
>>> fputs("\033E 2\r",stdout);
>>> fputs("\033V\r",stdout);
>>> =20
>>> memset(buff,0,sizeof(buff));
>>> ssize_t retv=3DcupsBackChannelRead(buff,sizeof(buff),0.0);
>>> =20
>>> Finaly buff contains nothing and return value also -1.pls point out =
>> where is error.
>>> =20
>>> =20
>>> Thanking You
>>> _______________________________________________
>>> cups-ddk mailing list
>>> cups-ddk at easysw.com
>>> http://lists.easysw.com/mailman/listinfo/cups-ddk
>> 
>> ___________________________________________________
>> Michael Sweet, Senior Printing System Engineer
>> 
>> 
>> 
> 
> _______________________________________________
> cups-ddk mailing list
> cups-ddk at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups-ddk

___________________________________________________
Michael Sweet, Senior Printing System Engineer







More information about the cups-devel mailing list