⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 code demo.vb

📁 vc实现串口收发短信
💻 VB
字号:
Imports System.IO
Imports System.Reflection
Imports System.Collections
Imports System.Windows.Forms
Imports Dreamworld.Mobile.PhoneControllerSDK

Module Code_Demo
    Sub Demo()
        'Find all plug-in. Plug-ins impliments the Dreamworld.Mobile.PhoneControllerSDK.IPhoneController interface will be found.
        'PluginServices are in PlugInService.vb
        Dim ap() As PluginServices.AvailablePlugin
        ap = PluginServices.FindPlugins(Path.GetDirectoryName(Application.ExecutablePath), "Dreamworld.Mobile.PhoneControllerSDK.IPhoneController")
        'Connect phone on port and load CommPhone plug-in.
        'This plug-in execute AT+CGMM to get model ID. Then loop through every available plug-in, if Model ID is in the list
        'of SupportedModel, then this plug-in index is returned.
        Dim port As String = "COM9"
        Dim baudrate As Integer = 115200
        Dim index As Integer = SelectPlugin(port, baudrate, ap, "Dreamworld.Mobile.CommPhone")
        'Directcast select plugin to a IPhoneController. Then you can use 'phone' to control your phone
        Dim phone As IPhoneController = DirectCast(PluginServices.CreateInstance(ap(index)), IPhoneController)
        'Connect phone.
        phone.Connect(port, baudrate, 10000)
        'Set phone to standard. This will help to execute AT commands accurately.
        phone.SetStandard()
        'Then you can use all functions.
    End Sub
End Module

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -