CN110198533B - Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device - Google Patents

Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device Download PDF

Info

Publication number
CN110198533B
CN110198533B CN201810159546.XA CN201810159546A CN110198533B CN 110198533 B CN110198533 B CN 110198533B CN 201810159546 A CN201810159546 A CN 201810159546A CN 110198533 B CN110198533 B CN 110198533B
Authority
CN
China
Prior art keywords
attribute
bluetooth device
ble bluetooth
value
audio
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.)
Active
Application number
CN201810159546.XA
Other languages
Chinese (zh)
Other versions
CN110198533A (en
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.)
Guangzhou Ankai Microelectronics Co ltd
Original Assignee
Guangzhou Ankai Microelectronics 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 Guangzhou Ankai Microelectronics Co ltd filed Critical Guangzhou Ankai Microelectronics Co ltd
Priority to CN201810159546.XA priority Critical patent/CN110198533B/en
Publication of CN110198533A publication Critical patent/CN110198533A/en
Application granted granted Critical
Publication of CN110198533B publication Critical patent/CN110198533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Abstract

The invention is suitable for the technical field of Bluetooth communication, and provides a method for remotely controlling BLE Bluetooth equipment and the BLE Bluetooth equipment, wherein the method comprises the following steps: and if the attribute type is found in the customized service attribute table, obtaining a corresponding configuration format according to the attribute type, substituting the attribute value into the configuration format to generate an operation instruction, and executing corresponding operation according to the operation instruction. According to the invention, the configuration format corresponding to the attribute type is searched in the user-defined service attribute table, the attribute value is substituted into the configuration format to generate the operation instruction, and corresponding operation is executed according to the operation instruction, so that the problems of low operation efficiency and high labor cost in a manual control mode are effectively solved.

