Information acquisition and manipulation of CDC Mbim devices

Source: Internet
Author: User

The author recently participated in the research and development of a product used in the CDC Mbim modem, demand side requirements can be normal in the product display Mbim signal strength, because the device is in the form of network cards in the system, and different from the traditional serial form of the adapter to access the form, Therefore, it is not possible to use the serial port to send AT+CSQ to obtain the signal strength.


By looking at MSDN, we found that a class windows.networking was added to the WIN8, but unfortunately this class can only be used in metro applications, and our products are traditional in style, so this class does not meet the requirements.

(PS: Whenever there is a problem to find information in the first want to use Google, but now, Google can not open, and Baidu is a waste, yesterday is also the head of the wind, in Bing search under, unexpectedly found the need for something ... Look down here! )


Bing Find a Mbnapi library on MSDN, (see: http://msdn.microsoft.com/en-us/library/windows/desktop/dd323166 (v=vs.85). aspx)

Unfortunately, I know only a fur of C + +, still can't read this note, fortunately, when the powerful Bing with me and found a Interop.mbnapi.dll file, this DLL is the above mbnapi.h file encapsulation. This will be able to meet my requirements.


Also do not say, directly on the code bar:

Vb. NET's

    Description of Private Class networkadapter ' Mbnapi: http://msdn.microsoft.com/en-us/library/windows/desktop/dd323166 (v=vs.8 5). aspx public Function getsignal (GUID as System.Guid) as Integer Dim mbninfmgr as New Mbninterfacemana Ger Dim infmgr as Imbninterfacemanager = DirectCast (mbninfmgr, Imbninterfacemanager) ' String Interfa            Ceid = "{A9d0dfbc-c083-4ede-b1fe-e7fc07116aca}"; Dim InterfaceID as String = GUID. ToString Try Dim inf as Imbninterface = Infmgr.getinterface (InterfaceID) ' inf[0].                InterfaceID;                ' Imbnradio radio = (imbnradio) inf; Dim Signal as Imbnsignal = DirectCast (INF, imbnsignal) getsignal = Signal.getsignalstrength () Ca    TCH ex as Exception getsignal = 1 '-1 indicates that an error occurred, meaning that the CDC Mbim device End Try end Function is not supported End Class

Originally my Code is C #, but in the sense that the package COM Class C # is not vb.net convenient, so I rewrite the C # code into a vb.net, if you need C #, please find the tool to switch ...

The upper code gets the signal strength based on the GUID of the local connection, and here is a way to find the GUID of the network connection:

1, open cmd or PowerShell, recommended PowerShell (CMD interface is too small, too cumbersome to copy)

2. Input getmac/v/s 127.0.0.1

3, the output list is the current system of all network connections (is displayed in the local Connection folder), where the transmission name in the form of a GUID string is the GUID value of this network connection


Well, I only provide so much, because our products only need this do not need to operate, please see the API documentation, I packaged together with the API file upload to CSDN ...

: http://download.csdn.net/detail/robake/8320631




Information acquisition and manipulation of CDC Mbim devices

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.