CN114595177A - Multi-communication module based on android and compatible method thereof - Google Patents

Multi-communication module based on android and compatible method thereof Download PDF

Info

Publication number
CN114595177A
CN114595177A CN202210165850.1A CN202210165850A CN114595177A CN 114595177 A CN114595177 A CN 114595177A CN 202210165850 A CN202210165850 A CN 202210165850A CN 114595177 A CN114595177 A CN 114595177A
Authority
CN
China
Prior art keywords
communication
communication module
android
interface
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210165850.1A
Other languages
Chinese (zh)
Inventor
蒋波
魏波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Wanchuang Technology Co ltd
Original Assignee
Chengdu Wanchuang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Wanchuang Technology Co ltd filed Critical Chengdu Wanchuang Technology Co ltd
Priority to CN202210165850.1A priority Critical patent/CN114595177A/en
Publication of CN114595177A publication Critical patent/CN114595177A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention relates to and discloses an android-based multi-communication module and a compatible method thereof, and belongs to the technical field of communication. The method comprises the following steps: the android end comprises a plurality of communication interfaces, the communication modules are in communication connection with the android end through USB serial ports, the android end comprises a plurality of pairs of VIDs and PIDs corresponding to the communication modules and a plurality of private shared libraries corresponding to the communication modules, different communication modules are automatically discovered and identified based on plug and play of the USB interfaces, the communication interfaces corresponding to the communication modules are bound, the functions of the private shared libraries corresponding to different communication modules are realized in RIL interfaces, the function of manually switching and selecting the interfaces of the communication modules is arranged in the android end, a user can conveniently select the corresponding communication modules to communicate through man-machine interface switching, one communication interface can be accessed into different communication modules, and the compatibility of the different communication modules on one android end can also be realized.

Description