Description

Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device
Technical Field
The invention belongs to the technical field of Bluetooth communication, and particularly relates to a method for remotely controlling BLE (Bluetooth Low Energy) Bluetooth equipment and the BLE Bluetooth equipment.
Background
With the continuous development of social level and scientific technology, the application field of bluetooth is wider and wider, and when BLE bluetooth equipment needs to be remotely controlled, control content is usually sent to a terminal (for example, a mobile phone) corresponding to a user, and then the user controls the bluetooth equipment according to the control content on the terminal.
The manual control mode in the prior art has the problems of low operation efficiency and high labor cost.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method for remotely controlling a BLE bluetooth device and a BLE bluetooth device, so as to solve the problems of low operation efficiency and high labor cost in a manual control manner in the prior art.
A first aspect of an embodiment of the present invention provides a method for remotely controlling a BLE bluetooth device, where the method is applied to a first BLE bluetooth device, and the method for remotely controlling a BLE bluetooth device includes:
and acquiring a user-defined service attribute table.
And receiving a control data packet sent by the second BLE Bluetooth device.
And analyzing the control data packet to obtain an attribute type and an attribute value.
And if the attribute type is found in the user-defined service attribute table, obtaining a corresponding configuration format according to the attribute type.
And substituting the attribute values into the configuration format to generate an operation instruction, and executing corresponding operation according to the operation instruction.
A second aspect of an embodiment of the present invention provides a BLE bluetooth device, including:
and the information acquisition module is used for acquiring the custom service attribute list.
And the receiving module is used for receiving the control data packet sent by the second BLE Bluetooth device.
And the analysis module is used for analyzing the control data packet to obtain the attribute type and the attribute value.
And the configuration format obtaining module is used for obtaining a corresponding configuration format according to the attribute type if the attribute type is found in the user-defined service attribute list.
And the processing module is used for substituting the attribute values into the configuration format to generate an operation instruction and executing corresponding operation according to the operation instruction.
A third aspect of embodiments of the present invention provides a BLE bluetooth device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method as described above when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method as described above.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: in this embodiment, the attribute type is obtained by obtaining the customized service attribute table, receiving the control data packet sent by the second BLE bluetooth device, analyzing the control data packet, obtaining a corresponding configuration format according to the attribute type if the attribute type is found in the customized service attribute table, substituting the attribute value into the configuration format, generating an operation instruction, and executing a corresponding operation according to the operation instruction. According to the method and the device, the configuration format corresponding to the attribute type is found in the user-defined service attribute table, the attribute value is substituted into the configuration format, the operation instruction is generated, and corresponding operation is executed according to the operation instruction, so that the problems of low operation efficiency and high labor cost in a manual control mode are effectively solved, remote control of the BLE Bluetooth equipment is effectively achieved, and the operation efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flow chart of an implementation of a method for remotely controlling a BLE bluetooth device according to an embodiment of the present invention;
FIG. 2 is a diagram of a Bluetooth protocol stack provided by one embodiment of the present invention;
fig. 3 is a schematic flowchart illustrating a specific implementation of step S103 in fig. 1 according to an embodiment of the present invention;
figure 4 is a schematic structural diagram of a BLE bluetooth device provided by one embodiment of the present invention;
FIG. 5 is a block diagram of the parsing module of FIG. 4 according to an embodiment of the present invention;
figure 6 is a schematic structural diagram of a BLE bluetooth device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Example 1:
fig. 1 shows an implementation process of a method for remotely controlling a BLE bluetooth device according to an embodiment of the present invention, where a process execution subject of the embodiment of the present invention may be a first BLE bluetooth device, and a process thereof is described in detail as follows:
in step S101, a custom service attribute table is acquired.
In one embodiment of the present invention, before step S101, the method includes:
1) establishing baseband communication with a second BLE Bluetooth device.
2) And after successfully establishing the baseband communication, establishing a logical channel connection with the second BLE Bluetooth device based on the logical link control and adaptation protocol.
3) And reading the self-defined service attribute table from the second BLE Bluetooth device after the logical channel connection is successfully established.
In one embodiment, as shown in FIG. 2, the Bluetooth Low energy protocol stack comprises a HOST (HOST) and a Controller (Controller).
Wherein, the host computer part includes: logical Link Control and Adaptation Protocol (L2 CAP), Security Manager (SM), Attribute Protocol (ATT), Generic Access Profile (GAP), and Generic Attribute Profile (GATT).
The Controller portion includes a Physical Layer (PHY), a Link Layer (LL), and a Host Controller Interface (HCI).
In one embodiment, the physical layers include a Baseband (Baseband) layer and a Radio Frequency (Radio Frequency) layer.
In this embodiment, when the first BLE bluetooth device transmits data, the baseband layer performs channel coding on data information from the baseband layer and passes the data information to the radio frequency layer for transmission. When the first BLE Bluetooth device receives data, the radio frequency layer demodulates and replies the data and uploads the data to the baseband layer, and the baseband layer performs channel decoding on the data and transmits the data to the upper layer of the baseband.
In this embodiment, the baseband layer may manage ACL (Asynchronous Connection Less) physical links.
In this embodiment, the baseband communication is actually that the first BLE bluetooth device and the second BLE bluetooth device communicate through a physical link, the first BLE bluetooth device and the second BLE bluetooth device establish an ACL physical link, receive a packet data packet sent by the second BLE bluetooth device, and the baseband layer manages the ACL physical link.
In this embodiment, the ACL physical link is a directional transmission packet, which supports both symmetric and asymmetric connections, either one-to-one or one-to-many. The master baseband layer is responsible for controlling the link bandwidth and determining how much bandwidth each slave in the piconet can occupy and the symmetry of the connection. The slave device can only transmit data when being selected, wherein the master device is the device for initiating connection, and the slave device is the device for receiving connection.
In one embodiment, a custom service attribute table is generated from the audio/video remote control specification, the custom service attribute table including an attribute handle value, a standard attribute type, and an attribute value.
In this embodiment, the Audio/Video Remote Control Profile (AVRCP) defines how to Control the features of a streaming media device, including pause, stop, start play, volume Control, and other types of Remote Control operations.
In one embodiment, the custom service attribute table contains a preset number of standard attribute types and attribute handle values corresponding to the standard attribute types one to one.
In this embodiment, the customized service attribute table further includes attribute values.
In this embodiment, the second BLE bluetooth device clusters and analyzes features defined by the audio/video remote control specification, and clusters similar features into one service, and one service may include a plurality of features, for example, a turned-up volume feature and a turned-down volume feature are clustered into volume services, an attribute handle value is assigned to each service, and a customized service attribute table is generated according to a standard attribute type, an attribute handle value, and an attribute value corresponding to the defined service.
In this embodiment, the second BLE bluetooth device generates a configuration format according to the usage information of the features defined by the audio/video remote control specification, and associates the configuration format with an attribute handle value, and there is an attribute value corresponding to each standard attribute type in the customized service attribute table.
In this embodiment, the attribute handle value is an index of the configuration format, and the corresponding configuration format can be found through the attribute handle, where the attribute handle is equivalent to a storage address of the configuration format, and the corresponding configuration format can be addressed through the attribute handle. The standard attribute types are service name and feature name, such as temperature service and turn-up temperature feature. The attribute value is a feature specific value, for example, the temperature is raised by 1 degree.
In this embodiment, the CID value and the PSM value corresponding to the audio/video remote control specification may also be obtained from the custom attribute table by the attribute type, where the CID value and the PSM value corresponding to the audio/video remote control specification are attribute values.
In this embodiment, the first BLE bluetooth device scans the connectable advertisement sent by the second BLE bluetooth device, when the connectable advertisement of the second BLE bluetooth device is received, the first BLE bluetooth device may initiate a connection request, after the second BLE bluetooth device receives the connection request of the first BLE bluetooth device, the first BLE bluetooth device prepares to receive a first data packet sent by the first BLE bluetooth device, after the first data packet is received and acknowledged, an ACL physical link is established, the advertisement is a data packet broadcasted by the second bluetooth device to the BLE bluetooth device in the preset area, and the connectable advertisement is a data packet broadcasted by the second bluetooth device and establishes a connection with the second bluetooth device.
In this embodiment, a CID (Channel ID, Channel identifier) value corresponding to the attribute protocol is used as a first Channel identifier value, the first BLE bluetooth device initiates a logical Channel connection with the Channel identifier being the first Channel identifier value, where the logical Channel with the Channel identifier being the first Channel identifier value is used to transmit a data packet generated based on the ATT protocol, the second BLE bluetooth device responds to the logical Channel connection sent by the first BLE bluetooth device, and establishes a logical Channel with the second BLE bluetooth device through a logical link control and adaptation protocol, that is, an L2CAP Channel with the Channel identifier being the first Channel identifier, where a CID value corresponding to the attribute protocol is set to 4 by default.
In one embodiment, after the first BLE bluetooth device obtains the customized service attribute table, the connection of the L2CAP channel with the first channel identifier as the channel identifier established by the second BLE bluetooth device is disconnected.
In step S102, a control packet transmitted by the second BLE bluetooth device is received.
In one embodiment, step S102 includes:
1) and acquiring a CID value corresponding to the audio/video remote control specification and using the CID value as a second channel identification value.
2) And acquiring a PSM (Protocol/Service Multiplexer) value corresponding to the audio/video remote control specification.
3) And establishing a logical channel with the second BLE Bluetooth equipment based on the logical link control and adaptation protocol, wherein the channel identification is a second channel identification value.
4) And receiving a control data packet sent by the second BLE Bluetooth device after the logical channel with the channel identifier being the second channel identifier value is successfully established.
In this embodiment, the second BLE bluetooth device generates a control command based on a data format defined by the audio/video remote control specification, an attribute type corresponding to the operation, and a corresponding attribute value, and encapsulates the control command and the PSM value corresponding to the audio/video remote control specification into a control data packet according to the data format specified by the logical link control and adaptation protocol, where the data format specified by the logical link control and adaptation protocol includes the length and the position of the PSM value. And then initiating a logical channel with a channel identifier being a CID value corresponding to the audio/video remote control specification, and after receiving a logical channel request, responding to the request and establishing the logical channel with a second BLE Bluetooth device, wherein the logical channel with the channel identifier being the second channel identifier value indicates that the transmitted protocol type is the audio/video remote control specification, and a PSM value corresponding to the audio/video remote control specification is used for indicating that a logical link control and adaptation protocol upper layer protocol knows that the protocol type corresponding to the control instruction is the audio/video remote control specification through a PSM value corresponding to the audio/video remote control specification, so that the control instruction is analyzed according to the audio/video remote control specification.
Taking a specific application scenario as an example, if the temperature of the device is to be increased by 1 degree, the corresponding attribute type is operated to be the temperature service and the temperature is increased, the attribute value is 1 degree, and the control instruction is generated according to the attribute type, the attribute value and the data format defined by the audio/video remote control specification.
In this embodiment, the logical channel is identified to enable the logical channel to transmit multiple protocols, thereby implementing multiplexing of the logical channel and improving the utilization rate of the channel.
In step S103, the control packet is parsed to obtain the attribute type and the attribute value.
In this embodiment, after receiving the control data packet, the first BLE bluetooth device matches the control data packet with a data format defined by a logical link control and adaptation protocol, extracts a control instruction and a PSM value corresponding to the audio/video remote control specification, acquires the data format defined by the audio/video remote control specification according to the PSM value corresponding to the audio/video remote control specification, matches the data format defined by the audio/video remote control specification with the control instruction, and extracts the attribute type and the attribute value.
In one embodiment, the control command is directly generated according to a command format and action information defined by an audio/video remote control specification, the action information is used for instructing the first BLE bluetooth device to perform corresponding operations according to the action information, the data format specified by the logical link control and adaptation protocol includes the length and the position of a PSM value, and the control command and the PSM value corresponding to the audio/video remote control specification are encapsulated into a control data packet. Then initiating a logic channel with channel identification being CID value corresponding to audio/video remote control specification, when the first BLE Bluetooth device receives the logic channel request, responding to the request and establishing the logic channel with the second BLE Bluetooth device, when the first BLE Bluetooth device receives the control data packet, matching the control data packet with the data format defined by logic link control and adaptation protocol, extracting the control instruction and the BLE value corresponding to the audio/video remote control specification, identifying that the protocol type corresponding to the control instruction is the audio/video remote control specification according to the PSM value corresponding to the audio/video remote control specification, analyzing the control instruction through the audio/video remote control specification, extracting the action information, executing corresponding operation according to the action information, thereby realizing directly controlling the first Bluetooth device through AVRCP protocol, the energy consumption of the Bluetooth equipment can be effectively reduced.
In step S104, if the attribute type is found in the customized service attribute table, the corresponding configuration format is obtained according to the attribute type.
In an embodiment of the present invention, the customized service attribute table includes a preset number of standard attribute types and attribute handle values corresponding to the standard attribute types one to one, and step S104 includes:
1) and if the standard attribute type which is the same as the attribute type is found in the self-defined service attribute table, acquiring an attribute handle value corresponding to the same standard attribute type as a target attribute handle value.
2) And acquiring a configuration format corresponding to the target attribute handle value.
In this embodiment, whether a standard attribute type same as the attribute type exists is searched in the customized service attribute table, and when the standard attribute type same as the attribute type is found in the customized service attribute table, an attribute handle value corresponding to the standard attribute handle value same as the attribute type is obtained, and the attribute handle value is used as a target attribute handle value, and a configuration format corresponding to the target attribute handle value is searched in the local database.
In step S105, the attribute values are substituted into the configuration format to generate an operation instruction, and corresponding operation is performed according to the operation instruction.
In this embodiment, the attribute values are substituted into the configuration format to generate an operation instruction, and a corresponding operation, for example, turning up the volume, is performed according to the generated operation instruction, so that the remote control of the first BLE bluetooth device is realized.
Taking a specific application scenario as an example, the attribute value is 1 degree, when the attribute type is temperature service and indoor temperature increase, searching whether a standard attribute type is temperature service and indoor temperature increase in a custom service attribute table, when the standard attribute type is temperature service and indoor temperature increase in the custom service attribute table, searching for the standard attribute type is temperature service and indoor temperature increase in the custom service attribute table, obtaining a corresponding attribute handle value of 0x0002, and then a target attribute handle value of 0x0002, obtaining a configuration format corresponding to the target attribute handle value of 0x0002 in a local database, substituting the attribute value into the configuration format, generating an operation instruction, and executing corresponding operation, thereby increasing the indoor temperature by 1 degree.
In one embodiment, if the attribute type is not found in the custom service attribute table, the parsing is failed.
In this embodiment, if the attribute type is not found in the customized service attribute table, an analysis failure is displayed, and a failure result is sent to the second BLE bluetooth device.
Preferably, if the attribute type is found in the customized service attribute table, the attribute type is sent to the second BLE bluetooth device, the second BLE bluetooth device judges whether the attribute type meets the audio/video remote control specification, and if the attribute type meets the audio/video remote control specification, an attribute handle value is allocated to the attribute type and added to the customized service attribute table.
In this embodiment, the configuration format corresponding to the attribute type is found in the customized service attribute table, the attribute value is substituted into the configuration format to generate the operation instruction, and corresponding operation is executed according to the operation instruction, so that the problems of low operation efficiency and high labor cost in a manual control mode are effectively solved, remote control of the BLE bluetooth device is effectively achieved, and the operation efficiency is improved.
In this embodiment, the BLE bluetooth device is remotely controlled through the audio/video remote control specification, so that the safety of the communication process is improved, the energy consumption of the bluetooth device is reduced, and the development cost is reduced.
As shown in fig. 3, in an embodiment of the present invention, step S103 in the embodiment corresponding to fig. 1 specifically includes:
in step S201, a data format corresponding to the logical link control and adaptation protocol is obtained.
In this embodiment, the data format corresponding to the logical link control and adaptation protocol is obtained locally.
In step S202, the control data packet is matched with the data format corresponding to the logical link control and adaptation protocol, and the control command is extracted.
In this embodiment, the control data packet is matched with the data format corresponding to the acquired logical link control and adaptation protocol, and the PSM value corresponding to the control instruction and the audio/video remote control specification is extracted.
In step S203, a data format corresponding to the audio/video remote control specification is acquired.
In this embodiment, according to the channel identifier, that the established logical channel is used to transmit the protocol type corresponding to the channel identifier, the first BLE bluetooth device and the second BLE bluetooth device are connected by establishing the logical channel with the channel identifier as the second channel identifier value, and the protocol type that can be transmitted is the audio/video remote control specification, since the logical link control and the adaptation protocol upper layer protocol cannot know the protocol type corresponding to the data through the channel identifier, the type corresponding to the data needs to be identified through the PSM, and the first BLE bluetooth device can directly identify the protocol type corresponding to the control instruction as the audio/video remote control specification through the PSM value corresponding to the audio/video remote control specification, and locally acquire the data format corresponding to the audio/video remote control specification.
In step S204, the control command is matched with the data format corresponding to the audio/video remote control specification, and the attribute type and the attribute value are extracted.
In this embodiment, the data format defined by the audio/video remote control specification is compared with the control command, and the attribute type and the attribute value of the attribute are extracted.
In the embodiment, the control data packet is matched with the data format corresponding to the logical link control and adaptation protocol to obtain the control instruction, and the control instruction is matched with the data format corresponding to the audio/video remote control specification to obtain the attribute type and the attribute value, so that a good foundation is laid for subsequent operation.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Example 2:
figure 4 shows a BLE bluetooth device 100 according to an embodiment of the present invention, configured to perform the method steps in the embodiment corresponding to figure 1, where the method includes:
the obtaining information module 110 is configured to obtain a custom service attribute table.
A receiving module 120, configured to receive a control data packet sent by the second BLE bluetooth device.
And the analysis module 130 is configured to analyze the control data packet to obtain an attribute type and an attribute value.
The obtain configuration format module 140 is configured to, if the attribute type is found in the customized service attribute table, obtain the corresponding configuration format according to the attribute type.
And the processing module 150 is configured to substitute the attribute values into the configuration format to generate an operation instruction, and execute a corresponding operation according to the operation instruction.
In one embodiment, the obtain information module further comprises:
a baseband communication unit configured to establish baseband communication with the second BLE bluetooth device;
a channel communication unit, configured to establish a logical channel connection with the second BLE bluetooth device based on a logical link control and adaptation protocol after the baseband communication is successfully established;
and a read information unit, configured to read the customized service attribute table from the second BLE bluetooth device after the logical channel connection is successfully established.
In one embodiment, the custom service attribute table contains a preset number of standard attribute types and attribute handle values corresponding to the standard attribute types one to one.
In one embodiment, the obtain configuration format module 140 includes:
and the attribute obtaining unit is used for obtaining an attribute handle value corresponding to the same standard attribute type as the target attribute handle value if the standard attribute type same as the attribute type is found in the user-defined service attribute table.
And the acquisition protocol unit is used for acquiring the configuration format corresponding to the target attribute handle value.
In one embodiment, the BLE bluetooth device 100 further comprises:
and the display module is used for displaying that the analysis fails if the attribute type is not found in the custom service attribute table.
As shown in fig. 5, in an embodiment, the parsing module 130 in the embodiment corresponding to fig. 4 specifically includes:
a first format obtaining unit 131, configured to obtain a data format corresponding to a logical link control and adaptation protocol.
The first data extracting unit 132 is configured to match the control data packet with a data format corresponding to a logical link control and adaptation protocol, and extract a control instruction.
A second obtaining format unit 133, configured to obtain a data format corresponding to the audio/video remote control specification.
And a second data extracting unit 134, configured to match the control instruction with a data format corresponding to the audio/video remote control specification, and extract an attribute type and an attribute value.
In one embodiment, the BLE bluetooth device 100 further includes other functional modules/units for implementing the method steps in the embodiments of embodiment 1.
Example 3:
figure 6 is a schematic diagram of a BLE bluetooth device according to an embodiment of the present invention. As shown in fig. 6, the BLE bluetooth device 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in said memory 61 and executable on said processor 60. The processor 60, when executing the computer program 62, implements the steps of the embodiments as described in embodiment 1, such as steps S101 to S105 shown in fig. 1. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the modules/units in the system embodiments as described in embodiment 2, such as the functions of the modules 110 to 150 shown in fig. 4.
Illustratively, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 62 in the BLE bluetooth device 6. For example, the computer program 62 may be divided into an acquisition information module, a receiving module, a parsing module, an acquisition configuration format module, and a positional deviation acquisition module. The specific functions of each module are as follows:
and the information acquisition module is used for acquiring the custom service attribute list.
And the receiving module is used for receiving the control data packet sent by the second BLE Bluetooth device.
And the analysis module is used for analyzing the control data packet to obtain the attribute type and the attribute value.
And the configuration format obtaining module is used for obtaining a corresponding configuration format according to the attribute type if the attribute type is found in the user-defined service attribute list.
And the processing module is used for substituting the attribute values into the configuration format to generate an operation instruction and executing corresponding operation according to the operation instruction.
The BLE bluetooth device 6 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The BLE bluetooth device 6 may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that figure 6 is merely an example of a BLE bluetooth device 6 and does not constitute a limitation of BLE bluetooth device 6 and may include more or fewer components than shown, or combine certain components, or different components, e.g., the BLE bluetooth device may also include an input-output device, a network access device, a bus, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the BLE bluetooth device 6, such as a hard disk or a memory of the BLE bluetooth device 6. The memory 61 may also be an external storage device of the BLE bluetooth device 6, such as a plug-in hard disk provided on the BLE bluetooth device 6, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 61 may also include both an internal storage unit and an external storage device of the BLE bluetooth device 6. The memory 61 is used to store the computer program and other programs and data required by the BLE bluetooth device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
Example 4:
an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the embodiments described in embodiment 1, for example, step S101 to step S105 shown in fig. 1. Alternatively, the computer program realizes the functions of the respective modules/units in the respective system embodiments as described in embodiment 2, for example, the functions of the modules 110 to 150 shown in fig. 4, when being executed by a processor.
The computer program may be stored in a computer readable storage medium, which when executed by a processor, may implement the steps of the various method embodiments described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs.
The modules or units in the system of the embodiment of the invention can be combined, divided and deleted according to actual needs.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/bluetooth device and method may be implemented in other ways. For example, the above-described apparatus/bluetooth device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. A method for remotely controlling BLE Bluetooth devices, which is applied to a first BLE Bluetooth device, comprises the following steps:
acquiring a user-defined service attribute table, wherein the user-defined service attribute table is generated according to an audio/video remote control specification and comprises an attribute handle value, a standard attribute type and an attribute value;
receiving a control data packet sent by a second BLE Bluetooth device;
analyzing the control data packet to obtain an attribute type and an attribute value, wherein the method comprises the following steps: after receiving the control data packet, the first BLE Bluetooth device matches the control data packet with a data format defined by a logical link control and adaptation protocol, extracts a control instruction and a PSM value corresponding to the audio/video remote control specification, acquires the data format defined by the audio/video remote control specification according to the PSM value corresponding to the audio/video remote control specification, matches the data format defined by the audio/video remote control specification with the control instruction, and extracts an attribute type and an attribute value;
if the attribute type is found in the user-defined service attribute table, obtaining a corresponding configuration format according to the attribute type;
and substituting the attribute values into the configuration format to generate an operation instruction, and executing corresponding operation according to the operation instruction.
2. The method of remotely controlling a BLE bluetooth device according to claim 1, wherein the obtaining a custom service attribute table is preceded by:
establishing baseband communication with the second BLE Bluetooth device;
after the baseband communication is successfully established, establishing logical channel connection with the second BLE Bluetooth device based on a logical link control and adaptation protocol;
and reading the customized service attribute table from the second BLE Bluetooth equipment after the logical channel connection is successfully established.
3. The method of claim 1, wherein the custom service attribute table contains a preset number of standard attribute types and attribute handle values that correspond one-to-one to the standard attribute types;
if the attribute type is found in the custom service attribute table, obtaining a corresponding configuration format according to the attribute type, including:
if the standard attribute type which is the same as the attribute type is found in the user-defined service attribute table, acquiring an attribute handle value which corresponds to the same standard attribute type as a target attribute handle value;
and acquiring the configuration format corresponding to the target attribute handle value.
4. The method of remote control BLE bluetooth device of claim 1, wherein the method further comprises:
and if the attribute type is not found in the user-defined service attribute table, displaying that the analysis is failed.
5. A BLE Bluetooth device, comprising:
the system comprises an information acquisition module, an information acquisition module and a service processing module, wherein the information acquisition module is used for acquiring a user-defined service attribute table, the user-defined service attribute table is generated according to an audio/video remote control specification, and the user-defined service attribute table comprises an attribute handle value, a standard attribute type and an attribute value;
the receiving module is used for receiving a control data packet sent by the second BLE Bluetooth device;
the analysis module is used for analyzing the control data packet to obtain an attribute type and an attribute value, and comprises: after receiving the control data packet, the first BLE Bluetooth device matches the control data packet with a data format defined by a logical link control and adaptation protocol, extracts a control instruction and a PSM value corresponding to the audio/video remote control specification, acquires the data format defined by the audio/video remote control specification according to the PSM value corresponding to the audio/video remote control specification, matches the data format defined by the audio/video remote control specification with the control instruction, and extracts an attribute type and an attribute value;
the configuration format obtaining module is used for obtaining a corresponding configuration format according to the attribute type if the attribute type is found in the user-defined service attribute list;
and the processing module is used for substituting the attribute values into the configuration format to generate an operation instruction and executing corresponding operation according to the operation instruction.
6. The BLE bluetooth device of claim 5, wherein the custom service attribute table contains a preset number of standard attribute types and attribute handle values that correspond one-to-one to the standard attribute types;
the configuration format obtaining module comprises:
an attribute obtaining unit, configured to, if a standard attribute type that is the same as the attribute type is found in the customized service attribute table, obtain an attribute handle value corresponding to the same standard attribute type as a target attribute handle value;
and the configuration format acquiring unit is used for acquiring the configuration format corresponding to the target attribute handle value.
7. A BLE Bluetooth device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of remotely controlling a BLE Bluetooth device according to any one of claims 1 to 4 when executing the computer program.
8. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of a method of remotely controlling a BLE Bluetooth device as claimed in any one of claims 1 to 4.
CN201810159546.XA 2018-02-26 2018-02-26 Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device Active CN110198533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810159546.XA CN110198533B (en) 2018-02-26 2018-02-26 Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810159546.XA CN110198533B (en) 2018-02-26 2018-02-26 Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device

