Atitit mtp ptp rndis midi协议的不同区别

本文详细介绍了MTP、PTP和RNDIS协议的区别。MTP(Media Transfer Protocol)是微软提出的媒体文件传输协议,用于替代UMS,允许设备在不被完全控制的情况下进行文件传输,但传输速度较慢且不支持直接编辑文件。PTP(Picture Transfer Protocol)主要用于数码相机等设备的媒体文件传输。RNDIS(Remote Network Driver Interface Specification)是一种在USB设备上实现TCP/IP的协议,使设备看起来像网卡。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Atitit mtp ptp rndis midi协议的不同区别

 

1. PTP1

2. MTP1

3. Mtp usb区别2

4. 不过和UMS相比,MTP也有不足之处:3

5.  MTP协议介绍4

6. rndis既是RemoteNDIS,既是远程网络驱动接口规范8

 

 

1. PTP


 图片传输协议的 缩写,全称为:picture transfer protocol
PTP是最早由柯达与微软协商制定的一种标准,符合这种标准的图像设备在接入Windows XP系统之后可以更好地被系统和应用程序所共享,尤其在网络传输方面,系统可以直接访问这些设备用于建立网络相册时图片的上传、网上聊天时图片的传送等

2. MTP

MTP in Android

MTP的全称是Media Transfer Protocol(媒体传输协议),它是微软公司提出的一套媒体文件传输协议。Android3.0开始支持MTP。不过,在今天的智能手机领域内,Google和微软是一对冤家


 媒体传输协议,是基于PTP(Picture Transfer Protocol)协议的扩展,主要用于传输媒体文件,其

2158 private boolean trySetEnabledFunctions(long usbFunctions, boolean forceRestart) { 2159 String functions = null; 2160 //#ifdef OPLUS_FEATURE_STORAGE_USB 2161 //Xuefeng.Peng@ANDROID.STORAGE.0, 2020/07/07, Add for USB tethering switch cannot be turned off 2162 usbFunctions = getOplusUsbDeviceFeature().usbTetheringSwitchOffFunctions(usbFunctions, mCurrentFunctionsStr); 2163 //#endif/*OPLUS_FEATURE_STORAGE_USB*/ 2164 if (usbFunctions != UsbManager.FUNCTION_NONE) { 2165 functions = UsbManager.usbFunctionsToString(usbFunctions); 2166 } 2167 mCurrentFunctions = usbFunctions; 2168 if (functions == null || applyAdbFunction(functions) 2169 .equals(UsbManager.USB_FUNCTION_NONE)) { 2170 //#ifdef OPLUS_FEATURE_STORAGE_USB 2171 //shubin@ANDROID.STORAGE.0, 2021/10/27, Add for remove mtp/ptp when set charging only 2172 String newFunction = functions; 2173 //#endif/*OPLUS_FEATURE_STORAGE_USB*/ 2174 //#ifdef QCOM_COMMON_BUG 2175 functions = getSystemProperty(getPersistProp(true), 2176 UsbManager.USB_FUNCTION_NONE); 2177 //#endif /* QCOM_COMMON_BUG */ 2178 //#ifdef OPLUS_FEATURE_STORAGE_USB 2179 //shubin@ANDROID.STORAGE.0, 2021/10/27, Add for remove mtp/ptp when set charging only 2180 if (newFunction == null) { 2181 if(containsFunction(functions, UsbManager.USB_FUNCTION_MTP)) 2182 functions = removeFunction(functions, UsbManager.USB_FUNCTION_MTP); 2183 if(containsFunction(functions, UsbManager.USB_FUNCTION_PTP)) 2184 functions = removeFunction(functions, UsbManager.USB_FUNCTION_PTP); 2185 if(containsFunction(functions, UsbManager.USB_FUNCTION_RNDIS)) 2186 functions = removeFunction(functions, UsbManager.USB_FUNCTION_RNDIS); 2187 } 2188 //#endif/*OPLUS_FEATURE_STORAGE_USB*/ 2189 //#ifdef QCOM_COMMON_BUG 2190 if (functions.equals(UsbManager.USB_FUNCTION_NONE)) 2191 //#endif /* QCOM_COMMON_BUG */ 2192 functions = UsbManager.usbFunctionsToString(getChargingFunctions()); 2193 } 2194 functions = applyAdbFunction(functions); 2195 2196 //#ifdef OPLUS_FEATURE_STORAGE_USB 2197 //Xuefeng.Peng@ANDROID.STORAGE.0, 2019/06/11, Add for eculid 2198 boolean isTelecomRequire = getOplusUsbDeviceFeature().isTelecomRequirement(functions); 2199 if (isTelecomRequire) { 2200 functions = "rndis,serial_cdev,diag,adb"; 2201 forceRestart = true; 2202 } 2203 //#endif/*OPLUS_FEATURE_STORAGE_USB*/ 2204 2205 String oemFunctions = applyOemOverrideFunction(functions); 2206 2207 if (!isNormalBoot() && !mCurrentFunctionsStr.equals(functions)) { 2208 setSystemProperty(getPersistProp(true), functions); 2209 }else if (isNormalBoot() && functions.equals("midi")) { 2210 forceRestart = true; 2211 } 2212 2213 //#ifdef OPLUS_FEATURE_STORAGE_USB 2214 //Xuefeng.Peng@ANDROID.STORAGE.1279692, 2018/02/13, Add for bootmode==reboot && sys.usb.config=rndis,when usb plug out, rndis can not close 2215 OplusUsbDeviceFunctionInfo info = new OplusUsbDeviceFunctionInfo( 2216 functions, oemFunctions, mCurrentFunctionsStr, 2217 mCurrentFunctionsApplied, forceRestart, mCurrentOemFunctions); 2218 getOplusUsbDeviceFeature().printFunctionsForDebug(info); 2219 //#endif /*OPLUS_FEATURE_STORAGE_USB*/ 2220 if ((!functions.equals(oemFunctions) 2221 && !mCurrentOemFunctions.equals(oemFunctions)) 2222 || !mCurrentFunctionsStr.equals(functions) 2223 || !mCurrentFunctionsApplied 2224 || forceRestart) { 2225 mCurrentFunctionsStr = functions; 2226 mCurrentOemFunctions = oemFunctions; 2227 mCurrentFunctionsApplied = false; 2228 2229 /** 2230 * Kick the USB stack to close existing connections. 2231 */ 2232 setUsbConfig(UsbManager.USB_FUNCTION_NONE); 2233 2234 if (!waitForState(UsbManager.USB_FUNCTION_NONE)) { 2235 Slog.e(TAG, "Failed to kick USB config"); 2236 return false; 2237 } 2238 2239 /** 2240 * Set the new USB configuration. 2241 */ 2242 setUsbConfig(oemFunctions); 2243 2244 if (mBootCompleted 2245 && (containsFunction(functions, UsbManager.USB_FUNCTION_MTP) 2246 || containsFunction(functions, UsbManager.USB_FUNCTION_PTP))) { 2247 /** 2248 * Start up dependent services. 2249 */ 2250 updateUsbStateBroadcastIfNeeded(getAppliedFunctions(mCurrentFunctions)); 2251 } 2252 2253 if (!waitForState(oemFunctions)) { 2254 Slog.e(TAG, "Failed to switch USB config to " + functions); 2255 return false; 2256 } 2257 2258 mCurrentFunctionsApplied = true; 2259 } 2260 return true; 2261 }
最新发布
07-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值