CN108966195A - Wireless gyroscope software implementation method based on wechat small routine - Google Patents

Wireless gyroscope software implementation method based on wechat small routine Download PDF

Info

Publication number
CN108966195A
CN108966195A CN201810856583.6A CN201810856583A CN108966195A CN 108966195 A CN108966195 A CN 108966195A CN 201810856583 A CN201810856583 A CN 201810856583A CN 108966195 A CN108966195 A CN 108966195A
Authority
CN
China
Prior art keywords
data
bluetooth
small routine
equipment
gyroscope
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
CN201810856583.6A
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.)
Shenzhen City Xin Ken Intelligent Electronic Ltd By Share Ltd
Original Assignee
Shenzhen City Xin Ken Intelligent Electronic Ltd By Share 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 Shenzhen City Xin Ken Intelligent Electronic Ltd By Share Ltd filed Critical Shenzhen City Xin Ken Intelligent Electronic Ltd By Share Ltd
Priority to CN201810856583.6A priority Critical patent/CN108966195A/en
Publication of CN108966195A publication Critical patent/CN108966195A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/52User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail for supporting social networking services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/131Protocols for games, networked simulations or virtual reality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]

Abstract

The wireless designing gyroscope method based on wechat small routine that the present invention relates to a kind of, this method has invoked the initialization Bluetooth adapter of small routine API first, then call small routine API's to start search equipment periphery bluetooth equipment, and the device id of specified bluetooth equipment is obtained by a series of method, service ID, characteristic value ID, the connection of bluetooth equipment and mobile terminal is completed according to the ID that these get, and obtain and listen to the data of Bluetooth transmission, the processing of last general data, gets the attitude data of gyroscope apparatus.Compared with art methods, present invention reduces the difficulty of acquisition for mobile terminal Bluetooth gyroscope data, it is not required in addition download installation app, only need to can gets the small routine by wechat app, substantially increase the efficiency of acquisition.

Description

