HTTPClient using static IP

Dependencies:   mbed

Committer:
mr_q
Date:
Mon May 30 11:53:37 2011 +0000
Revision:
0:d8f2f7d5f31b
v0.01 Draft

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mr_q 0:d8f2f7d5f31b 1
mr_q 0:d8f2f7d5f31b 2 /*
mr_q 0:d8f2f7d5f31b 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
mr_q 0:d8f2f7d5f31b 4
mr_q 0:d8f2f7d5f31b 5 Permission is hereby granted, free of charge, to any person obtaining a copy
mr_q 0:d8f2f7d5f31b 6 of this software and associated documentation files (the "Software"), to deal
mr_q 0:d8f2f7d5f31b 7 in the Software without restriction, including without limitation the rights
mr_q 0:d8f2f7d5f31b 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
mr_q 0:d8f2f7d5f31b 9 copies of the Software, and to permit persons to whom the Software is
mr_q 0:d8f2f7d5f31b 10 furnished to do so, subject to the following conditions:
mr_q 0:d8f2f7d5f31b 11
mr_q 0:d8f2f7d5f31b 12 The above copyright notice and this permission notice shall be included in
mr_q 0:d8f2f7d5f31b 13 all copies or substantial portions of the Software.
mr_q 0:d8f2f7d5f31b 14
mr_q 0:d8f2f7d5f31b 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
mr_q 0:d8f2f7d5f31b 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
mr_q 0:d8f2f7d5f31b 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
mr_q 0:d8f2f7d5f31b 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
mr_q 0:d8f2f7d5f31b 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
mr_q 0:d8f2f7d5f31b 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
mr_q 0:d8f2f7d5f31b 21 THE SOFTWARE.
mr_q 0:d8f2f7d5f31b 22 */
mr_q 0:d8f2f7d5f31b 23
mr_q 0:d8f2f7d5f31b 24 #include "netCfg.h"
mr_q 0:d8f2f7d5f31b 25 #if NET_UMTS
mr_q 0:d8f2f7d5f31b 26
mr_q 0:d8f2f7d5f31b 27 #include "UMTSStick.h"
mr_q 0:d8f2f7d5f31b 28
mr_q 0:d8f2f7d5f31b 29 #define __DEBUG
mr_q 0:d8f2f7d5f31b 30 #include "dbg/dbg.h"
mr_q 0:d8f2f7d5f31b 31
mr_q 0:d8f2f7d5f31b 32 UMTSStick::UMTSStick() : m_host(), m_pDev(NULL)
mr_q 0:d8f2f7d5f31b 33 {
mr_q 0:d8f2f7d5f31b 34
mr_q 0:d8f2f7d5f31b 35 }
mr_q 0:d8f2f7d5f31b 36
mr_q 0:d8f2f7d5f31b 37 UMTSStick::~UMTSStick()
mr_q 0:d8f2f7d5f31b 38 {
mr_q 0:d8f2f7d5f31b 39
mr_q 0:d8f2f7d5f31b 40 }
mr_q 0:d8f2f7d5f31b 41
mr_q 0:d8f2f7d5f31b 42
mr_q 0:d8f2f7d5f31b 43 UMTSStickErr UMTSStick::getSerial(UsbSerial** ppUsbSerial)
mr_q 0:d8f2f7d5f31b 44 {
mr_q 0:d8f2f7d5f31b 45 m_host.init();
mr_q 0:d8f2f7d5f31b 46
mr_q 0:d8f2f7d5f31b 47 UMTSStickErr rc;
mr_q 0:d8f2f7d5f31b 48
mr_q 0:d8f2f7d5f31b 49 rc = waitForDevice();
mr_q 0:d8f2f7d5f31b 50 if(rc)
mr_q 0:d8f2f7d5f31b 51 return rc;
mr_q 0:d8f2f7d5f31b 52
mr_q 0:d8f2f7d5f31b 53 //Device is now enumerated, read table
mr_q 0:d8f2f7d5f31b 54
mr_q 0:d8f2f7d5f31b 55 uint16_t vid = m_pDev->getVid();
mr_q 0:d8f2f7d5f31b 56 uint16_t pid = m_pDev->getPid();
mr_q 0:d8f2f7d5f31b 57
mr_q 0:d8f2f7d5f31b 58 DBG("Configuration set: vid:%04x pid:%04x\n", vid, pid);
mr_q 0:d8f2f7d5f31b 59
mr_q 0:d8f2f7d5f31b 60 bool handled = false;
mr_q 0:d8f2f7d5f31b 61 bool cdfs = false;
mr_q 0:d8f2f7d5f31b 62 const UMTSSwitchingInfo* pInfo;
mr_q 0:d8f2f7d5f31b 63 for(int i = 0; i < UMTS_SWITCHING_COUNT; i++)
mr_q 0:d8f2f7d5f31b 64 {
mr_q 0:d8f2f7d5f31b 65 pInfo = &UMTSwitchingTable[i];
mr_q 0:d8f2f7d5f31b 66 if( !checkDeviceState(pInfo, &cdfs) )
mr_q 0:d8f2f7d5f31b 67 {
mr_q 0:d8f2f7d5f31b 68 handled = true;
mr_q 0:d8f2f7d5f31b 69 break;
mr_q 0:d8f2f7d5f31b 70 }
mr_q 0:d8f2f7d5f31b 71
mr_q 0:d8f2f7d5f31b 72 } //for(int i = 0; i < UMTS_SWITCHING_COUNT; i++)
mr_q 0:d8f2f7d5f31b 73
mr_q 0:d8f2f7d5f31b 74 if(!handled)
mr_q 0:d8f2f7d5f31b 75 {
mr_q 0:d8f2f7d5f31b 76 DBG("Don't know this device!\n");
mr_q 0:d8f2f7d5f31b 77 return UMTSERR_NOTIMPLEMENTED;
mr_q 0:d8f2f7d5f31b 78 }
mr_q 0:d8f2f7d5f31b 79
mr_q 0:d8f2f7d5f31b 80 //Check if the device is in CDFS mode, in this case switch
mr_q 0:d8f2f7d5f31b 81 if(cdfs)
mr_q 0:d8f2f7d5f31b 82 {
mr_q 0:d8f2f7d5f31b 83 DBG("Switching the device by sending a magic packet\n");
mr_q 0:d8f2f7d5f31b 84
mr_q 0:d8f2f7d5f31b 85 rc = switchMode(pInfo);
mr_q 0:d8f2f7d5f31b 86 if(rc)
mr_q 0:d8f2f7d5f31b 87 return rc;
mr_q 0:d8f2f7d5f31b 88
mr_q 0:d8f2f7d5f31b 89 DBG("Now wait for device to reconnect\n");
mr_q 0:d8f2f7d5f31b 90
mr_q 0:d8f2f7d5f31b 91 m_host.releaseDevice(m_pDev);
mr_q 0:d8f2f7d5f31b 92
mr_q 0:d8f2f7d5f31b 93 //Wait for device to reconnect
mr_q 0:d8f2f7d5f31b 94 wait(3);
mr_q 0:d8f2f7d5f31b 95 rc = waitForDevice();
mr_q 0:d8f2f7d5f31b 96 if(rc)
mr_q 0:d8f2f7d5f31b 97 return rc;
mr_q 0:d8f2f7d5f31b 98 }
mr_q 0:d8f2f7d5f31b 99
mr_q 0:d8f2f7d5f31b 100 rc = findSerial(ppUsbSerial);
mr_q 0:d8f2f7d5f31b 101 if(rc)
mr_q 0:d8f2f7d5f31b 102 return rc;
mr_q 0:d8f2f7d5f31b 103
mr_q 0:d8f2f7d5f31b 104 return UMTSERR_OK;
mr_q 0:d8f2f7d5f31b 105 }
mr_q 0:d8f2f7d5f31b 106
mr_q 0:d8f2f7d5f31b 107 UMTSStickErr UMTSStick::waitForDevice()
mr_q 0:d8f2f7d5f31b 108 {
mr_q 0:d8f2f7d5f31b 109 bool ready = false;
mr_q 0:d8f2f7d5f31b 110 while(!ready)
mr_q 0:d8f2f7d5f31b 111 {
mr_q 0:d8f2f7d5f31b 112 while(!m_host.devicesCount())
mr_q 0:d8f2f7d5f31b 113 {}
mr_q 0:d8f2f7d5f31b 114 wait(1);
mr_q 0:d8f2f7d5f31b 115 if(m_host.devicesCount())
mr_q 0:d8f2f7d5f31b 116 ready = true;
mr_q 0:d8f2f7d5f31b 117 }
mr_q 0:d8f2f7d5f31b 118
mr_q 0:d8f2f7d5f31b 119 wait(2); //Wait for device to be initialized
mr_q 0:d8f2f7d5f31b 120
mr_q 0:d8f2f7d5f31b 121 if(!m_host.devicesCount())
mr_q 0:d8f2f7d5f31b 122 return UMTSERR_DISCONNECTED;
mr_q 0:d8f2f7d5f31b 123
mr_q 0:d8f2f7d5f31b 124 m_pDev = m_host.getDevice(0);
mr_q 0:d8f2f7d5f31b 125
mr_q 0:d8f2f7d5f31b 126 while(!m_pDev->enumerated())
mr_q 0:d8f2f7d5f31b 127 {
mr_q 0:d8f2f7d5f31b 128 m_host.poll();
mr_q 0:d8f2f7d5f31b 129 if(!m_host.devicesCount())
mr_q 0:d8f2f7d5f31b 130 return UMTSERR_DISCONNECTED;
mr_q 0:d8f2f7d5f31b 131 }
mr_q 0:d8f2f7d5f31b 132
mr_q 0:d8f2f7d5f31b 133 return UMTSERR_OK;
mr_q 0:d8f2f7d5f31b 134 }
mr_q 0:d8f2f7d5f31b 135
mr_q 0:d8f2f7d5f31b 136 UMTSStickErr UMTSStick::checkDeviceState(const UMTSSwitchingInfo* pInfo, bool* pCdfs)
mr_q 0:d8f2f7d5f31b 137 {
mr_q 0:d8f2f7d5f31b 138 uint16_t vid = m_pDev->getVid();
mr_q 0:d8f2f7d5f31b 139 uint16_t pid = m_pDev->getPid();
mr_q 0:d8f2f7d5f31b 140 bool handled = false;
mr_q 0:d8f2f7d5f31b 141 if( (vid == pInfo->cdfsVid) && (pid == pInfo->cdfsPid) )
mr_q 0:d8f2f7d5f31b 142 {
mr_q 0:d8f2f7d5f31b 143 DBG("Match on dongles list\n");
mr_q 0:d8f2f7d5f31b 144 if( !pInfo->targetClass ) //No specific interface to check, vid/pid couple is specific to CDFS mode
mr_q 0:d8f2f7d5f31b 145 {
mr_q 0:d8f2f7d5f31b 146 DBG("Found device in CDFS mode\n");
mr_q 0:d8f2f7d5f31b 147 handled = true;
mr_q 0:d8f2f7d5f31b 148 *pCdfs = true;
mr_q 0:d8f2f7d5f31b 149 }
mr_q 0:d8f2f7d5f31b 150 else //if( !pInfo->targetClass )
mr_q 0:d8f2f7d5f31b 151 {
mr_q 0:d8f2f7d5f31b 152 //Has to check if there is an interface of class targetClass
mr_q 0:d8f2f7d5f31b 153 byte* desc = NULL;
mr_q 0:d8f2f7d5f31b 154 int c = 0;
mr_q 0:d8f2f7d5f31b 155
mr_q 0:d8f2f7d5f31b 156 while( !m_pDev->getInterfaceDescriptor(1, c++, &desc) )
mr_q 0:d8f2f7d5f31b 157 {
mr_q 0:d8f2f7d5f31b 158 if( desc[5] == pInfo->targetClass )
mr_q 0:d8f2f7d5f31b 159 {
mr_q 0:d8f2f7d5f31b 160 DBG("Found device in Serial mode\n");
mr_q 0:d8f2f7d5f31b 161 handled = true;
mr_q 0:d8f2f7d5f31b 162 *pCdfs = false;
mr_q 0:d8f2f7d5f31b 163 break;
mr_q 0:d8f2f7d5f31b 164 }
mr_q 0:d8f2f7d5f31b 165 }
mr_q 0:d8f2f7d5f31b 166
mr_q 0:d8f2f7d5f31b 167 if(!handled)
mr_q 0:d8f2f7d5f31b 168 {
mr_q 0:d8f2f7d5f31b 169 //All interfaces were tried, so we are in CDFS mode
mr_q 0:d8f2f7d5f31b 170 DBG("Found device in CDFS mode\n");
mr_q 0:d8f2f7d5f31b 171 handled = true;
mr_q 0:d8f2f7d5f31b 172 *pCdfs = true;
mr_q 0:d8f2f7d5f31b 173 }
mr_q 0:d8f2f7d5f31b 174 } //if( !pInfo->targetClass )
mr_q 0:d8f2f7d5f31b 175 } //if( (vid == pInfo->cdfsVid) && (pid == pInfo->cdfsPid) )
mr_q 0:d8f2f7d5f31b 176 else
mr_q 0:d8f2f7d5f31b 177 {
mr_q 0:d8f2f7d5f31b 178 //Try every vid/pid couple of the serial list
mr_q 0:d8f2f7d5f31b 179 for( int i = 0; i < 16 ; i++)
mr_q 0:d8f2f7d5f31b 180 {
mr_q 0:d8f2f7d5f31b 181 if(!pInfo->serialPidList[i])
mr_q 0:d8f2f7d5f31b 182 break;
mr_q 0:d8f2f7d5f31b 183 if( (pInfo->serialVid == vid) && (pInfo->serialPidList[i] == pid) )
mr_q 0:d8f2f7d5f31b 184 {
mr_q 0:d8f2f7d5f31b 185 DBG("Found device in Serial mode\n");
mr_q 0:d8f2f7d5f31b 186 handled = true;
mr_q 0:d8f2f7d5f31b 187 *pCdfs = false;
mr_q 0:d8f2f7d5f31b 188 break;
mr_q 0:d8f2f7d5f31b 189 }
mr_q 0:d8f2f7d5f31b 190 }
mr_q 0:d8f2f7d5f31b 191 } //if( (vid == pInfo->cdfsVid) && (pid == pInfo->cdfsPid) )
mr_q 0:d8f2f7d5f31b 192
mr_q 0:d8f2f7d5f31b 193 if(!handled)
mr_q 0:d8f2f7d5f31b 194 return UMTSERR_NOTFOUND;
mr_q 0:d8f2f7d5f31b 195
mr_q 0:d8f2f7d5f31b 196 return UMTSERR_OK;
mr_q 0:d8f2f7d5f31b 197 }
mr_q 0:d8f2f7d5f31b 198
mr_q 0:d8f2f7d5f31b 199 UMTSStickErr UMTSStick::switchMode(const UMTSSwitchingInfo* pInfo)
mr_q 0:d8f2f7d5f31b 200 {
mr_q 0:d8f2f7d5f31b 201 if(!pInfo->huaweiPacket) //Send SCSI packet on first bulk ep
mr_q 0:d8f2f7d5f31b 202 {
mr_q 0:d8f2f7d5f31b 203 //Find first bulk ep
mr_q 0:d8f2f7d5f31b 204 byte* desc = NULL;
mr_q 0:d8f2f7d5f31b 205 int c = 0;
mr_q 0:d8f2f7d5f31b 206
mr_q 0:d8f2f7d5f31b 207 UsbEndpoint *pEpOut = NULL;
mr_q 0:d8f2f7d5f31b 208
mr_q 0:d8f2f7d5f31b 209 while( !m_pDev->getInterfaceDescriptor(1, c++, &desc) )
mr_q 0:d8f2f7d5f31b 210 {
mr_q 0:d8f2f7d5f31b 211 byte* p = desc;
mr_q 0:d8f2f7d5f31b 212 int epNum = 0;
mr_q 0:d8f2f7d5f31b 213 p = p + p[0]; //Move to next descriptor (which should be an ep descriptor)
mr_q 0:d8f2f7d5f31b 214 while (epNum < desc[4]) //Eps count in this if
mr_q 0:d8f2f7d5f31b 215 {
mr_q 0:d8f2f7d5f31b 216 if (p[1] != USB_DESCRIPTOR_TYPE_ENDPOINT)
mr_q 0:d8f2f7d5f31b 217 break;
mr_q 0:d8f2f7d5f31b 218
mr_q 0:d8f2f7d5f31b 219 if( (p[3] == 0x02) && !(p[2] & 0x80) ) //Bulk endpoint, out
mr_q 0:d8f2f7d5f31b 220 {
mr_q 0:d8f2f7d5f31b 221 DBG("Found bulk ep %02x\n", p[2]);
mr_q 0:d8f2f7d5f31b 222 pEpOut = new UsbEndpoint( m_pDev, p[2], false, USB_BULK, *((uint16_t*)&p[4]) );
mr_q 0:d8f2f7d5f31b 223 break;
mr_q 0:d8f2f7d5f31b 224 }
mr_q 0:d8f2f7d5f31b 225
mr_q 0:d8f2f7d5f31b 226 p = p + p[0]; //Move to next ep desc
mr_q 0:d8f2f7d5f31b 227 epNum++;
mr_q 0:d8f2f7d5f31b 228 }
mr_q 0:d8f2f7d5f31b 229 if(pEpOut)
mr_q 0:d8f2f7d5f31b 230 break;
mr_q 0:d8f2f7d5f31b 231 }
mr_q 0:d8f2f7d5f31b 232
mr_q 0:d8f2f7d5f31b 233 if(!pEpOut)
mr_q 0:d8f2f7d5f31b 234 return UMTSERR_NOTFOUND;
mr_q 0:d8f2f7d5f31b 235
mr_q 0:d8f2f7d5f31b 236 //Send SCSI packet
mr_q 0:d8f2f7d5f31b 237
mr_q 0:d8f2f7d5f31b 238 DBG("Sending SCSI Packet to switch\n");
mr_q 0:d8f2f7d5f31b 239 byte ramCdfsBuf[31];
mr_q 0:d8f2f7d5f31b 240 memcpy(ramCdfsBuf, pInfo->cdfsPacket, 31);
mr_q 0:d8f2f7d5f31b 241 pEpOut->transfer((volatile byte*)ramCdfsBuf, 31);
mr_q 0:d8f2f7d5f31b 242 while(pEpOut->status() == USBERR_PROCESSING);
mr_q 0:d8f2f7d5f31b 243 int ret = pEpOut->status();
mr_q 0:d8f2f7d5f31b 244 if((ret < 0) && (ret !=USBERR_DISCONNECTED)) //Packet was not transfered
mr_q 0:d8f2f7d5f31b 245 {
mr_q 0:d8f2f7d5f31b 246 DBG("Usb error %d\n", ret);
mr_q 0:d8f2f7d5f31b 247 delete pEpOut;
mr_q 0:d8f2f7d5f31b 248 return UMTSERR_USBERR;
mr_q 0:d8f2f7d5f31b 249 }
mr_q 0:d8f2f7d5f31b 250
mr_q 0:d8f2f7d5f31b 251 delete pEpOut;
mr_q 0:d8f2f7d5f31b 252 }
mr_q 0:d8f2f7d5f31b 253 else
mr_q 0:d8f2f7d5f31b 254 {
mr_q 0:d8f2f7d5f31b 255 UsbErr usbErr;
mr_q 0:d8f2f7d5f31b 256 //Send the Huawei-specific control packet
mr_q 0:d8f2f7d5f31b 257 usbErr = m_pDev->controlSend(0, 0x03, 1, 0, NULL, 0);
mr_q 0:d8f2f7d5f31b 258 if(usbErr && (usbErr != USBERR_DISCONNECTED))
mr_q 0:d8f2f7d5f31b 259 return UMTSERR_USBERR;
mr_q 0:d8f2f7d5f31b 260 }
mr_q 0:d8f2f7d5f31b 261
mr_q 0:d8f2f7d5f31b 262 DBG("The stick should be switching in serial mode now\n");
mr_q 0:d8f2f7d5f31b 263
mr_q 0:d8f2f7d5f31b 264 return UMTSERR_OK;
mr_q 0:d8f2f7d5f31b 265 }
mr_q 0:d8f2f7d5f31b 266
mr_q 0:d8f2f7d5f31b 267 UMTSStickErr UMTSStick::findSerial(UsbSerial** ppUsbSerial)
mr_q 0:d8f2f7d5f31b 268 {
mr_q 0:d8f2f7d5f31b 269 byte* desc = NULL;
mr_q 0:d8f2f7d5f31b 270 int c = 0;
mr_q 0:d8f2f7d5f31b 271
mr_q 0:d8f2f7d5f31b 272 int epOut = 0;
mr_q 0:d8f2f7d5f31b 273 int epIn = 0;
mr_q 0:d8f2f7d5f31b 274
mr_q 0:d8f2f7d5f31b 275 while( !m_pDev->getInterfaceDescriptor(1, c++, &desc) )
mr_q 0:d8f2f7d5f31b 276 {
mr_q 0:d8f2f7d5f31b 277 byte* p = desc;
mr_q 0:d8f2f7d5f31b 278 int epNum = 0;
mr_q 0:d8f2f7d5f31b 279
mr_q 0:d8f2f7d5f31b 280 DBG("Interface of type %02x\n", desc[5]);
mr_q 0:d8f2f7d5f31b 281
mr_q 0:d8f2f7d5f31b 282 if(desc[5] != 0xFF) //Not a serial-like if
mr_q 0:d8f2f7d5f31b 283 continue;
mr_q 0:d8f2f7d5f31b 284
mr_q 0:d8f2f7d5f31b 285 p = p + p[0]; //Move to next descriptor (which should be an ep descriptor)
mr_q 0:d8f2f7d5f31b 286 while (epNum < desc[4]) //Eps count in this if
mr_q 0:d8f2f7d5f31b 287 {
mr_q 0:d8f2f7d5f31b 288 if (p[1] == USB_DESCRIPTOR_TYPE_ENDPOINT)
mr_q 0:d8f2f7d5f31b 289 {
mr_q 0:d8f2f7d5f31b 290 if( (p[3] == 0x02) && !(p[2] & 0x80) && !epOut ) //Bulk endpoint, out
mr_q 0:d8f2f7d5f31b 291 {
mr_q 0:d8f2f7d5f31b 292 DBG("Found bulk out ep %02x of payload size %04x\n", p[2], *((uint16_t*)&p[4]));
mr_q 0:d8f2f7d5f31b 293 epOut = p[2] & 0x7F;
mr_q 0:d8f2f7d5f31b 294 }
mr_q 0:d8f2f7d5f31b 295
mr_q 0:d8f2f7d5f31b 296 if( (p[3] == 0x02) && (p[2] & 0x80) && !epIn ) //Bulk endpoint, in
mr_q 0:d8f2f7d5f31b 297 {
mr_q 0:d8f2f7d5f31b 298 DBG("Found bulk in ep %02x of payload size %04x\n", p[2], *((uint16_t*)&p[4]));
mr_q 0:d8f2f7d5f31b 299 epIn = p[2] & 0x7F;
mr_q 0:d8f2f7d5f31b 300 }
mr_q 0:d8f2f7d5f31b 301
mr_q 0:d8f2f7d5f31b 302 if(epOut && epIn)
mr_q 0:d8f2f7d5f31b 303 break;
mr_q 0:d8f2f7d5f31b 304 }
mr_q 0:d8f2f7d5f31b 305
mr_q 0:d8f2f7d5f31b 306 p = p + p[0]; //Move to next ep desc
mr_q 0:d8f2f7d5f31b 307 epNum++;
mr_q 0:d8f2f7d5f31b 308 }
mr_q 0:d8f2f7d5f31b 309
mr_q 0:d8f2f7d5f31b 310 if(epOut && epIn)
mr_q 0:d8f2f7d5f31b 311 break;
mr_q 0:d8f2f7d5f31b 312 }
mr_q 0:d8f2f7d5f31b 313
mr_q 0:d8f2f7d5f31b 314 if(!epOut || !epIn)
mr_q 0:d8f2f7d5f31b 315 return UMTSERR_NOTFOUND;
mr_q 0:d8f2f7d5f31b 316
mr_q 0:d8f2f7d5f31b 317 DBG("Endpoints found, create serial object\n");
mr_q 0:d8f2f7d5f31b 318
mr_q 0:d8f2f7d5f31b 319 *ppUsbSerial = new UsbSerial(m_pDev, epIn, epOut);
mr_q 0:d8f2f7d5f31b 320
mr_q 0:d8f2f7d5f31b 321 DBG("UsbSerial object created\n");
mr_q 0:d8f2f7d5f31b 322
mr_q 0:d8f2f7d5f31b 323 return UMTSERR_OK;
mr_q 0:d8f2f7d5f31b 324 }
mr_q 0:d8f2f7d5f31b 325
mr_q 0:d8f2f7d5f31b 326 #endif