Multi-communication module based on android and compatible method thereof
Technical Field
The invention relates to the technical field of communication, in particular to an android-based multi-communication module and a compatible method thereof.
Background
With the progress of science and technology, the demand of people for communication modules is increasing, many devices need two or more communication modules, and some devices need to support two or more peripheral communication modules of different manufacturers respectively at present, but most devices only support one peripheral module of one manufacturer at present, and are difficult to meet the support of communication modules of more than two different manufacturers on one system device, so that the communication modules of a plurality of different manufacturers are difficult to be compatible on one device at present.
Disclosure of Invention
The invention aims to solve the problems that the prior art in the prior art is difficult to meet the requirements of more than two communication modules and the compatibility of the communication modules of different manufacturers on one device is difficult to realize, and provides an android-based multi-communication module and a compatibility method thereof.
In order to achieve the above purpose, the invention provides the following technical scheme:
an android-based multi-communication module, comprising: an android end and a plurality of different communication modules;
the android end comprises a plurality of communication interfaces;
the communication module is in communication connection with the android end through a USB serial port;
the android end comprises a plurality of pairs of VIDs and PIDs corresponding to the communication modules and a plurality of private shared libraries corresponding to the communication modules;
the identification modes of the VID and the PID adopt an idProduct and an idVendor in a usb sys subsystem, the idProduct and the idVendor are used for automatically verifying the connected communication module and binding the communication module with the communication interface correspondingly connected with the communication interface, and the private shared library is used for realizing the communication between the communication module and the android end.
By adopting the technical scheme, the android end can be simultaneously connected with a plurality of different communication modules, automatic detection and interface matching are carried out on the communication modules, the operation of the communication modules is controlled through the corresponding private shared libraries, and the communication compatibility of one android end and two or more different communication modules and the quick switching of the communication modules are realized.
As a preferred aspect of the present invention, one of the communication interfaces may be capable of connecting different ones of the communication modules.
On the other hand, the compatible method of the multi-communication module based on android comprises the following steps:
s1: presetting a plurality of pairs of VIDs and PIDs corresponding to the communication modules and a plurality of private shared libraries corresponding to the communication modules at the android end;
s2: the android end automatically verifies the connected communication module through preset VID and PID;
s3: if the VID and the PID of the connected communication module are judged to be the same as the preset VID and PID, the communication module and the corresponding connected communication interface are bound;
s4: defining a system attribute at the android terminal, defining an attribute value of the corresponding communication module at the android terminal, and dynamically loading the private shared libraries of different communication modules by using the system attribute;
s5: after the private shared library is loaded, controlling the communication between the communication module and the android terminal;
s6: and the user selects the communication module to be used through the android terminal, and the steps S4-S5 are repeated.
By adopting the technical scheme, based on the plug-and-play of the USB interface, different communication modules are automatically discovered and identified, the communication interfaces corresponding to the communication modules are bound, the functions of private shared libraries corresponding to the different communication modules are realized in the RIL interface, and the function of manually switching and selecting the interface of the communication module is arranged in the android terminal, so that a user can conveniently switch and select the corresponding communication module to communicate through the man-machine interface, one communication interface can be accessed to different communication modules, and the compatibility of a plurality of different communication modules on one android terminal can also be realized.
As a preferable embodiment of the present invention, the step S2 includes: and the android end reads the VID and PID of the connected communication module, and compares the VID and PID with the preset VID and PID for verification.
As a preferable embodiment of the present invention, the step S3 includes: and after the comparison is successful, traversing the communication interface corresponding to the communication module, finding the AT communication interface and the data communication interface corresponding to the communication module, and binding and recording the AT communication interface and the data communication interface corresponding to the communication module and the communication module for the RIL interface to use.
As a preferable embodiment of the present invention, the step S4 includes: the attribute value can be read and written by an upper API interface and used for selecting and using the communication module, and the RIL interface loads the corresponding private shared library of the communication module through the system attribute after receiving the attribute value of the communication module.
As a preferable embodiment of the present invention, the step S5 includes: and setting the bound communication interface, and then operating through the private shared library.
As a preferable embodiment of the present invention, the step S6 includes: the user selects the corresponding communication module by selecting the list.
As a preferable embodiment of the present invention, the step S6 further includes: after the user selects the communication module, the attribute value corresponding to the communication module needs to be set again, after the RIL interface detects the attribute value, the currently used communication module is deactivated, the private shared library of the selected communication module is loaded, then the RIL interface is restarted, and switching and starting of different communication modules are performed.
Compared with the prior art, the invention has the beneficial effects that:
1. according to the android-based multi-communication module, the android end is connected with the plurality of different communication modules, the communication modules are automatically detected and subjected to interface matching, the operation of the communication modules is controlled through the corresponding private shared library, the communication compatibility of one android end and two or more different communication modules is realized, and the communication modules are rapidly switched.
2. The android-based multi-communication module compatibility method disclosed by the invention has the advantages that different communication modules are automatically discovered and identified based on plug and play of the USB interface, the communication interfaces corresponding to the communication modules are bound, the functions of private shared libraries corresponding to the different communication modules are realized in the RIL interface, the function of manually switching and selecting the interface of the communication module is arranged in the android end, a user can conveniently select the corresponding communication module for communication through man-machine interface switching, one communication interface can be accessed to different communication modules, and the compatibility of a plurality of different communication modules on one android end can also be realized.
Drawings
Fig. 1 is a structural diagram of a multi-communication module based on android in embodiment 1 of the present invention;
fig. 2 is a flowchart illustrating switching and selecting a communication module during setting according to a compatible method for multiple communication modules based on android in embodiment 2 of the present invention;
fig. 3 is a flowchart illustrating processing system attributes in a hardware abstraction layer of a compatible method for multiple android-based communication modules and specifying a shared library of modules to be loaded according to embodiment 2 of the present invention;
fig. 4 is a flowchart illustrating a method for compatible searching of multiple communication modules based on android according to embodiment 2 of the present invention.
Detailed Description
The present invention will be described in further detail with reference to test examples and specific embodiments. It should be understood that the scope of the above-described subject matter of the present invention is not limited to the following examples, and any technique realized based on the contents of the present invention is within the scope of the present invention.
Example 1
An android-based multi-communication module, as shown in fig. 1, includes: an android end and a plurality of different communication modules;
the android end comprises a plurality of communication interfaces;
the communication module is in communication connection with the android end through a USB serial port;
the android end comprises a plurality of pairs of VIDs and PIDs corresponding to the communication modules and a plurality of private shared libraries corresponding to the communication modules;
the identification modes of the VID and the PID adopt an idProduct and an idVendor in a usb sys subsystem, the idProduct and the idVendor are used for automatically verifying the connected communication module and binding the communication module with the communication interface correspondingly connected with the communication interface, and the private shared library is used for realizing the communication between the communication module and the android end.
By adopting the technical scheme, the android end can be simultaneously connected with a plurality of different communication modules, automatic detection and interface matching are carried out on the communication modules, the operation of the communication modules is controlled through the corresponding private shared libraries, and the communication compatibility of one android end and two or more different communication modules and the quick switching of the communication modules are realized.
Example 2
A method for enabling android-based multi-communication module compatibility according to embodiment 1, as shown in fig. 2, 3 and 4, includes the following steps:
s1: presetting a plurality of pairs of VIDs and PIDs corresponding to the communication modules and a plurality of private shared libraries corresponding to the communication modules at the android end;
s2: the android end automatically verifies the connected communication module through preset VID and PID;
s3: if the VID and the PID of the connected communication module are judged to be the same as the preset VID and PID, the communication module and the corresponding connected communication interface are bound;
s4: defining a system attribute at the android end, wherein the system attribute is persistence, rild, libpath, defining the attribute value of the corresponding communication module at the android end, and dynamically loading the private shared library of different communication modules by using the system attribute;
s5: after the private shared library is loaded, controlling the communication between the communication module and the android terminal;
s6: and the user selects the communication module to be used through the android terminal, and the steps S4-S5 are repeated.
In the communication process after the binding, other modules cannot be connected, an index is established for the communication interface corresponding to each communication module after the binding, and through the step S6, after the user selects the communication module to be used for switching, the establishment index is found, and the connection is reestablished.
Specifically, after the communication modules are connected through the USB, the bottom layer is automatically identified and bound and is not immediately executed, but the interfaces of the corresponding communication modules are recorded in the system. When the user designates the communication module, the private shared library of the loading module is matched with the designated module to communicate. Therefore, a plurality of communication modules can be connected to hardware simultaneously, and communication confusion is avoided.
The step S2 includes: and the android end reads the VID and PID of the connected communication module, and compares the VID and PID with the preset VID and PID for verification.
The step S3 includes: and after the comparison is successful, traversing the communication interface corresponding to the communication module, finding the AT communication interface and the data communication interface corresponding to the communication module, and binding and recording the AT communication interface and the data communication interface corresponding to the communication module and the communication module for the RIL interface to use.
The step S4 includes: the attribute value can be read and written by an upper API interface and used for selecting and using the communication module, and the RIL interface loads the corresponding private shared library of the communication module through the system attribute after receiving the attribute value of the communication module.
The step S5 includes: and setting the bound communication interface, and then operating through the private shared library.
The step S6 includes: the user selects the corresponding communication module by selecting the list.
The step S6 further includes: after the user selects the communication module, the attribute value corresponding to the communication module needs to be set again, after the RIL interface detects the attribute value, the currently used communication module is deactivated, the private shared library of the selected communication module is loaded, then the RIL interface is restarted, and switching and starting of different communication modules are performed.
Specifically, a user can decide which communication module to use by himself, user interaction is introduced, the communication module to be used can be selected in a freely switching manner, and once the communication module is selected, the communication module selected by the user is also the default communication module selected by the user when the communication module is powered off and then powered on.
By adopting the technical scheme, based on the plug-and-play of the USB interface, different communication modules are automatically discovered and identified, the communication interfaces corresponding to the communication modules are bound, the functions of private shared libraries corresponding to the different communication modules are realized in the RIL interface, and the function of manually switching and selecting the interface of the communication module is arranged in the android terminal, so that a user can conveniently switch and select the corresponding communication module to communicate through the man-machine interface, one communication interface can be accessed into different communication modules, and the compatibility of a plurality of different communication modules on one android terminal can also be realized.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (8)

