Ejemplo n.º 1
0
 def setUp(self):
     self.sensor = Omron2JCIE_BU01.ble(self.ADDRESS)
Ejemplo n.º 2
0
    - 275
    - 374

    If you need scan on Linux, consider notify method.
    ---
    On Windows, data can be detected at intervals of 1 second or less.
    And complete data will be obtained about every 1 second.
"""
import sys
sys.path.insert(0, "../lib-ext")
sys.path.insert(0, "..")

from omron_2jcie_bu01 import Omron2JCIE_BU01

#s = Omron2JCIE_BU01.ble("AA:BB:CC:DD:EE:FF")
s = Omron2JCIE_BU01.ble()


# Scan
def on_scan(data):
    print(data)


# Set Advertising mode: 0x03 (Active scan)
# The setting is retained even when the power is turned off the device.
s.advertise_setting(mode=0x03)

# Scanning needs to disconnect
# If connected, advertising packets will not be detected.
s.disconnect()
Ejemplo n.º 3
0
 def setUpClass(cls):
     sensor = Omron2JCIE_BU01.ble()
     cls.ADDRESS = sensor.address
     print(f"Target HW address: {cls.ADDRESS}")