Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of USBDevice_STM32F103 by
WebUSBDevice.h
00001 /* 00002 * Copyright 2016 Devan Lai 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef WEBUSB_DEVICE_H 00018 #define WEBUSB_DEVICE_H 00019 00020 #include "USBDevice.h" 00021 00022 class WebUSBDevice: public USBDevice 00023 { 00024 public: 00025 WebUSBDevice(uint16_t vendor_id, uint16_t product_id, uint16_t product_release); 00026 00027 /* 00028 * Called by USBDevice on Endpoint0 request. Warning: Called in ISR context 00029 * This is used to handle extensions to standard requests 00030 * and class specific requests 00031 * 00032 * @returns true if class handles this request 00033 */ 00034 virtual bool USBCallback_request(); 00035 00036 /* 00037 * Get device descriptor. Warning: this method has to store the length of the report descriptor in reportLength. 00038 * 00039 * @returns pointer to the device descriptor 00040 */ 00041 virtual uint8_t * deviceDesc(); 00042 00043 /* 00044 * Get binary object store descriptor 00045 * 00046 * @returns pointer to the binary object store descriptor 00047 */ 00048 virtual uint8_t * binaryObjectStoreDesc(); 00049 00050 /* 00051 * Get the WebUSB allowed origin descriptor 00052 * 00053 * @returns pointer to the WebUSB allowed origin descriptor 00054 */ 00055 virtual uint8_t * allowedOriginsDesc() = 0; 00056 00057 /* 00058 * Get WebUSB landing page URL descriptor 00059 * 00060 * @returns pointer to the landing page URL descriptor 00061 */ 00062 virtual uint8_t * urlIlandingPage() = 0; 00063 00064 /* 00065 * Get WebUSB allowed origin URL descriptor 00066 * 00067 * @returns pointer to the allowed origin URL descriptor 00068 */ 00069 virtual uint8_t * urlIallowedOrigin() = 0; 00070 00071 protected: 00072 virtual bool requestGetDescriptor(void); 00073 virtual bool requestWebUSB(void); 00074 00075 private: 00076 00077 }; 00078 00079 #endif
Generated on Thu Jul 14 2022 08:46:29 by
1.7.2