1. A multi-communication module based on android is characterized by comprising: an android end and a plurality of different communication modules;
the android end comprises a plurality of communication interfaces;
the communication module is in communication connection with the android end through a USB serial port;
the android end comprises a plurality of pairs of VIDs and PIDs corresponding to the communication modules and a plurality of private shared libraries corresponding to the communication modules;
the identification modes of the VID and the PID adopt an idProduct and an idVendor in a usb sys subsystem, the idProduct and the idVendor are used for automatically verifying the connected communication module and binding the communication module with the communication interface correspondingly connected with the communication interface, and the private shared library is used for realizing the communication between the communication module and the android end.
2. The android-based multi-communication module compatible method according to claim 1, comprising the following steps:
s1: presetting a plurality of pairs of VIDs and PIDs corresponding to the communication modules and a plurality of private shared libraries corresponding to the communication modules at the android end;
s2: the android end automatically verifies the connected communication module through preset VID and PID;
s3: if the VID and the PID of the connected communication module are judged to be the same as the preset VID and PID, the communication module and the corresponding connected communication interface are bound;
s4: defining a system attribute at the android terminal, defining an attribute value of the corresponding communication module at the android terminal, and dynamically loading the private shared libraries of different communication modules by using the system attribute;
s5: after the private shared library is loaded, controlling the communication between the communication module and the android terminal;
s6: and the user selects the communication module to be used through the android terminal, and the steps S4-S5 are repeated.
3. The android-based multi-communication-module compatible method of claim 2, wherein the step S2 includes: and the android end reads the VID and PID of the connected communication module, and compares the VID and PID with the preset VID and PID for verification.
4. The android-based multi-communication-module compatible method of claim 3, wherein the step S3 comprises: and after the comparison is successful, traversing the communication interface corresponding to the communication module, finding the AT communication interface and the data communication interface corresponding to the communication module, and binding and recording the AT communication interface and the data communication interface corresponding to the communication module and the communication module for the RIL interface to use.
5. The android-based multi-communication-module compatible method of claim 4, wherein the step S4 comprises: the attribute value can be read and written by an upper API interface and used for selecting and using the communication module, and the RIL interface loads the corresponding private shared library of the communication module through the system attribute after receiving the attribute value of the communication module.
6. The android-based multi-communication-module compatible method of claim 5, wherein the step S5 comprises: and setting the bound communication interface, and then operating through the private shared library.
7. The android-based multi-communication-module compatible method of claim 6, wherein the step S6 comprises: the user selects the corresponding communication module by selecting a list.
8. The android-based multi-communication-module compatible method of claim 7, wherein the step S6 further comprises: after the user selects the communication module, the attribute value corresponding to the communication module needs to be set again, after the RIL interface detects the attribute value, the currently used communication module is deactivated, the private shared library of the selected communication module is loaded, then the RIL interface is restarted, and switching and starting of different communication modules are performed.
CN202210165850.1A 2022-02-23 2022-02-23 Multi-communication module based on android and compatible method thereof Pending CN114595177A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210165850.1A CN114595177A (en) 2022-02-23 2022-02-23 Multi-communication module based on android and compatible method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210165850.1A CN114595177A (en) 2022-02-23 2022-02-23 Multi-communication module based on android and compatible method thereof