Wireless gyroscope software implementation method based on wechat small routine
Technical field
The invention belongs to internet development technique fields, wechat small routine are based particularly on, by way of bluetooth connection Connection is established with gyro module, and in small routine interface real-time display gyroscope measurement data.
Background technique
Gyro-stabilized platform is one of core component of inertial navigation, can isolate the disturbance of carrier and keeps its stabilization Property.Gyro-stabilized platform has the accuracy of sea survey important meaning, can be by being combined with matching for other equipment At a Li Pingcheshi closed-circuit system, to complete the function in automatic amendment direction.Gyro module has weight for stabilized platform The effect wanted can get the attitude data of stabilized platform, root by the gyro module being placed on stabilized platform in real time Pitch angle, the course angle, rotation angle of stabilized platform can be adjusted in real time according to the attitude data, to make to carry intracorporal stabilization flat to reach The purpose that platform keeps relative stability.
The invention proposes a kind of mobile handheld terminal equipment that can be used can obtain the software of gyro data in real time Implementation method.Wechat small routine is opened by barcode scanning, the appearance of Bluetooth gyroscope can be got by completing simple bluetooth connection State data are easy to use quick, and support bluetooth BLE4.0 equipment, have low latency and overlength and effectively connect the excellent of distance Point.
Summary of the invention
It is small by wechat the purpose of the present invention is to provide a kind of method of simple and fast acquisition Bluetooth gyroscope data The platform of program realizes the function of obtaining gyroscope attitude data in real time.The various API provided by wechat public platform, it is complete At the realization of small routine basic function, the search and connection of initialization, bluetooth equipment including Bluetooth adapter, bluetooth equipment it Between Data transmitting and receiving.
The purpose of the present invention can be achieved through the following technical solutions:
A kind of wireless gyroscope software implementation method based on wechat small routine, which is characterized in that comprise the steps of:
In a kind of above-mentioned wireless gyroscope software implementation method based on wechat small routine, the step 2, get Bluetooth equipment ID should include six hexadecimal datas, and be separated before data with colon.
In a kind of above-mentioned wireless gyroscope software implementation method based on wechat small routine, the step 3, obtain To designated equipment service ID should be a string include 32 binary data long data.
In a kind of above-mentioned wireless gyroscope software implementation method based on wechat small routine, the step 4, obtain To designated equipment specified services characteristic value ID should be a string include 32 binary data long data.
In a kind of above-mentioned wireless gyroscope software implementation method based on wechat small routine, the step 5, feature Value can have the action type of multiple supports, and selection includes the characteristic value of notify action type.
In a kind of above-mentioned wireless gyroscope software implementation method based on wechat small routine, the step 6, it is necessary to The wx.notifyBLECharacteristicValueChangeAPI of first invocation step 5 can successfully call small routine The wx.onBLECharacteristicValueChange of API.
Beneficial effects of the present invention: compared with prior art, the present invention can not have to install remaining program, save storage Space and get the small routine method it is easy and quick, by this medium of wechat, can effectively utilize user's Circle of friends carries out the popularization of program, promotes cost and in comparison decreases.After using this small routine, it can substantially reduce The degree of difficulty for obtaining Bluetooth gyroscope equipment attitude data, can timely and effectively get real time data, it is suitable to increase The range of crowd, can be subject to by more people using, and support bluetooth BLE4.0 equipment, greatly improve the connection of bluetooth Range and the power consumption for reducing bluetooth equipment.
Detailed description of the invention
Fig. 1 is the flow chart of the method for the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Embodiment:
As shown in Fig. 1 method course figure:
Step 1, the bluetooth establishing device for initializing mobile terminal device, by calling small routine API's Wx.openBluetoothAdapter and wx.getBluetoothAdapterState is returned successful if calling successfully Call back function, the Bluetooth adapter information by printing mobile terminal device on console judge the equipment bluetooth whether It can use.
Step 2, the bluetooth for opening mobile terminal device searches plain function, starts the bluetooth equipment for searching for equipment periphery, passes through The wx.startBluetoothDevicesDiscovery and wx.getBluetoothDevices of small routine API are called, if It opens and successfully then returns to successful call back function, and print the information of the periphery bluetooth equipment searched on console, wrap The title and device id for including equipment find specified bluetooth equipment according to the title of equipment, and record its device id, i.e., deviceId。
Step 3, the service ID for obtaining the bluetooth equipment searched, by calling small routine API's Wx.getBLEDeviceServices, and the parameter for giving the function to be passed to a device id, what which got The device id of specified bluetooth equipment calls API success then to return to successful call back function and print readjustment on console The service parameter of function stores the service ID of equipment, i.e. serviceId in the parameter, meets function by testing selection The service ID of energy demand simultaneously records the value.
Step 4, the characteristic value ID for obtaining specified bluetooth equipment specified services, by calling small routine API's Wx.getBLEDeviceCharacteristicId, and two parameters are passed to the function, one is setting of getting of step 2 Standby ID, the other is the service ID for the equipment that step 3 is got, call API success then return successful call back function and The characteristics parameter of call back function is printed on console, which contains the characteristic value ID of bluetooth equipment, is somebody's turn to do Characteristic value support action type, wherein characteristic value support action type include four kinds, be respectively read, write, The characteristic value ID of notify action type is supported in notify, indicate, selection, and records this feature value ID.
Step 5, the notify function of bluetooth low energy device characteristic value variation is enabled, calls small routine API's Wx.notifyBLECharacteristicValueChange, and three parameters are passed to the function, it is Step 2: step respectively Rapid three, the device id that step 4 is got services ID, characteristic value ID.Successful call back function is then returned after calling API success And the Bluetooth adapter state of the machine is printed on console, whether real time monitoring bluetooth works normally.
Step 6, the characteristic value variation for monitoring bluetooth low energy device, calls small routine API's Wx.onBLECharacteristicValueChange, and to the function be passed to three parameters, be respectively Step 2: Step 3: The device id that step 4 is got services ID, characteristic value ID.Success can return to successful call back function after calling, wherein Contain required blue-teeth data, i.e. the gyroscope apparatus data packet that is transferred to mobile terminal.
Step 7, the processing and pairing of data, the data packet of general gyroscope apparatus transmission are carried out to the data packet received It is stored in an array, what the first two data of array were stored is packet header and the flag bit of data packet of data packet, number respectively What rear several data of group were stored respectively is data relevant to attitude data, and after being matched by data, data are substituted into respectively Formula is calculated, and finally obtains the attitude data of gyroscope.
Eventually by the design method of the small routine, mobile terminal is realized by small routine and gets external bluetooth in real time The attitude data of gyroscope apparatus, and be shown on the display interface of terminal device.
The present invention, which passes a test, detects that the small routine can run on the mobile terminal of a variety of types and successfully obtain outer The attitude data of Bluetooth gyroscope is set, and without installing extra program, only need to search for the small routine by wechat APP, Plug and play reduces cost and time that user obtains the program, improves the efficiency for obtaining Bluetooth gyroscope attitude data.
It although an embodiment of the present invention has been shown and described, for the ordinary skill in the art, can be with A variety of variations, modification, replacement can be carried out to these embodiments without departing from the principles and spirit of the present invention by understanding And modification, the scope of the present invention is defined by the appended.

Claims (6)

