mirror of https://github.com/ARMmbed/mbed-os.git
Removed references to specific initializers from the code
parent
ae2e7c3051
commit
a4da762016
|
@ -130,7 +130,7 @@ bool WANDongle::disconnect()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
WAN_DONGLE_TYPE WANDongle::getDongleType()
|
int WANDongle::getDongleType()
|
||||||
{
|
{
|
||||||
if( m_pInitializer != NULL )
|
if( m_pInitializer != NULL )
|
||||||
{
|
{
|
||||||
|
@ -221,7 +221,7 @@ void WANDongle::init()
|
||||||
|
|
||||||
bool WANDongle::addInitializer(WANDongleInitializer* pInitializer)
|
bool WANDongle::addInitializer(WANDongleInitializer* pInitializer)
|
||||||
{
|
{
|
||||||
if (m_totalInitializers >= MAX_DEVICE_CONNECTED)
|
if (m_totalInitializers >= WANDONGLE_MAX_INITIALIZERS)
|
||||||
return false;
|
return false;
|
||||||
m_Initializers[m_totalInitializers++] = pInitializer;
|
m_Initializers[m_totalInitializers++] = pInitializer;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
*/
|
*/
|
||||||
bool disconnect();
|
bool disconnect();
|
||||||
|
|
||||||
WAN_DONGLE_TYPE getDongleType();
|
int getDongleType();
|
||||||
|
|
||||||
IUSBHostSerial& getSerial(int index);
|
IUSBHostSerial& getSerial(int index);
|
||||||
int getSerialCount();
|
int getSerialCount();
|
||||||
|
@ -100,7 +100,7 @@ protected:
|
||||||
int m_serialCount;
|
int m_serialCount;
|
||||||
|
|
||||||
int m_totalInitializers;
|
int m_totalInitializers;
|
||||||
WANDongleInitializer* m_Initializers[MAX_DEVICE_CONNECTED];
|
WANDongleInitializer* m_Initializers[WANDONGLE_MAX_INITIALIZERS];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* USBHOST_3GMODULE */
|
#endif /* USBHOST_3GMODULE */
|
||||||
|
|
|
@ -30,20 +30,16 @@ using std::uint32_t;
|
||||||
#include "USBHost.h"
|
#include "USBHost.h"
|
||||||
#include "IUSBEnumerator.h"
|
#include "IUSBEnumerator.h"
|
||||||
|
|
||||||
enum WAN_DONGLE_TYPE
|
// [TODO] move these declarations to a proper place
|
||||||
{
|
|
||||||
WAN_DONGLE_TYPE_UNKNOWN = -1,
|
|
||||||
WAN_DONGLE_TYPE_VODAFONEK3770 = 0,
|
|
||||||
WAN_DONGLE_TYPE_VODAFONEK3772Z = 1,
|
|
||||||
WAN_DONGLE_TYPE_UBX = 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
#define WANDONGLE_MAX_SERIAL_PORTS 2
|
#define WANDONGLE_MAX_SERIAL_PORTS 2
|
||||||
|
#define WANDONGLE_MAX_INITIALIZERS 6
|
||||||
|
|
||||||
|
#define WAN_DONGLE_TYPE_UNKNOWN (-1)
|
||||||
|
|
||||||
class WANDongleInitializer : public IUSBEnumerator
|
class WANDongleInitializer : public IUSBEnumerator
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
WANDongleInitializer(USBHost* pHost);
|
WANDongleInitializer(USBHost* pHost) { m_pHost = pHost; }
|
||||||
USBHost* m_pHost;
|
USBHost* m_pHost;
|
||||||
uint8_t m_serialIntfMap[WANDONGLE_MAX_SERIAL_PORTS];
|
uint8_t m_serialIntfMap[WANDONGLE_MAX_SERIAL_PORTS];
|
||||||
|
|
||||||
|
@ -68,109 +64,9 @@ public:
|
||||||
|
|
||||||
virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir) = 0; //Must return true if the endpoint will be used
|
virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir) = 0; //Must return true if the endpoint will be used
|
||||||
|
|
||||||
virtual WAN_DONGLE_TYPE getType() = 0;
|
virtual int getType() = 0;
|
||||||
|
|
||||||
virtual uint8_t getSerialIntf(int index) { return m_serialIntfMap[index]; }
|
virtual uint8_t getSerialIntf(int index) { return m_serialIntfMap[index]; }
|
||||||
|
|
||||||
static WANDongleInitializer** getInitializers(USBHost* pHost);
|
|
||||||
};
|
|
||||||
|
|
||||||
class VodafoneK3770Initializer : public WANDongleInitializer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
VodafoneK3770Initializer(USBHost* pHost);
|
|
||||||
|
|
||||||
virtual uint16_t getMSDVid();
|
|
||||||
virtual uint16_t getMSDPid();
|
|
||||||
|
|
||||||
virtual uint16_t getSerialVid();
|
|
||||||
virtual uint16_t getSerialPid();
|
|
||||||
|
|
||||||
virtual bool switchMode(USBDeviceConnected* pDev);
|
|
||||||
|
|
||||||
virtual USBEndpoint* getEp(USBDeviceConnected* pDev, int serialPortNumber, bool tx);
|
|
||||||
|
|
||||||
virtual int getSerialPortCount();
|
|
||||||
|
|
||||||
virtual void setVidPid(uint16_t vid, uint16_t pid);
|
|
||||||
|
|
||||||
virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol); //Must return true if the interface should be parsed
|
|
||||||
|
|
||||||
virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir); //Must return true if the endpoint will be used
|
|
||||||
|
|
||||||
virtual WAN_DONGLE_TYPE getType();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool m_hasSwitched;
|
|
||||||
int m_currentSerialIntf;
|
|
||||||
int m_endpointsToFetch;
|
|
||||||
};
|
|
||||||
|
|
||||||
class VodafoneK3772ZInitializer : public WANDongleInitializer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
VodafoneK3772ZInitializer(USBHost* pHost);
|
|
||||||
|
|
||||||
virtual uint16_t getMSDVid();
|
|
||||||
virtual uint16_t getMSDPid();
|
|
||||||
|
|
||||||
virtual uint16_t getSerialVid();
|
|
||||||
virtual uint16_t getSerialPid();
|
|
||||||
|
|
||||||
virtual bool switchMode(USBDeviceConnected* pDev);
|
|
||||||
|
|
||||||
virtual USBEndpoint* getEp(USBDeviceConnected* pDev, int serialPortNumber, bool tx);
|
|
||||||
|
|
||||||
virtual int getSerialPortCount();
|
|
||||||
|
|
||||||
virtual void setVidPid(uint16_t vid, uint16_t pid);
|
|
||||||
|
|
||||||
virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol); //Must return true if the interface should be parsed
|
|
||||||
|
|
||||||
virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir); //Must return true if the endpoint will be used
|
|
||||||
|
|
||||||
virtual WAN_DONGLE_TYPE getType();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool m_hasSwitched;
|
|
||||||
int m_currentSerialIntf;
|
|
||||||
int m_endpointsToFetch;
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
// mamm, u-blox Modem
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
|
|
||||||
class UbxInitializer : public WANDongleInitializer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
UbxInitializer(USBHost* pHost);
|
|
||||||
|
|
||||||
virtual uint16_t getMSDVid();
|
|
||||||
virtual uint16_t getMSDPid();
|
|
||||||
|
|
||||||
virtual uint16_t getSerialVid();
|
|
||||||
virtual uint16_t getSerialPid();
|
|
||||||
|
|
||||||
virtual bool switchMode(USBDeviceConnected* pDev);
|
|
||||||
|
|
||||||
virtual int getSerialPortCount();
|
|
||||||
|
|
||||||
virtual void setVidPid(uint16_t vid, uint16_t pid);
|
|
||||||
|
|
||||||
virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol); //Must return true if the interface should be parsed
|
|
||||||
|
|
||||||
virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir); //Must return true if the endpoint will be used
|
|
||||||
|
|
||||||
virtual WAN_DONGLE_TYPE getType();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool m_hasSwitched;
|
|
||||||
int m_currentSerialIntf;
|
|
||||||
int m_endpointsToFetch;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* USBHOST_3GMODULE */
|
#endif /* USBHOST_3GMODULE */
|
||||||
|
|
Loading…
Reference in New Issue