Bmag incl gps rettelse

Dependencies:   mbed WDT MODSERIAL BME280

Committer:
gert_lauritsen
Date:
Fri Jul 05 12:55:53 2019 +0000
Branch:
MbedBMAGThrRev
Revision:
61:52a6d0ffd8e5
dato rettel og ID i file lagt ind i version 5

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gert_lauritsen 61:52a6d0ffd8e5 1 /* Copyright (c) 2010-2012 mbed.org, MIT License
gert_lauritsen 61:52a6d0ffd8e5 2 *
gert_lauritsen 61:52a6d0ffd8e5 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
gert_lauritsen 61:52a6d0ffd8e5 4 * and associated documentation files (the "Software"), to deal in the Software without
gert_lauritsen 61:52a6d0ffd8e5 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
gert_lauritsen 61:52a6d0ffd8e5 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
gert_lauritsen 61:52a6d0ffd8e5 7 * Software is furnished to do so, subject to the following conditions:
gert_lauritsen 61:52a6d0ffd8e5 8 *
gert_lauritsen 61:52a6d0ffd8e5 9 * The above copyright notice and this permission notice shall be included in all copies or
gert_lauritsen 61:52a6d0ffd8e5 10 * substantial portions of the Software.
gert_lauritsen 61:52a6d0ffd8e5 11 *
gert_lauritsen 61:52a6d0ffd8e5 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
gert_lauritsen 61:52a6d0ffd8e5 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
gert_lauritsen 61:52a6d0ffd8e5 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
gert_lauritsen 61:52a6d0ffd8e5 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
gert_lauritsen 61:52a6d0ffd8e5 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
gert_lauritsen 61:52a6d0ffd8e5 17 */
gert_lauritsen 61:52a6d0ffd8e5 18
gert_lauritsen 61:52a6d0ffd8e5 19 #ifndef WANDONGLEINITIALIZER_H
gert_lauritsen 61:52a6d0ffd8e5 20 #define WANDONGLEINITIALIZER_H
gert_lauritsen 61:52a6d0ffd8e5 21
gert_lauritsen 61:52a6d0ffd8e5 22 #include "USBHostConf.h"
gert_lauritsen 61:52a6d0ffd8e5 23
gert_lauritsen 61:52a6d0ffd8e5 24 #ifdef USBHOST_3GMODULE
gert_lauritsen 61:52a6d0ffd8e5 25
gert_lauritsen 61:52a6d0ffd8e5 26 #include <stdint.h>
gert_lauritsen 61:52a6d0ffd8e5 27
gert_lauritsen 61:52a6d0ffd8e5 28 #include "USBHost.h"
gert_lauritsen 61:52a6d0ffd8e5 29 #include "IUSBEnumerator.h"
gert_lauritsen 61:52a6d0ffd8e5 30
gert_lauritsen 61:52a6d0ffd8e5 31 // [TODO] move these declarations to a proper place
gert_lauritsen 61:52a6d0ffd8e5 32 #define WANDONGLE_MAX_SERIAL_PORTS 2
gert_lauritsen 61:52a6d0ffd8e5 33 #define WANDONGLE_MAX_INITIALIZERS 6
gert_lauritsen 61:52a6d0ffd8e5 34
gert_lauritsen 61:52a6d0ffd8e5 35 #define WAN_DONGLE_TYPE_UNKNOWN (-1)
gert_lauritsen 61:52a6d0ffd8e5 36
gert_lauritsen 61:52a6d0ffd8e5 37 class WANDongleInitializer : public IUSBEnumerator
gert_lauritsen 61:52a6d0ffd8e5 38 {
gert_lauritsen 61:52a6d0ffd8e5 39 protected:
gert_lauritsen 61:52a6d0ffd8e5 40 WANDongleInitializer(USBHost* pHost) { m_pHost = pHost; }
gert_lauritsen 61:52a6d0ffd8e5 41 USBHost* m_pHost;
gert_lauritsen 61:52a6d0ffd8e5 42 uint8_t m_serialIntfMap[WANDONGLE_MAX_SERIAL_PORTS];
gert_lauritsen 61:52a6d0ffd8e5 43
gert_lauritsen 61:52a6d0ffd8e5 44 public:
gert_lauritsen 61:52a6d0ffd8e5 45 virtual ~WANDongleInitializer() {}
gert_lauritsen 61:52a6d0ffd8e5 46 virtual uint16_t getMSDVid() = 0;
gert_lauritsen 61:52a6d0ffd8e5 47 virtual uint16_t getMSDPid() = 0;
gert_lauritsen 61:52a6d0ffd8e5 48
gert_lauritsen 61:52a6d0ffd8e5 49 virtual uint16_t getSerialVid() = 0;
gert_lauritsen 61:52a6d0ffd8e5 50 virtual uint16_t getSerialPid() = 0;
gert_lauritsen 61:52a6d0ffd8e5 51
gert_lauritsen 61:52a6d0ffd8e5 52 virtual bool switchMode(USBDeviceConnected* pDev) = 0;
gert_lauritsen 61:52a6d0ffd8e5 53
gert_lauritsen 61:52a6d0ffd8e5 54 virtual USBEndpoint* getEp(USBDeviceConnected* pDev, int serialPortNumber, bool tx) {
gert_lauritsen 61:52a6d0ffd8e5 55 return pDev->getEndpoint(m_serialIntfMap[serialPortNumber], BULK_ENDPOINT, tx ? OUT : IN, 0);
gert_lauritsen 61:52a6d0ffd8e5 56 }
gert_lauritsen 61:52a6d0ffd8e5 57
gert_lauritsen 61:52a6d0ffd8e5 58 virtual int getSerialPortCount() = 0;
gert_lauritsen 61:52a6d0ffd8e5 59
gert_lauritsen 61:52a6d0ffd8e5 60 virtual void setVidPid(uint16_t vid, uint16_t pid) = 0;
gert_lauritsen 61:52a6d0ffd8e5 61
gert_lauritsen 61:52a6d0ffd8e5 62 virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol) = 0; //Must return true if the interface should be parsed
gert_lauritsen 61:52a6d0ffd8e5 63
gert_lauritsen 61:52a6d0ffd8e5 64 virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir) = 0; //Must return true if the endpoint will be used
gert_lauritsen 61:52a6d0ffd8e5 65
gert_lauritsen 61:52a6d0ffd8e5 66 virtual int getType() = 0;
gert_lauritsen 61:52a6d0ffd8e5 67
gert_lauritsen 61:52a6d0ffd8e5 68 virtual uint8_t getSerialIntf(int index) { return m_serialIntfMap[index]; }
gert_lauritsen 61:52a6d0ffd8e5 69 };
gert_lauritsen 61:52a6d0ffd8e5 70
gert_lauritsen 61:52a6d0ffd8e5 71 #endif /* USBHOST_3GMODULE */
gert_lauritsen 61:52a6d0ffd8e5 72
gert_lauritsen 61:52a6d0ffd8e5 73 #endif