1. a kind of wireless gyroscope software implementation method based on wechat small routine, which is characterized in that including Bluetooth adapter Data transmitting and receiving between initialization, the search and connection, bluetooth equipment of bluetooth equipment;
Step 1, the bluetooth establishing device of mobile terminal device is initialized;
Step 2, the bluetooth for opening mobile terminal device searches plain function, starts the bluetooth equipment for searching for equipment periphery, obtains bluetooth Device id;
Step 3, the service ID of the bluetooth equipment searched is obtained;
Step 4, the characteristic value ID of specified bluetooth equipment service is obtained;
Step 5, the notify function of bluetooth low energy device characteristic value variation is enabled, whether real time monitoring bluetooth works normally;
Step 6, the connection of bluetooth equipment and mobile terminal is completed according to the ID got above, and is obtained and listened to bluetooth biography Defeated data packet;
Step 7, the processing of general data gets the attitude data of gyroscope apparatus.
2. a kind of wireless gyroscope software implementation method based on wechat small routine according to claim 1, feature exist In: in the step 1, the bluetooth establishing device of mobile terminal device is initialized, by calling small routine API's Wx.openBluetoothAdapter and wx.getBluetoothAdapterState judges that the equipment bluetooth whether may be used Use
A kind of wireless gyroscope software implementation method based on wechat small routine according to claim 1, it is characterised in that: In the step 2, the bluetooth equipment ID got is to be separated comprising six hexadecimal data, and before data with colon.
3. a kind of wireless gyroscope software implementation method based on wechat small routine according to claim 1, feature exist In: in the step 3, the service ID of bluetooth equipment is obtained by calling the wx.getBLEDeviceServices of small routine API The device service ID got be a string include 32 binary data long data.
4. a kind of wireless gyroscope software implementation method based on wechat small routine according to claim 1, feature exist In: in the step 4, the characteristic value ID of the designated equipment service got should be a string of length comprising 32 binary data Data.
5. a kind of wireless gyroscope software implementation method based on wechat small routine according to claim 1, feature exist In: in the step 5, characteristic value can have the action type of multiple supports, and selection includes the characteristic value of notify action type ?.
6. a kind of wireless gyroscope software implementation method based on wechat small routine according to claim 1, feature exist In: in the step 6 and the step 7, the processing and pairing of data, gyroscope apparatus transmission are carried out to the data packet received Data packet be stored in an array, the storage of the first two data of array be respectively data packet packet header and the mark of data packet Will position, what rear several data of array were stored respectively is data relevant to attitude data, after being matched by data, by data point Not Dai Ru formula calculated, finally obtain the attitude data of gyroscope.
CN201810856583.6A 2018-07-31 2018-07-31 Wireless gyroscope software implementation method based on wechat small routine Pending CN108966195A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810856583.6A CN108966195A (en) 2018-07-31 2018-07-31 Wireless gyroscope software implementation method based on wechat small routine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810856583.6A CN108966195A (en) 2018-07-31 2018-07-31 Wireless gyroscope software implementation method based on wechat small routine

Publications (1)

Publication Number Publication Date
CN108966195A true CN108966195A (en) 2018-12-07

Family

ID=64466681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810856583.6A Pending CN108966195A (en) 2018-07-31 2018-07-31 Wireless gyroscope software implementation method based on wechat small routine

Country Status (1)