Publications (2)

Publication Number Publication Date
CN110198533A CN110198533A (en) 2019-09-03
CN110198533B true CN110198533B (en) 2022-04-22

Family

ID=67750645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810159546.XA Active CN110198533B (en) 2018-02-26 2018-02-26 Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device

Country Status (1)

Country Link
CN (1) CN110198533B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112042206B (en) * 2020-02-10 2022-09-09 深圳市汇顶科技股份有限公司 Video transmission method and device
CN117014933A (en) * 2021-01-22 2023-11-07 华为技术有限公司 Architecture framework for recording services of physical layer features
WO2022165765A1 (en) * 2021-02-05 2022-08-11 Oppo广东移动通信有限公司 Message exchange method and apparatus in internet of things, and computer device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075828A (en) * 2007-07-20 2007-11-21 中兴通讯股份有限公司 Method for establishing connection between terminal and audio-frequency apparatus
CN101488783A (en) * 2008-01-17 2009-07-22 中兴通讯股份有限公司 Method for controlling playing volume of Bluetooth media
WO2010148900A1 (en) * 2009-12-14 2010-12-29 中兴通讯股份有限公司 Method and apparatus for switching audio channels and system and apparatus for media playing
CN102064857A (en) * 2009-11-18 2011-05-18 三星电子株式会社 Method and apparatus for remote controlling bluetooth device
CN102256007A (en) * 2011-06-03 2011-11-23 深圳市同洲电子股份有限公司 Method and device for controlling audio playing list according to Bluetooth earphone command and mobile terminal
CN103118176A (en) * 2013-01-16 2013-05-22 广东好帮手电子科技股份有限公司 Method and system for achieving mobile phone voice control function through on-board host computer
WO2017223165A1 (en) * 2016-06-24 2017-12-28 Dolby Laboratories Licensing Corporation Wireless audio source switching

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010038970A2 (en) * 2008-09-30 2010-04-08 Samsung Electronics Co., Ltd. Method and system for managing an imaging device by an electronic device located remotely to the imaging device
US9591432B2 (en) * 2015-01-02 2017-03-07 Voxx International Corporation Vehicle entertainment unit and method of controlling the same

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075828A (en) * 2007-07-20 2007-11-21 中兴通讯股份有限公司 Method for establishing connection between terminal and audio-frequency apparatus
CN101488783A (en) * 2008-01-17 2009-07-22 中兴通讯股份有限公司 Method for controlling playing volume of Bluetooth media
CN102064857A (en) * 2009-11-18 2011-05-18 三星电子株式会社 Method and apparatus for remote controlling bluetooth device
WO2010148900A1 (en) * 2009-12-14 2010-12-29 中兴通讯股份有限公司 Method and apparatus for switching audio channels and system and apparatus for media playing
CN102256007A (en) * 2011-06-03 2011-11-23 深圳市同洲电子股份有限公司 Method and device for controlling audio playing list according to Bluetooth earphone command and mobile terminal
CN103118176A (en) * 2013-01-16 2013-05-22 广东好帮手电子科技股份有限公司 Method and system for achieving mobile phone voice control function through on-board host computer
WO2017223165A1 (en) * 2016-06-24 2017-12-28 Dolby Laboratories Licensing Corporation Wireless audio source switching

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
shichaoge.蓝⽛之⼗⼀AVRCP协议.《https://blog.csdn.net/shichaog/article/details/52180723?utm_source=itdadao&utm_medium=referral》.2016, *
基于Android的蓝牙音频流播放器软件系统的研究;肖辉;《信息科技辑》;20151231;全文 *

