Disclosure of Invention
A method of managing an external bluetooth device capable of communicating with an iOS device according to the present invention includes:
searching an external Bluetooth device capable of communicating with a Bluetooth device in the iOS device, and storing device information of the searched or updated external Bluetooth device;
subscribing the searched or updated device information of the external Bluetooth device to a user-defined external Bluetooth device instance, and receiving and forwarding the subscribed device information and a user control command for the searched external Bluetooth device by using the external Bluetooth device instance;
receiving and displaying forwarded subscribed device information, receiving, displaying and forwarding user control instructions,
wherein the external bluetooth devices comprise bluetooth devices of various different types and/or models, and each external bluetooth device instance corresponds to an instance of a user-defined external bluetooth device class corresponding to a bluetooth device of the same type and/or the same model having the same device information set and the same user control instruction set.
According to the method of the present invention, an external Bluetooth device and device information of the external Bluetooth device are distinguished based on the MAC address of the external Bluetooth device.
According to the method of the invention, its external bluetooth class or external bluetooth device instance implements a method for implementing the following operations:
registering the external Bluetooth device class or the external Bluetooth device instance itself to a Bluetooth engine module to enable subscription for device information of the searched or updated external Bluetooth device and reception of user control instructions for the searched external Bluetooth device;
using a service dictionary to inform the Bluetooth engine module of the equipment information and the user control instruction which need to be monitored;
monitoring connection states of connections between the Bluetooth devices and the external Bluetooth devices, monitoring broadcast data sent by the external Bluetooth devices, and monitoring non-broadcast data sent by the external Bluetooth devices to monitor device information;
the user control command is forwarded to the bluetooth engine module via a write data interface provided by the bluetooth engine module.
According to the method of the present invention, a method for realizing an operation of registering an external bluetooth device instance itself to a bluetooth engine module is called in an initialization method of the external bluetooth device instance.
According to the method of the invention, the external bluetooth device comprises at least one of the following: bluetooth weighing scale, bluetooth toothbrush, bluetooth earphone, bluetooth mouse, bluetooth thermometer, bluetooth hygrometer, bluetooth barometer, bluetooth weighing machine, bluetooth sphygmomanometer.
An apparatus for managing an external bluetooth device capable of communicating with an iOS device according to the present invention includes:
the Bluetooth engine module is used for searching external Bluetooth equipment capable of communicating with the Bluetooth equipment in the iOS equipment and storing the searched or updated equipment information of the external Bluetooth equipment;
the external Bluetooth device management module is used for subscribing the searched or updated device information of the external Bluetooth device to a user-defined external Bluetooth device example from the Bluetooth engine module, and receiving and forwarding the subscribed device information and a user control instruction aiming at the searched external Bluetooth device by using the external Bluetooth device example;
an APP module for receiving and displaying the forwarded subscribed device information, receiving, displaying and forwarding user control instructions,
wherein the external bluetooth devices comprise bluetooth devices of various different types and/or models, and each external bluetooth device instance corresponds to an instance of a user-defined external bluetooth device class corresponding to a bluetooth device of the same type and/or the same model having the same device information set and the same user control instruction set.
According to the apparatus of the present invention, the external bluetooth device and the device information of the external bluetooth device are distinguished based on the MAC address of the external bluetooth device.
According to the apparatus of the invention, its external bluetooth class or external bluetooth device instance implements a method for implementing the following operations:
registering the external Bluetooth device class or the external Bluetooth device instance itself to a Bluetooth engine module to enable subscription for device information of the searched or updated external Bluetooth device and reception of user control instructions for the searched external Bluetooth device;
using a service dictionary to inform the Bluetooth engine module of the equipment information and the user control instruction which need to be monitored;
monitoring connection states of connections between the Bluetooth devices and the external Bluetooth devices, monitoring broadcast data sent by the external Bluetooth devices, and monitoring non-broadcast data sent by the external Bluetooth devices to monitor device information;
the user control command is forwarded to the bluetooth engine module via a write data interface provided by the bluetooth engine module.
According to the apparatus of the present invention, a method for implementing an operation of registering an external Bluetooth device instance itself to a Bluetooth engine module is called in an initialization method of the external Bluetooth device instance,
wherein the apparatus is disposed within the iOS device.
According to the apparatus of the invention, the external bluetooth device comprises at least one of the following: bluetooth weighing scale, bluetooth toothbrush, bluetooth earphone, bluetooth mouse, bluetooth thermometer, bluetooth hygrometer, bluetooth barometer, bluetooth weighing machine, bluetooth sphygmomanometer.
According to the technical scheme of the invention, the device information corresponding to different external Bluetooth devices can be automatically returned or the instructions aiming at different external Bluetooth devices are issued, the logic processing operation is intuitive, and various (accessed) different external Bluetooth devices can be conveniently managed under the iOS system.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 1 schematically shows a flow chart of a method of managing an external bluetooth device capable of communicating with an iOS device according to the present invention.
As shown in fig. 1, the method of managing an external bluetooth device capable of communicating with an iOS device according to the present invention includes:
step S102: searching an external Bluetooth device capable of communicating with a Bluetooth device in the iOS device, and storing device information of the searched or updated external Bluetooth device;
step S104: subscribing the searched or updated device information of the external Bluetooth device to a user-defined external Bluetooth device instance, and receiving and forwarding the subscribed device information and a user control command for the searched external Bluetooth device by using the external Bluetooth device instance;
step S106: receiving and displaying forwarded subscribed device information, receiving, displaying and forwarding user control instructions,
wherein the external bluetooth devices comprise bluetooth devices of various different types and/or models, and each external bluetooth device instance corresponds to an instance of a user-defined external bluetooth device class corresponding to a bluetooth device of the same type and/or the same model having the same device information set and the same user control instruction set.
Alternatively, the external bluetooth device and the device information of the external bluetooth device are distinguished based on the MAC address of the external bluetooth device.
Optionally, the external bluetooth class or external bluetooth device instance implements a method (function or protocol) for implementing the following:
registering the external Bluetooth device class or the external Bluetooth device instance itself to a Bluetooth engine module to enable subscription for device information of the searched or updated external Bluetooth device and reception of user control instructions for the searched external Bluetooth device;
using a service dictionary to inform the Bluetooth engine module of the equipment information and the user control instruction which need to be monitored;
monitoring connection states of connections between the Bluetooth devices and the external Bluetooth devices, monitoring broadcast data sent by the external Bluetooth devices, and monitoring non-broadcast data sent by the external Bluetooth devices to monitor device information;
the user control command is forwarded to the bluetooth engine module via a write data interface provided by the bluetooth engine module.
That is, after the external bluetooth device instance (i.e., device class a-device class d in fig. 3) registers itself in the logic engine (or device management class), it can monitor the device data change as long as the relevant interface (function) in the device protocol (bluetooth protocol) is implemented, and can easily control the device through the command issuing interface provided by the logic engine.
For example, one skilled in the art can use XCode to write the following OC source code to implement the above-described method (function or protocol):
for clarity, specific implementation codes of the methods are not given, and understanding of the technical scheme of the invention is not affected.
1. Importing a header file of a device access protocol (i.e., of an OC class to which an instance corresponding to theBluetooth Engine Module 201 in FIG. 2 belongs) and a header file of a device management class (i.e., of an OC class to which an instance of an external Bluetooth device in the external Bluetoothdevice management Module 203 in FIG. 2 belongs)
#import"DLBTDeviceJoinProtocol.h"
#import"DLBTDeviceManager.h"
2. Method for implementing protocol
The NSDictionary corresponds to a data structure for implementing the service dictionary.
Alternatively, a method for realizing an operation of registering the external bluetooth device instance itself to the bluetooth engine module is called in the initialization method of the external bluetooth device instance.
Optionally, the external bluetooth device comprises at least one of: bluetooth weighing scale, bluetooth toothbrush, bluetooth earphone, bluetooth mouse, bluetooth thermometer, bluetooth hygrometer, bluetooth barometer, bluetooth weighing machine, bluetooth sphygmomanometer.
Fig. 2 schematically shows a block schematic of an apparatus 200 for managing an external bluetooth device capable of communicating with an iOS device according to the present invention.
As shown in fig. 2, the apparatus 200 for managing an external bluetooth device capable of communicating with an iOS device according to the present invention includes:
abluetooth engine module 201 for searching for an external bluetooth device capable of communicating with a bluetooth device among the iOS devices, and storing device information of the searched or updated external bluetooth device;
an external bluetoothdevice management module 203, configured to subscribe the searched or updated device information of the external bluetooth device to a user-defined external bluetooth device instance from the bluetooth engine module, and receive and forward the subscribed device information and a user control command for the searched external bluetooth device using the external bluetooth device instance;
anAPP module 205 for receiving and displaying the forwarded subscribed device information, receiving, displaying and forwarding user control instructions,
wherein the external bluetooth devices comprise bluetooth devices of various different types and/or models, and each external bluetooth device instance corresponds to an instance of a user-defined external bluetooth device class corresponding to a bluetooth device of the same type and/or the same model having the same device information set and the same user control instruction set.
Alternatively, the external bluetooth device and the device information of the external bluetooth device are distinguished based on the MAC address of the external bluetooth device.
Optionally, the external bluetooth class or external bluetooth device instance implements a method (function or protocol) for implementing the following:
registering the external Bluetooth device class or the external Bluetooth device instance itself to a Bluetooth engine module to enable subscription for device information of the searched or updated external Bluetooth device and reception of user control instructions for the searched external Bluetooth device;
using a service dictionary to inform the Bluetooth engine module of the equipment information and the user control instruction which need to be monitored;
monitoring connection states of connections between the Bluetooth devices and the external Bluetooth devices, monitoring broadcast data sent by the external Bluetooth devices, and monitoring non-broadcast data sent by the external Bluetooth devices to monitor device information;
the user control command is forwarded to the bluetooth engine module via a write data interface provided by the bluetooth engine module.
Alternatively, a method for realizing an operation of registering the external Bluetooth device instance itself to the Bluetooth engine module is called in the initialization method of the external Bluetooth device instance,
wherein the apparatus 200 is provided in an iOS device.
Optionally, the external bluetooth device comprises at least one of: bluetooth weighing scale, bluetooth toothbrush, bluetooth earphone, bluetooth mouse, bluetooth thermometer, bluetooth hygrometer, bluetooth barometer, bluetooth weighing machine, bluetooth sphygmomanometer.
In order to make the technical solutions according to the present invention more clearly understood by those skilled in the art, the following description will be given with reference to specific embodiments.
Fig. 3 schematically shows an example of an apparatus 200 for managing an external bluetooth device capable of communicating with an iOS device according to the present invention.
As shown in fig. 3, this example mainly includes a bluetooth engine (i.e., the above-mentioned bluetooth engine module 201), a device class a-device class d (i.e., an external bluetooth device example used by the above-mentioned external bluetooth device management module 203), and an APP. The device classes a to d correspond to the devices a to d one by one, and the devices a to d report parameters (i.e., the device information) through a bluetooth protocol.
The bluetooth engine is responsible for searching for (external) bluetooth devices and binding the devices with user information after finding the devices. And sending the information reported by the equipment and the Bluetooth connection state of the equipment to a Bluetooth equipment class, and sending a command (namely, the user control instruction) issued by the equipment class to the Bluetooth equipment.
For example, parameters of a bluetooth weight scale include a weight value; the parameters of the Bluetooth toothbrush comprise a switch state and a vibration frequency; the parameters of the Bluetooth headset comprise a switch state and volume. The command for the bluetooth scale comprises a command to send a weight value; commands for the bluetooth toothbrush include switch commands, commands to adjust the vibration frequency; the command for the Bluetooth headset comprises a switch command and a command for adjusting volume.
For example, bluetooth engine 1) may distribute various device states to corresponding bluetooth device classes, which then provide the various device states (i.e., "device current various parameters" in fig. 3) to the APP; 2) and distributing various commands issued by the Bluetooth equipment to the corresponding Bluetooth equipment by the Bluetooth equipment. Therefore, the logic processing of the data flow is more visual and is easy to distinguish.
The Bluetooth device class is responsible for subscribing the device information, and can receive the device data updating information after subscribing.
When the state of each parameter of the Bluetooth equipment is updated, the Bluetooth engine is also responsible for informing the state update to the corresponding Bluetooth equipment class.
Where each bluetooth device class is an abstraction of a specific bluetooth device (e.g., the same class of bluetooth devices where control commands and device information are the same). For example, bluetooth devices can be distinguished by MAC addresses, thereby implementing device-specific management.
The APP is responsible for using the command sending interface to send commands to the equipment class; and is responsible for receiving the various device states from the Bluetooth device class and conveniently displaying various parameters (states) of the device.
According to the technical scheme of the invention, the device information corresponding to different external Bluetooth devices can be automatically returned or the instructions aiming at different external Bluetooth devices are issued, the logic processing operation is intuitive, and various (accessed) different external Bluetooth devices can be conveniently managed under the iOS system. The uplink and downlink data (namely, the Bluetooth connection state reporting data and the control instruction issuing data) of different external Bluetooth devices can be processed uniformly, and each device can be concentrated on realizing other logic functions.
According to the technical scheme of the invention, various Bluetooth devices can be easily supported, and data reporting, command issuing and connection state display of the Bluetooth devices are simply processed.
The above-described aspects may be implemented individually or in various combinations, and such variations are within the scope of the present invention.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
Finally, it should be noted that: the above examples are only for illustrating the technical solutions of the present invention, and are not limited thereto. 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; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.