Country Link
CN (1) CN108966195A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110248216A (en) * 2019-06-03 2019-09-17 广东有线广播电视网络有限公司 TV throws screen method, apparatus, TV throws screen system and computer equipment
CN110913380A (en) * 2019-12-19 2020-03-24 飞天诚信科技股份有限公司 Method and device for communicating with Bluetooth device based on applet platform
CN112135286A (en) * 2020-10-12 2020-12-25 四川长虹电器股份有限公司 Method and device for improving transmission efficiency based on Bluetooth firmware upgrading
CN117412263A (en) * 2023-12-14 2024-01-16 深圳硅山技术有限公司 Bluetooth and vehicle-mounted black box interaction method, system and equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105326493A (en) * 2015-11-05 2016-02-17 深圳市冠旭电子有限公司 Method and system for monitoring heart rate based on wearable electronic equipment
CN105476662A (en) * 2014-10-09 2016-04-13 陈超敏 Low-power-consumption wireless Bluetooth data transmission technology for gravida and fetus monitoring
CN105691492A (en) * 2016-04-22 2016-06-22 无锡华普微电子有限公司 Electric vehicle anti-theft alarming system integrated with WeChat control function and keyless starting function
CN105686833A (en) * 2016-01-13 2016-06-22 上海交通大学 Wearable multinode three dimensional motion monitoring system based on wireless body area network
CN107180464A (en) * 2017-05-04 2017-09-19 深圳家美达科技有限公司 A kind of smart lock method for unlocking and the system using this method
CN107490135A (en) * 2017-08-23 2017-12-19 四川长虹电器股份有限公司 A kind of domestic air-conditioning system and its control method for supporting complicated timing function
CN107970574A (en) * 2016-10-25 2018-05-01 四川理工学院 A kind of running body-building system and its data processing method based on Android platform

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105476662A (en) * 2014-10-09 2016-04-13 陈超敏 Low-power-consumption wireless Bluetooth data transmission technology for gravida and fetus monitoring
CN105326493A (en) * 2015-11-05 2016-02-17 深圳市冠旭电子有限公司 Method and system for monitoring heart rate based on wearable electronic equipment
CN105686833A (en) * 2016-01-13 2016-06-22 上海交通大学 Wearable multinode three dimensional motion monitoring system based on wireless body area network
CN105691492A (en) * 2016-04-22 2016-06-22 无锡华普微电子有限公司 Electric vehicle anti-theft alarming system integrated with WeChat control function and keyless starting function
CN107970574A (en) * 2016-10-25 2018-05-01 四川理工学院 A kind of running body-building system and its data processing method based on Android platform
CN107180464A (en) * 2017-05-04 2017-09-19 深圳家美达科技有限公司 A kind of smart lock method for unlocking and the system using this method
CN107490135A (en) * 2017-08-23 2017-12-19 四川长虹电器股份有限公司 A kind of domestic air-conditioning system and its control method for supporting complicated timing function

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CUIRAN: "微信小程序 蓝牙实现", 《HTTPS://BLOG.CSDN.NET/CUIRAN/ARTICLE/DETAILS/78579309》 *
极乐叔: "微信小程序--蓝牙连接开发总结", 《HTTPS://WWW.JIANSHU.COM/P/0B41D9FF7ABC》 *
林禄焱: "微信小程序实现连接蓝牙设备跑步APP", 《HTTPS://SEGMENTFAULT.COM/A/1190000012982970》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110248216A (en) * 2019-06-03 2019-09-17 广东有线广播电视网络有限公司 TV throws screen method, apparatus, TV throws screen system and computer equipment
CN110248216B (en) * 2019-06-03 2021-06-01 广东有线广播电视网络有限公司 Television screen projection method and device, television screen projection system and computer equipment
CN110913380A (en) * 2019-12-19 2020-03-24 飞天诚信科技股份有限公司 Method and device for communicating with Bluetooth device based on applet platform
CN110913380B (en) * 2019-12-19 2023-09-22 飞天诚信科技股份有限公司 Method and device for communication with Bluetooth equipment based on applet platform
CN112135286A (en) * 2020-10-12 2020-12-25 四川长虹电器股份有限公司 Method and device for improving transmission efficiency based on Bluetooth firmware upgrading
CN117412263A (en) * 2023-12-14 2024-01-16 深圳硅山技术有限公司 Bluetooth and vehicle-mounted black box interaction method, system and equipment
CN117412263B (en) * 2023-12-14 2024-03-15 深圳硅山技术有限公司 Bluetooth and vehicle-mounted black box interaction method, system and equipment

Similar Documents

Publication Publication Date Title
CN108966195A (en) Wireless gyroscope software implementation method based on wechat small routine
US9692914B2 (en) Devices and method for tagging media
CN103501333B (en) Method, device and terminal equipment for downloading files
US20120202428A1 (en) Systems and Methods for Defining Group of Users with Mobile Devices
US20050149564A1 (en) Remote management and access of databases, services and devices associated with a mobile terminal
US20120202551A1 (en) Systems and Methods for Group Information Server Among Mobile Devices
CN111132101B (en) Positioning interaction method and device
CN106296255A (en) Page info methods of exhibiting and device
CN104185141A (en) Bluetooth beacon device based system and method for detecting stay time of user in area
CN104994077A (en) Wireless local area network access equipment identity marking method and device
CN103108380A (en) Method and device for providing network connection
CN102065183A (en) Mobile phone and image pickup processing method thereof
CN106375179A (en) Method and device for displaying instant communication message
CN107635069A (en) UART and USB multiplex circuits and mobile terminal
CN106649010A (en) Terminal device testing method and terminal device
EP2671406A2 (en) Systems and methods for audio roaming for mobile devices, group information server among mobile devices, and defining group of users with mobile devices
CN103345786A (en) Automatic sign-in method based on WIFI network
CN107678989A (en) UART and USB multiplex circuits and mobile terminal
CN1852326B (en) Method for obtaining mobile game for mobile terminal
CN103064772B (en) A kind of mobile terminal test method and system
CN109002547A (en) Journal file storage method, mobile terminal and computer readable storage medium
CN101076155B (en) Method for connecting cell phone with wire network
CN109061611A (en) Proximity sensor calibration method and relevant apparatus
CN103840859A (en) Method, terminal and system for transmitting files
CN103227832B (en) Share method for processing resource and device

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

Address after: 518000 New Development Zone of Baishixia East District, Fuyong Street, Baoan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Xinzhen Intelligent Electronics Co., Ltd.

Address before: 518000 New Development Zone of Baishixia East District, Fuyong Street, Baoan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen City Xin Ken intelligent electronic Limited by Share Ltd

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181207