Publications (1)

Publication Number Publication Date
CN114595177A true CN114595177A (en) 2022-06-07

Family

ID=81806087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210165850.1A Pending CN114595177A (en) 2022-02-23 2022-02-23 Multi-communication module based on android and compatible method thereof

Country Status (1)

Country Link
CN (1) CN114595177A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573214A (en) * 2024-01-17 2024-02-20 深圳前海深蕾半导体有限公司 Method and device for fusing serial device and Android system frame

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291637A (en) * 2017-05-18 2017-10-24 武汉普利商用机器有限公司 The method and apparatus of compatible polytypic mobile communication module in Android system
CN113099433A (en) * 2021-04-14 2021-07-09 深圳泰科晶显科技有限公司 Android system-based dynamic method compatible with WIFI and Bluetooth modules of different manufacturers
CN113238807A (en) * 2021-07-14 2021-08-10 广州朗国电子科技股份有限公司 Module compatibility method, platform and server based on android system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291637A (en) * 2017-05-18 2017-10-24 武汉普利商用机器有限公司 The method and apparatus of compatible polytypic mobile communication module in Android system
CN113099433A (en) * 2021-04-14 2021-07-09 深圳泰科晶显科技有限公司 Android system-based dynamic method compatible with WIFI and Bluetooth modules of different manufacturers
CN113238807A (en) * 2021-07-14 2021-08-10 广州朗国电子科技股份有限公司 Module compatibility method, platform and server based on android system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573214A (en) * 2024-01-17 2024-02-20 深圳前海深蕾半导体有限公司 Method and device for fusing serial device and Android system frame
CN117573214B (en) * 2024-01-17 2024-04-19 深圳前海深蕾半导体有限公司 Method and device for fusing serial device and Android system frame

Similar Documents

Publication Publication Date Title
US6904488B2 (en) Portable electronic device comprising common serial bus connector
CN109922293B (en) EDID equipment and conduction method of EDID information transmission channel
US20110016253A1 (en) Auto-function USB port
KR20090009814A (en) A ufd-accomodating multimedia system
US7856518B2 (en) Information processing device
CN114595177A (en) Multi-communication module based on android and compatible method thereof
US20100082846A1 (en) Usb device and method for connecting the usb device with usb host
KR20100002943A (en) Usb device and method to recognize usb mode of the same
EP2083358A2 (en) Information processing apparatus
WO2020034908A1 (en) Method for communication between remote control and mobile terminal, device, and remote control
US20060026326A1 (en) Docking station that can perform an activity without a portable electronics device mated thereto
CN104380756A (en) Electronic apparatus, electronic apparatus system, and electronic apparatus control method
CN102830943A (en) Method and system for playing multimedia files in external USB (universal serial bus) storage on the basis of Android platform
JP2012063817A (en) Communication device
CN107111568B (en) System and method for presenting drive installation files when USB device is enabled
CN112969044B (en) Bidirectional universal video switching device and control method thereof
KR20040074491A (en) Hot plug signal generation apparatus and method
US20110022737A1 (en) Device control method and device selecting apparatus
CN101249308A (en) Information communication system, information processing apparatus and information communication method
CN115802096B (en) Multi-channel HDMI cooperative control method and system
TWI405085B (en) Switching interface method for a multi-interface storage device
WO2009066870A1 (en) Usb memory device
US20120311281A1 (en) Method and apparatus for optically backing up data
CN100565455C (en) The method of multimedia computer system and this system to play multimedia data of quick start
US7683932B2 (en) Storage apparatus and control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination