From: HimaNshu on
I appreciate your last suggestion, but I cannot change my platform to
Win CE 6 or WinCE mobile 5.0 and even I don't have that much time to
wait for Win CE 6, I know that there is no any other option other then
waiting for Win CE 6.0 but I want to write my own USB Modem driver for
usbser.sys support. for that I just want to know what are the basic
requirements to be implement after establishing connection,
because I am passing correct descriptor so device is connecting
properly but at Host end I unable to configure port so my HyperTerminal
test is not working until I handling mandatory requests from Host side
to device like,

ET_LINE_CODING
SEND_ENCAPSULATED_COMMAND
SET_CONTROL_LINE_STATE
SEND_BREAK
GET_LINE_CODING
GET_ENCAPSULATED_RESPONSE

so would like to know, is there any request handling implemented in
serial_class code(usbfndrv.cpp or in PDD layer)? if yes then let me
know where is it exactly?
and answer is No then please suggest me how I can implement it and
which are mandatory out of them.


David Liao (MS) wrote:
> Then, you have to figure out the problem by yourself.
> Otherwise, you have to wait for Windows CE 6.0 if you don't have Windows CE
> 6.0 beta.
> David Liao
> "HimaNshu" <gajjar.himanshu(a)gmail.com> wrote in message
> news:1157593614.649281.305900(a)i42g2000cwa.googlegroups.com...
> > Hi David,
> > I don't have USBser client in my platform I am using normail Windows CE
> > 5.0 not WinMobile platform 5.0, I think normal Windows CE 5.0 platform
> > does not including USB Modem driver, there is only three client serial
> > class for activesync, Mass storage and RNDIS client...but there is no
> > other client like USBser for USB modem,
> >
> > so I have to modify my existing serial class into USB modem client for
> > USBser.sys support with XP host.
> >
> > so I need help to modify my serial class into USB modem class(CDC and
> > ACM) support if I am on the wrong track then let me know correct path
> > to get USB modem intercafe in Windows CE 5.0 platform.
> >
> > Thanks in advance I am waiting for your reply.
> >
> > David Liao (MS) wrote:
> >> We have tested Windows CE USB Host USBSer driver agains Windows CE USB
> >> Function USBSer driver. It should work.
> >> I think you can verify it by using two CEPC, one with USB Host
> >> Controller(EHCI,OHCI, UHCI) , another with USB Function COntroller
> >> (NET2280). Select Default USB Function Client By registry as
> >> "DefaultClientDriver"="USBSER_Class"
> >>
> >> It should work in this configuration.
> >>
> >> David Liao
> >>
> >> "HimaNshu" <gajjar.himanshu(a)gmail.com> wrote in message
> >> news:1157508012.963190.324380(a)b28g2000cwb.googlegroups.com...
> >> > Anybody can help to modify my existing serial class to USBser class for
> >> > USBser.sys support for XP Host,
> >> > Please help me, who are using Windows Mobile 5.0 or Windows CE 6.0 beta
> >> > this two platform have full support of USBser.sys. for USB modem class
> >> > on Win CE device.
> >> > for refrance please check it out
> >> > http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/browse_thread/thread/cc1542edb42abc63/4135e4aa3d883c8e?lnk=st&q=&rnum=17&hl=en#4135e4aa3d883c8e
> >> >
> >> > I able to connect device by modifying in descriptor but I am still not
> >> > able to open COM port in Hyperterminal to test...:(
> >> >
> >> > in Windows Mobile 5 platform builder
> >> > WINCE500\public\common\oak\drivers\usbfn\class\serial ---->USBFnDrv.cpp
> >> > in Windows CE 6 beta may be they have give seprate class as
> >> > WINCE500\public\common\oak\drivers\usbfn\class\USBser
> >> >
> >> > I appreciate who would give me the direction.
> >> >
> >

From: HimaNshu on
I have impliment just cases with this requestes
SET_LINE_CODING
SEND_ENCAPSULATED_COMMAND
SET_CONTROL_LINE_STATE
SEND_BREAK
GET_LINE_CODING
GET_ENCAPSULATED_RESPONSE

It working fine in connection and even comport is opening properly at
Host end also...it sends SET_LINE_CODING request...

CONTROL_RESPONSE CUsbFn::HandleClassRequest(
USB_DEVICE_REQUEST udr
)
{
CONTROL_RESPONSE response =
CR_STALL_DEFAULT_PIPE;//CR_SUCCESS_SEND_CONTROL_HANDSHAKE;

memset(strLogString, 0, 256);
sprintf(strLogString, "HandleClassRequest USB_DEVICE_REQUEST
udr.bmReqTyp = 0x%X, udr.bRequest = 0x%X, udr.wValue = %d, udr.wIndex =
%d, udr.wLength = %d",udr.bmRequestType, udr.bRequest, udr.wValue,
udr.wIndex, udr.wLength);
USB_LOG("****************************");
USB_LOG(strLogString);

if (udr.bmRequestType ==
(USB_REQUEST_CLASS | USB_REQUEST_FOR_INTERFACE |
USB_REQUEST_HOST_TO_DEVICE) ) {
switch(udr.bRequest)
{
case SET_CONTROL_LINE_STATE:
{
/* Host is notifying us of control line state.
* wValue contains bitmask
* 0 - DTR
* 1 - RTS
*/
DEBUGMSG( ZONE_FUNCTION, (TEXT("SET_CONTROL_LINE_STATE %X\r\n"),
udr.wValue));

DWORD dwModemStatus = 0;

if (udr.wValue & USB_COMM_DTR)
dwModemStatus |= (MS_DSR_ON|MS_RLSD_ON); // DTR active, set
DSR/RLSD
if (udr.wValue & USB_COMM_RTS)
dwModemStatus |= MS_CTS_ON; // RTS active, set CTS

memset(strLogString, 0, 256);
sprintf(strLogString, "HandleClassRequest USB_DEVICE_REQUEST
USB_COMM_DTR = 0x%X, USB_COMM_RTS = 0x%X, udr.wValue = %d,
dwModemStatus = 0x%X, MS_CTS_ON = 0x%X",USB_COMM_DTR, USB_COMM_RTS,
udr.wValue, dwModemStatus, MS_CTS_ON);
USB_LOG(strLogString);

ModemSignal(dwModemStatus);
response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
}
break;
case GET_ENCAPSULATED_RESPONSE:
{
USB_LOG("GET_ENCAPSULATED_RESPONSE");
response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
}
break;
case SEND_ENCAPSULATED_COMMAND:
{
USB_LOG("SEND_ENCAPSULATED_COMMAND");
response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
}
break;
case SET_LINE_CODING:
{
USB_LOG("SET_LINE_CODING");
response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
}
break;
case GET_LINE_CODING:
{
USB_LOG("GET_LINE_CODING");
}
break;
case SEND_BREAK:
{
USB_LOG("SEND_BREAK");
response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
}
break;
}
}
else {
RETAILMSG(1, (_T("Unrecognized Serial class bRequest ->
0x%X\r\n"), udr.bmRequestType));
USB_LOG("Unrecognized Serial class bRequest");
ASSERT(FALSE);
}
ASSERT(response == CR_SUCCESS_SEND_CONTROL_HANDSHAKE);
return response;
}

but now one problem is there when I am transmiting some data from
device to Host it follows below functions and does not come out it
hungs somewhere and even at Host end when I am trying to transmite data
from Hyper terminal then it is also not received at device end...
when I call WriteFile()
it follows below functions....
*********************************
USBSerialFn::CancelReceive
USBSerialFn::XmitInterruptHandler
CUsbFuncPipe::WriteData
CUsbFuncPipe::WriteDataOnce
CUsbFuncTransfer::CloseTransfer
CUsbFuncTransfer::IssueTransfer
CUsbFuncPipe::WriteDataOnce
CUsbFuncTransfer::CloseTransfer
***********************************************
all three pipe are also opening properly...

anybody can give some idea to move further with Wirting data....


HimaNshu wrote:
> I appreciate your last suggestion, but I cannot change my platform to
> Win CE 6 or WinCE mobile 5.0 and even I don't have that much time to
> wait for Win CE 6, I know that there is no any other option other then
> waiting for Win CE 6.0 but I want to write my own USB Modem driver for
> usbser.sys support. for that I just want to know what are the basic
> requirements to be implement after establishing connection,
> because I am passing correct descriptor so device is connecting
> properly but at Host end I unable to configure port so my HyperTerminal
> test is not working until I handling mandatory requests from Host side
> to device like,
>
> ET_LINE_CODING
> SEND_ENCAPSULATED_COMMAND
> SET_CONTROL_LINE_STATE
> SEND_BREAK
> GET_LINE_CODING
> GET_ENCAPSULATED_RESPONSE
>
> so would like to know, is there any request handling implemented in
> serial_class code(usbfndrv.cpp or in PDD layer)? if yes then let me
> know where is it exactly?
> and answer is No then please suggest me how I can implement it and
> which are mandatory out of them.
>
>
> David Liao (MS) wrote:
> > Then, you have to figure out the problem by yourself.
> > Otherwise, you have to wait for Windows CE 6.0 if you don't have Windows CE
> > 6.0 beta.
> > David Liao
> > "HimaNshu" <gajjar.himanshu(a)gmail.com> wrote in message
> > news:1157593614.649281.305900(a)i42g2000cwa.googlegroups.com...
> > > Hi David,
> > > I don't have USBser client in my platform I am using normail Windows CE
> > > 5.0 not WinMobile platform 5.0, I think normal Windows CE 5.0 platform
> > > does not including USB Modem driver, there is only three client serial
> > > class for activesync, Mass storage and RNDIS client...but there is no
> > > other client like USBser for USB modem,
> > >
> > > so I have to modify my existing serial class into USB modem client for
> > > USBser.sys support with XP host.
> > >
> > > so I need help to modify my serial class into USB modem class(CDC and
> > > ACM) support if I am on the wrong track then let me know correct path
> > > to get USB modem intercafe in Windows CE 5.0 platform.
> > >
> > > Thanks in advance I am waiting for your reply.
> > >
> > > David Liao (MS) wrote:
> > >> We have tested Windows CE USB Host USBSer driver agains Windows CE USB
> > >> Function USBSer driver. It should work.
> > >> I think you can verify it by using two CEPC, one with USB Host
> > >> Controller(EHCI,OHCI, UHCI) , another with USB Function COntroller
> > >> (NET2280). Select Default USB Function Client By registry as
> > >> "DefaultClientDriver"="USBSER_Class"
> > >>
> > >> It should work in this configuration.
> > >>
> > >> David Liao
> > >>
> > >> "HimaNshu" <gajjar.himanshu(a)gmail.com> wrote in message
> > >> news:1157508012.963190.324380(a)b28g2000cwb.googlegroups.com...
> > >> > Anybody can help to modify my existing
From: HimaNshu on
Thanks, I have successfully implimented USB Modem driver over
serial_class...
Thanks David

HimaNshu wrote:
> I have impliment just cases with this requestes
> SET_LINE_CODING
> SEND_ENCAPSULATED_COMMAND
> SET_CONTROL_LINE_STATE
> SEND_BREAK
> GET_LINE_CODING
> GET_ENCAPSULATED_RESPONSE
>
> It working fine in connection and even comport is opening properly at
> Host end also...it sends SET_LINE_CODING request...
>
> CONTROL_RESPONSE CUsbFn::HandleClassRequest(
> USB_DEVICE_REQUEST udr
> )
> {
> CONTROL_RESPONSE response =
> CR_STALL_DEFAULT_PIPE;//CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
>
> memset(strLogString, 0, 256);
> sprintf(strLogString, "HandleClassRequest USB_DEVICE_REQUEST
> udr.bmReqTyp = 0x%X, udr.bRequest = 0x%X, udr.wValue = %d, udr.wIndex =
> %d, udr.wLength = %d",udr.bmRequestType, udr.bRequest, udr.wValue,
> udr.wIndex, udr.wLength);
> USB_LOG("****************************");
> USB_LOG(strLogString);
>
> if (udr.bmRequestType ==
> (USB_REQUEST_CLASS | USB_REQUEST_FOR_INTERFACE |
> USB_REQUEST_HOST_TO_DEVICE) ) {
> switch(udr.bRequest)
> {
> case SET_CONTROL_LINE_STATE:
> {
> /* Host is notifying us of control line state.
> * wValue contains bitmask
> * 0 - DTR
> * 1 - RTS
> */
> DEBUGMSG( ZONE_FUNCTION, (TEXT("SET_CONTROL_LINE_STATE %X\r\n"),
> udr.wValue));
>
> DWORD dwModemStatus = 0;
>
> if (udr.wValue & USB_COMM_DTR)
> dwModemStatus |= (MS_DSR_ON|MS_RLSD_ON); // DTR active, set
> DSR/RLSD
> if (udr.wValue & USB_COMM_RTS)
> dwModemStatus |= MS_CTS_ON; // RTS active, set CTS
>
> memset(strLogString, 0, 256);
> sprintf(strLogString, "HandleClassRequest USB_DEVICE_REQUEST
> USB_COMM_DTR = 0x%X, USB_COMM_RTS = 0x%X, udr.wValue = %d,
> dwModemStatus = 0x%X, MS_CTS_ON = 0x%X",USB_COMM_DTR, USB_COMM_RTS,
> udr.wValue, dwModemStatus, MS_CTS_ON);
> USB_LOG(strLogString);
>
> ModemSignal(dwModemStatus);
> response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
> }
> break;
> case GET_ENCAPSULATED_RESPONSE:
> {
> USB_LOG("GET_ENCAPSULATED_RESPONSE");
> response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
> }
> break;
> case SEND_ENCAPSULATED_COMMAND:
> {
> USB_LOG("SEND_ENCAPSULATED_COMMAND");
> response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
> }
> break;
> case SET_LINE_CODING:
> {
> USB_LOG("SET_LINE_CODING");
> response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
> }
> break;
> case GET_LINE_CODING:
> {
> USB_LOG("GET_LINE_CODING");
> }
> break;
> case SEND_BREAK:
> {
> USB_LOG("SEND_BREAK");
> response = CR_SUCCESS_SEND_CONTROL_HANDSHAKE;
> }
> break;
> }
> }
> else {
> RETAILMSG(1, (_T("Unrecognized Serial class bRequest ->
> 0x%X\r\n"), udr.bmRequestType));
> USB_LOG("Unrecognized Serial class bRequest");
> ASSERT(FALSE);
> }
> ASSERT(response == CR_SUCCESS_SEND_CONTROL_HANDSHAKE);
> return response;
> }
>
> but now one problem is there when I am transmiting some data from
> device to Host it follows below functions and does not come out it
> hungs somewhere and even at Host end when I am trying to transmite data
> from Hyper terminal then it is also not received at device end...
> when I call WriteFile()
> it follows below functions....
> *********************************
> USBSerialFn::CancelReceive
> USBSerialFn::XmitInterruptHandler
> CUsbFuncPipe::WriteData
> CUsbFuncPipe::WriteDataOnce
> CUsbFuncTransfer::CloseTransfer
> CUsbFuncTransfer::IssueTransfer
> CUsbFuncPipe::WriteDataOnce
> CUsbFuncTransfer::CloseTransfer
> ***********************************************
> all three pipe are also opening properly...
>
> anybody can give some idea to move further with Wirting data....
>
>
> HimaNshu wrote:
> > I appreciate your last suggestion, but I cannot change my platform to
> > Win CE 6 or WinCE mobile 5.0 and even I don't have that much time to
> > wait for Win CE 6, I know that there is no any other option other then
> > waiting for Win CE 6.0 but I want to write my own USB Modem driver for
> > usbser.sys support. for that I just want to know what are the basic
> > requirements to be implement after establishing connection,
> > because I am passing correct descriptor so device is connecting
> > properly but at Host end I unable to configure port so my HyperTerminal
> > test is not working until I handling mandatory requests from Host side
> > to device like,
> >
> > ET_LINE_CODING
> > SEND_ENCAPSULATED_COMMAND
> > SET_CONTROL_LINE_STATE
> > SEND_BREAK
> > GET_LINE_CODING
> > GET_ENCAPSULATED_RESPONSE
> >
> > so would like to know, is there any request handling implemented in
> > serial_class code(usbfndrv.cpp or in PDD layer)? if yes then let me
> > know where is it exactly?
> > and answer is No then please suggest me how I can implement it and
> > which are mandatory out of them.
> >
> >
> > David Liao (MS) wrote:
> > > Then, you have to figure out the problem by yourself.
> > > Otherwise, you have to wait for Windows CE 6.0 if you don't have Windows CE
> > > 6.0 beta.
> > > David Liao
> > > "HimaNshu" <gajjar.himanshu(a)gmail.com> wrote in message
> > > news:1157593614.649281.305900(a)i42g2000cwa.googlegroups.com...
> > > > Hi David,
> > > > I don't have USBser client in my platform I am using normail Windows CE
> > > > 5.0 not WinMobile platform 5.0, I think normal Windows CE 5.0 platform
> > > > does not including USB Modem driver, there is only three client serial
> > > > class for activesync, Mass storage and RNDIS client...but there is no
> > > > other client like USBser for USB modem,
> > > >
> > > > so I have to modify my existing serial class into USB modem client for
> > > > USBser.sys support with XP host.
> > > >
> > > > so I need help to modify my serial class into USB modem class(CDC and
> > > > ACM) support if I am on the wrong track then let me know correct path
> > > > to get USB modem intercafe in Windows CE 5.0 platform.
> > > >
> > > > Thanks in advance I am waiting for your reply.
> > > >
> > > > David Liao (MS) wrote:
> > > >> We have tested Windows CE USB Host USBSer driver agains Windows CE USB
> > > >> Function USBSer driver. It should work.
> > > >> I think you can verify it by using two CEPC, one with USB Host
> > > >>