Also Published As

Publication number Publication date
CN110198533A (en) 2019-09-03

Similar Documents

Publication Publication Date Title
CN112217831B (en) Information interaction method, device and equipment for Internet of things equipment
TWI512489B (en) Multi-screen interactive method, center equipment, terminal equipment and systems
CN110061871B (en) Base station opening method and device, computer storage medium and equipment
US9774642B2 (en) Method and device for pushing multimedia resource and display terminal
CN109041140B (en) Method for rapidly switching wireless network, intelligent hardware and terminal equipment
CN110198533B (en) Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device
CN105682253A (en) Method and equipment for communication establishment, terminal and computer readable storage medium
CN113595961A (en) Protocol conversion method and system, and gateway device
CN106793007B (en) Interactive communication method and system of cloud and Bluetooth device and wireless router
KR101847519B1 (en) Tag identification method and apparatus
CN101951368A (en) Service authority control method, terminal and system based on subnet
US11943608B2 (en) Bluetooth communication system capable of increasing generation efficiency of cypher keys required for data transmission between Bluetooth host device and Bluetooth device set, and related Bluetooth device set
CN109725543B (en) Equipment control code configuration method and device, cloud server and network system
CN105636041A (en) Networking method and apparatus for intelligent device
EP3182787A1 (en) Communication method and device
CN111182515A (en) Network distribution method, device, terminal and computer storage medium
CN104424036A (en) Synchronous operation method and device of smart terminal
CN100571285C (en) A kind of identification method of multi-stage far-end wireless device and device
CN107835509B (en) Method, device, system, equipment and storage medium for interconnection between equipment
CN103327387A (en) Television remote control method and system
CN113038192A (en) Video processing method and device, electronic equipment and storage medium
US20130219448A1 (en) Digital cable television system and method for data interaction via wireless terminal
CN104125593A (en) Information processing method and electronic equipment
CN106411534A (en) Embedded device and system with functions of interface recognition and wireless sharing
CN105704705A (en) Method for switching terminals with shared eSIM information, terminal and server

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
CB02 Change of applicant information

Address after: 510555 No. 107 Bowen Road, Huangpu District, Guangzhou, Guangdong

Applicant after: Guangzhou Ankai Microelectronics Co.,Ltd.

Address before: 3 / F, C1 area, innovation building, 182 science Avenue, Science City, Guangzhou, Guangdong 510663

Applicant before: ANYKA (GUANGZHOU) MICROELECTRONICS TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant