Esempio n. 1
0
def humidity_data_callback(data):
    """Capture any data and print them to stdout"""
    uv_info = sense_pb2.UV().FromString(data)
    print('data: {0}'.format(uv_info))
Esempio n. 2
0
def uv_data_callback(data):
    # Extract data
    data = sense_pb2.UV().FromString(data[0])
    # Log data
    print('{0}'.format(data))
Esempio n. 3
0
def uv_data_callback(data):
    """Capture data and print it to stdout"""
    uv_info = sense_pb2.UV().FromString(data[0])
    print('{0}'.format(uv_info))
Esempio n. 4
0
import os
import sys

from docopt import docopt
from matrix_io.proto.malos.v1 import driver_pb2
from matrix_io.proto.malos.v1 import sense_pb2, io_pb2
from matrix_io.proto.vision.v1 import vision_pb2

from matrix_io.malos import driver
""" Driver to proto message mappings """
DRIVER_PROTOS = {
    'HUMIDITY': sense_pb2.Humidity(),
    'IMU': sense_pb2.Imu(),
    'MICARRAY_ALSA': io_pb2.MicArrayParams(),
    'PRESSURE': sense_pb2.Pressure(),
    'UV': sense_pb2.UV(),
    'VISION': vision_pb2.VisionResult()
}


async def data_handler(malos_driver, driver_name):
    """
    Sample coroutine accessing the MALOS driver data generator

    Args:
        malos_driver: MALOSDriver instance
        driver_name: driver name as a string (IMU, UV, PRESSURE)

    Returns:
        None
    """