Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

base-node-rpc

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-node-rpc - npm Package Compare versions

Comparing version
0.16.post3
to
0.17
+0
-0
base_node_rpc/Arduino/base_node_rpc/Node.h

@@ -0,0 +0,0 @@ #ifndef ___NODE__H___

+1
-1
/* #########################################################################
* [2016-08-11 15:12:58.613000] THIS FILE IS AUTOGENERATED - DO NOT EDIT!
* [2016-11-16 14:13:44.545000] THIS FILE IS AUTOGENERATED - DO NOT EDIT!
* ######################################################################### */

@@ -5,0 +5,0 @@

@@ -0,0 +0,0 @@ from arduino_helpers.upload import upload, parse_args

# ############################################################################
# [2016-08-11 15:13:00.575000] THIS FILE IS AUTOGENERATED - DO NOT EDIT!
# [2016-11-16 14:13:46.176000] THIS FILE IS AUTOGENERATED - DO NOT EDIT!
# ############################################################################

@@ -5,0 +5,0 @@ import types

@@ -377,3 +377,3 @@ from datetime import datetime

@cmdopts([('sconsflags=', 'f', 'Flags to pass to SCons.'),
('boards=', 'b', 'Comma-separated list of board names to compile '
('boards=', 'B', 'Comma-separated list of board names to compile '
'for (e.g., `uno`).')])

@@ -402,3 +402,10 @@ def build_firmware():

@task
@needs('build_arduino_library', 'build_firmware', 'generate_setup', 'minilib',
'setuptools.command.bdist_wheel')
def bdist_wheel():
"""Overrides bdist_wheel to make sure that our setup.py is generated."""
pass
@task

@@ -405,0 +412,0 @@ @needs('generate_library_main_header', 'generate_protobuf_c_code',

@@ -0,0 +0,0 @@ import warnings

@@ -91,6 +91,6 @@ import time

'manufacturer', 'url',
'software_version']
'software_version',
'hardware_version',
'id', 'uuid']
if hasattr(self, k)])
for k in ['id', 'uuid']:
properties[k] = getattr(self, k)
return pd.Series(properties, dtype=object)

@@ -97,0 +97,0 @@

@@ -0,0 +0,0 @@ import time

Metadata-Version: 2.0
Name: base-node-rpc
Version: 0.16.post3
Version: 0.17.post1
Summary: Provides: 1) A memory-efficient set of base classes providing an API to most of the Arduino API, including EEPROM access, raw I2C master-write/slave-request, etc., and 2) Support for processing RPC command requests through either serial or I2C interface. Utilizes Python (host) and C++ (device) code generation from the `arduino_rpc` (http://github.com/wheeler-microfluidics/arduino_rpc.git) package.

@@ -5,0 +5,0 @@ Home-page: http://github.com/wheeler-microfluidics/base_node_rpc.git

@@ -1,1 +0,1 @@

{"extensions": {"python.details": {"contacts": [{"email": "christian@fobel.net", "name": "Christian Fobel", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://github.com/wheeler-microfluidics/base_node_rpc.git"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "license": "GPLv2", "metadata_version": "2.0", "name": "base-node-rpc", "run_requires": [{"requires": ["arduino-rpc (>=1.7.post19)", "arduino-scons (>=0.1.post10)", "path-helpers", "protobuf (>=2.6.1)"]}], "summary": "Provides: 1) A memory-efficient set of base classes providing an API to most of the Arduino API, including EEPROM access, raw I2C master-write/slave-request, etc., and 2) Support for processing RPC command requests through either serial or I2C interface. Utilizes Python (host) and C++ (device) code generation from the `arduino_rpc` (http://github.com/wheeler-microfluidics/arduino_rpc.git) package.", "version": "0.16.post3"}
{"extensions": {"python.details": {"contacts": [{"email": "christian@fobel.net", "name": "Christian Fobel", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://github.com/wheeler-microfluidics/base_node_rpc.git"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "license": "GPLv2", "metadata_version": "2.0", "name": "base-node-rpc", "run_requires": [{"requires": ["arduino-rpc (>=1.7.post19)", "arduino-scons (>=0.1.post10)", "path-helpers", "protobuf (>=2.6.1)"]}], "summary": "Provides: 1) A memory-efficient set of base classes providing an API to most of the Arduino API, including EEPROM access, raw I2C master-write/slave-request, etc., and 2) Support for processing RPC command requests through either serial or I2C interface. Utilizes Python (host) and C++ (device) code generation from the `arduino_rpc` (http://github.com/wheeler-microfluidics/arduino_rpc.git) package.", "version": "0.17.post1"}
+38
-43

@@ -1,47 +0,42 @@

base_node_rpc/Test SerialProxy connection.ipynb,sha256=_PBOJ_H5CM10dH_DGxmpyxp6v2jIKr2_GAbAvrF76JQ,1258
base_node_rpc/__init__.py,sha256=_Iny2egsv_g3iS7ucijcNGHCsCj0MCjZ4wWG3EYPiPM,1749
base_node_rpc/node.py,sha256=uu8VpVLiDM8wRcfUVABrsc5dTIFbIHTQexbI5qV7ADE,29522
base_node_rpc/pavement_base-proposed.py,sha256=GLL0vMWanpL1_Vt7sepDfKETGd6H2XX5PmbNJayb-4A,32374
base_node_rpc/pavement_base.py,sha256=OPF139rcSdH8dQjFyKVkqRta40LWldnvsYr_98RxMwU,18036
base_node_rpc/pavement_base.py~,sha256=otMp85kkZ94LpOd_djcX0d1zpx9w4V4erI8cPDDs91A,15256
base_node_rpc/protobuf.py,sha256=1hRLZT1fziFFrD5rJu2DnzrZ532uZAsI6sX9CVkR8fs,7688
base_node_rpc/proxy.py,sha256=EeUSvNmGHtiu7InZthXV6gqC2ozoQVoijtscmOQV0vQ,13546
base_node_rpc/queue.py,sha256=E66eevtGi5uQq1lq86g8CIJ5_cupyDN1l08PER6HAFA,3114
base_node_rpc/.ipynb_checkpoints/Test SerialProxy connection-checkpoint.ipynb,sha256=HuE8BUJ9rMNJPgg6G4FuQBivGz00Yh6kyNWuatt283g,1984
base_node_rpc/Arduino/base_node_rpc/Node.h,sha256=xzUA5rP4eFynDqQWY9LbGluuKTXW0vPy-tQlXSUaL5o,1024
base_node_rpc/Arduino/base_node_rpc/NodeCommandProcessor.h,sha256=0GZzyeP_dHwUTt6hib1kuDSSkEIFgrjFjh1YWhKTMWg,409
base_node_rpc/node.py,sha256=BEQvHqe3nnVUih9yTFOuBfK3CbRFP1FUKtGc1h8XL0A,29522
base_node_rpc/pavement_base.py,sha256=7f50EXmbSRl4dgOc55mS9H6i8HZqh-chv8t3XvpKLJE,18275
base_node_rpc/protobuf.py,sha256=GtknOWOdgXYH8ElfpC9640L2XjmOHuhw_KjO8TOiFtQ,7879
base_node_rpc/proxy.py,sha256=f-6Y9nWq3lAUMCgJN0WGm5oYQNxXHR6OjPB5vfpuCU0,13598
base_node_rpc/queue.py,sha256=eKygjIZIoKDrAv4bQdMLy2RDSdSV2j3F0_eGS0j8CWM,3216
base_node_rpc/Arduino/base_node_rpc/Node.h,sha256=n5KbW87iHLCO-4cXZcU0NweeCVMLD5XzmkD2OVFs79k,1062
base_node_rpc/Arduino/base_node_rpc/NodeCommandProcessor.h,sha256=MURz-WE6uBRajXfYYLkEQbKlk8opPl0HAi9TZs_xasA,409
base_node_rpc/Arduino/base_node_rpc/RPCBuffer.h,sha256=BYbuaGt1S_2YztlrHR_LdTRpqXgRi3mMBrUHhZuzY-o,1132
base_node_rpc/Arduino/base_node_rpc/RPCBuffer.ht,sha256=ijOeDzWV6klfpn_tzROHJQO7OAJGx3XOHXuB-35GbqY,765
base_node_rpc/Arduino/base_node_rpc/RPCBuffer.ht,sha256=Asc1zOzoBqUjxSmmYG9jrBtOF-nYCboNThoxZF2yUuQ,794
base_node_rpc/Arduino/base_node_rpc/SConscript,sha256=SzzP44MWjsCfZUo25DjeOgYg5_ySAMG9-sb0QqWzJHo,1098
base_node_rpc/Arduino/base_node_rpc/base_node_rpc.ino,sha256=flCe6haPJFyN5TLQ6OZ5pfKw9UIBE8kvc3Tr36wuVUc,1133
base_node_rpc/Arduino/library/BaseNodeRpc.zip,sha256=aywsrkyNiFV9AgJfOmO-1pAF8pmX2o90qtDleQQcosE,63289
base_node_rpc/Arduino/library/BaseNodeRpc/library.properties,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseBuffer.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseHandler.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNode.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeConfig.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeEeprom.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeI2c.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeI2cHandler.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodePb.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeRpc.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeSerialHandler.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeSpi.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeState.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/CommandProcessor.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/Commands.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/I2cHandler.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/Properties.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/SerialHandler.h,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/Arduino/base_node_rpc/base_node_rpc.ino,sha256=b8FbHaGOiLEMuzJikYnmiZ4_TC8pLlg2f-IXaUNGZns,1176
base_node_rpc/Arduino/library/BaseNodeRpc.zip,sha256=U8AsoWh-fQ3hxRUlzpz5C1qAvktN5bbtoymQOzZ__2k,63289
base_node_rpc/Arduino/library/BaseNodeRpc/library.properties,sha256=733sd3DO1NMPmqkZ_3poz_54Q8C0X6SVgeQt6jHEVrs,689
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc.h,sha256=PkpkjKn4UDp9UbVs0iBBajfyfCpd0yh8pbxi3yFG7KY,104
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseBuffer.h,sha256=P85opo-Stm5nvQTgsFQevft_dEXAqm6r_RiUOZXw1tg,200
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseHandler.h,sha256=vseMALfXYbH3ZjkCtHnjqiSlgnGLV1U23UcuwXul0jo,2446
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNode.h,sha256=jxRdhkGMdcQemMy_Q2IQUxHJy1esIIphTiOC-Zc0sfw,3128
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeConfig.h,sha256=96PbwEMBJ1oPCB7A39SgHTl1KUDJb_0QdqgkyhDyGc0,1725
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeEeprom.h,sha256=6m-QmOAqAag91q6bYUBEw1XyhoB3Hq9sA6yPZ0ImCiI,724
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeI2c.h,sha256=tWhtjYQRm_bbgoPnZTTct_2cD7NKTwdClYggmpeHMdY,2519
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeI2cHandler.h,sha256=fL2q7s0PTYsoxUphMH_mWrB9ZFCoq-hNwfg94SWqgwY,723
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodePb.h,sha256=htCP4Hrg_qjJKNnFQPQCYHog08nnPnE9kkm3S33Xh70,219
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeRpc.h,sha256=d8ZGQugEh51YewMcdvdjkMKBobZemh5jzQBE9TAPP5U,264
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeSerialHandler.h,sha256=OjEw8LKZaQktLzM5p0uLnJOoxyfnXKT0K3AibDl24Jo,532
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeSpi.h,sha256=FyJF-J44Wd50QN8bbTROYuNViYLRb_52GB-zfrL3wLk,539
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/BaseNodeState.h,sha256=4yLs-Q3JDxDDuIrcgrSGb3P7txiBHUMhs1ZIBAly-vk,564
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/CommandProcessor.h,sha256=JzrWhfHVvltuSjWd9APZd-dYURPHVQglP6Brd_JupVo,29044
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/Commands.h,sha256=VWbmXq7NNSfhptMRn81kyGs97_0NSnIzpIUFWB6oIxw,9214
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/I2cHandler.h,sha256=111ntTdDn8-9Mr5t5X1L1oHosUGzIzm8x3Nbcay351o,5168
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/Properties.h,sha256=mWJ7MUd0Zo451JIWnepqjoJ7ajU878SvxzbJcJ2tuSQ,916
base_node_rpc/Arduino/library/BaseNodeRpc/src/BaseNodeRpc/SerialHandler.h,sha256=4fSESZONMjSOw9Z8bI8KSATetF4aqbIg9185kJgeXnY,2005
base_node_rpc/bin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
base_node_rpc/bin/upload.py,sha256=8K-I44pS64n-chaauNCVdHUdrFElxWldA9U7g1aVz4k,289
base_node_rpc/firmware/mega2560/base_node_rpc.hex,sha256=NbCAEwHL2IA6iXbQUuEZvVzpcLwidB69zy--Ws5Bxnc,34361
base_node_rpc/firmware/uno/base_node_rpc.hex,sha256=t_x_TlNgUXQ-6mujxaUbV6PomKeHQFYJo-DTDgU_XcM,31780
base_node_rpc-0.16.post3.dist-info/DESCRIPTION.rst,sha256=OCTuuN6LcWulhHS3d5rfjdsQtW22n7HENFRh6jC6ego,10
base_node_rpc-0.16.post3.dist-info/METADATA,sha256=rzWw-zxuNK8rxYixd0wC0_9iJiC21Lyh_EK-EvmK8WU,809
base_node_rpc-0.16.post3.dist-info/RECORD,,
base_node_rpc-0.16.post3.dist-info/WHEEL,sha256=90z-L1FjHEv_g8pMPaPbaXuhBIvSlvYObRaa122x8ag,97
base_node_rpc-0.16.post3.dist-info/metadata.json,sha256=5bMsG9nVuM5oCfsSLzyWhoRsnXmbj6S-9xpbBjkcwHM,968
base_node_rpc-0.16.post3.dist-info/pbr.json,sha256=tu-B8G_V9LX4YhjwKlbpBCmXVkz_R6lw3Pi8iSLX34s,46
base_node_rpc-0.16.post3.dist-info/top_level.txt,sha256=3kO4wp_RBBUIbSeAnACRT-GeHFL8pG8vpsk_G3BFcDI,14
base_node_rpc/bin/upload.py,sha256=5kmR-iDbcws11J-viXMXp72Y77KT86sgvm15fYEPHxE,299
base_node_rpc/firmware/mega2560/base_node_rpc.hex,sha256=UkMmpHJAs6JIiyEslr8GBFID8O32pscgs_DV2EVetV8,34885
base_node_rpc/firmware/uno/base_node_rpc.hex,sha256=7fwiN90jP3KNKV3xq2lF7QmuIkN8FhiQnDwlO12roZo,32291
base_node_rpc-0.17.post1.dist-info/DESCRIPTION.rst,sha256=OCTuuN6LcWulhHS3d5rfjdsQtW22n7HENFRh6jC6ego,10
base_node_rpc-0.17.post1.dist-info/METADATA,sha256=UeNnqeIO7Tp7CnIu-1zimL0DXmi84B4blj7f_vyQ0aI,809
base_node_rpc-0.17.post1.dist-info/RECORD,,
base_node_rpc-0.17.post1.dist-info/WHEEL,sha256=90z-L1FjHEv_g8pMPaPbaXuhBIvSlvYObRaa122x8ag,97
base_node_rpc-0.17.post1.dist-info/metadata.json,sha256=7sXhQE_O1BaK8u-sKvoPTdMxATd8n3gmKbPaHbcEpKc,968
base_node_rpc-0.17.post1.dist-info/top_level.txt,sha256=3kO4wp_RBBUIbSeAnACRT-GeHFL8pG8vpsk_G3BFcDI,14

Sorry, the diff of this file is not supported yet

��from datetime import datetime
import warnings
from paver.easy import task, needs, path, sh, cmdopts, options
import base_node_rpc
try:
from arduino_rpc.pavement_base import *
except ImportError:
# Ignore import error to allow import during installation of
# `base-node-rpc` (i.e., prior to the installation of `arduino-rpc` through
# install dependencies).
LIB_CMDOPTS = None
LIB_GENERATE_TASKS = None
DEFAULT_BASE_CLASSES = ['BaseNodeSerialHandler', 'BaseNodeEeprom',
'BaseNodeI2c', 'BaseNodeI2cHandler<Handler>',
'BaseNodeSpi']
DEFAULT_METHODS_FILTER = lambda df: df[~(df.method_name
.isin(['get_config_fields',
'get_state_fields']))].copy()
DEFAULT_POINTER_BITWIDTH = 16
prefix = 'base_node_rpc.pavement_base.'
def get_base_classes_and_headers(options, lib_dir, sketch_dir):
'''
Return ordered list of classes to scan for method discovery, along with a
corresponding list of the header file where each class may be found.
- Base classes refer to classes that are to be found in the
`base-node-rpc` library directory.
- rpc classes refer to classes found in the sketch directory.
'''
package_name = options.PROPERTIES['package_name']
module_name = package_name.replace('-', '_')
base_classes = getattr(options, 'base_classes', DEFAULT_BASE_CLASSES)
rpc_classes = getattr(options, 'rpc_classes', [module_name + '::Node'])
input_classes = ['BaseNode'] + base_classes + rpc_classes
base_node_lib_dir = lib_dir.joinpath('BaseNodeRpc', 'src', 'BaseNodeRpc')
input_headers = ([base_node_lib_dir.joinpath('BaseNode.h')] +
[base_node_lib_dir.joinpath('%s.h' % c.split('<')[0])
for c in base_classes] +
len(rpc_classes) * [sketch_dir.joinpath('Node.h')])
return input_classes, input_headers
def generate_validate_header(message_name, sketch_dir):
'''
If package has a Protocol Buffer message class type with the specified
message name defined, scan node base classes for callback methods related to
the message type.
For example, if the message name is `Config`, callbacks of the form
`on_config_<field name>_changed` will be matched.
'''
from importlib import import_module
from path_helpers import path
import c_array_defs
from .protobuf import (get_handler_validator_class_code,
write_handler_validator_header)
from . import get_lib_directory
mod_name = message_name.lower()
try:
mod = import_module('.' + mod_name, package=options.rpc_module.__name__)
except ImportError:
warnings.warn('ImportError: could not import %s.%s' %
options.rpc_module.__name__, mod_name)
return
lib_dir = get_lib_directory()
if hasattr(mod, message_name):
package_name = sketch_dir.name
input_classes, input_headers = get_base_classes_and_headers(options,
lib_dir,
sketch_dir)
message_type = getattr(mod, message_name)
args = ['-I%s' % p for p in [lib_dir.abspath()] +
c_array_defs.get_includes()]
validator_code = get_handler_validator_class_code(input_headers,
input_classes,
message_type, *args)
output_path = path(sketch_dir).joinpath('%s_%s_validate.h' %
(package_name,
message_name.lower()))
write_handler_validator_header(output_path, package_name,
message_name.lower(), validator_code)
@task
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_rpc_buffer_header(options):
import arduino_rpc.rpc_data_frame as rpc_df
sketch_dir = options.rpc_module.get_sketch_directory()
rpc_df.generate_rpc_buffer_header(sketch_dir, source_dir=sketch_dir)
@task
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_command_processor_header(options):
'''
Generate the following headers in a project directory under
`Arduino/library`:
- `Commands.h`
- `Properties.h`
- `CommandProcessor.h`
## `Commands.h` ##
This header defines the 8-bit code and request/response C structures
associated with each command type. This header can, for example, be
included by other projects to make requests through i2c.
## `Properties.h` ##
Contains property string define statements (e.g. `BASE_NODE__NAME`).
## `CommandProcessor.h` ##
Contains the `CommandProcessor` C++ class for the project.
## `NodeCommandProcessor.h` ##
This header is written to the sketch directory and simply includes the
three library headers above.
'''
from arduino_rpc.code_gen import write_code, C_GENERATED_WARNING_MESSAGE
from arduino_rpc.rpc_data_frame import (get_c_commands_header_code,
get_c_command_processor_header_code)
from clang_helpers.data_frame import underscore_to_camelcase
import c_array_defs
import jinja2
package_name = options.PROPERTIES['package_name']
module_name = package_name.replace('-', '_')
sketch_dir = path(module_name).joinpath('Arduino', module_name)
lib_dir = base_node_rpc.get_lib_directory()
input_classes, input_headers = get_base_classes_and_headers(options,
lib_dir,
sketch_dir)
camel_name = underscore_to_camelcase(module_name)
sketch_dir = path(module_name).joinpath('Arduino', module_name)
project_lib_dir = verify_library_directory(options)
arduino_src_dir = project_lib_dir.joinpath('src', project_lib_dir.name)
if not arduino_src_dir.isdir():
arduino_src_dir.makedirs_p()
with arduino_src_dir.joinpath('Properties.h').open('wb') as output:
print >> output, C_GENERATED_WARNING_MESSAGE % datetime.now()
print >> output, '#ifndef ___%s__PROPERTIES___' % module_name.upper()
print >> output, '#define ___%s__PROPERTIES___' % module_name.upper()
print >> output, ''
for k, v in options.PROPERTIES.iteritems():
print >> output, '#ifndef BASE_NODE__%s' % k.upper()
print >> output, '#define BASE_NODE__%s ("%s")' % (k.upper(), v)
print >> output, '#endif'
print >> output, ''
print >> output, '#endif'
with sketch_dir.joinpath('NodeCommandProcessor.h').open('wb') as output:
template = jinja2.Template('''\
#ifndef ___{{ name.upper() }}___
#define ___{{ name.upper() }}___
#include "{{ camel_name }}/Properties.h"
#include "{{ camel_name }}/CommandProcessor.h"
#endif // #ifndef ___{{ name.upper() }}___''')
print >> output, C_GENERATED_WARNING_MESSAGE % datetime.now()
print >> output, template.render(name=module_name,
camel_name=camel_name)
print >> output, ''
headers = {'Commands': get_c_commands_header_code,
'CommandProcessor': get_c_command_processor_header_code}
methods_filter = getattr(options, 'methods_filter', DEFAULT_METHODS_FILTER)
pointer_width = getattr(options, 'pointer_width', DEFAULT_POINTER_BITWIDTH)
for k, f in headers.iteritems():
output_header = arduino_src_dir.joinpath('%s.h' % k)
# Prepend auto-generated warning to generated source code.
f_get_code = lambda *args_: ((C_GENERATED_WARNING_MESSAGE %
datetime.now()) +
f(*(args_ + (module_name, )),
pointer_width=pointer_width))
write_code(input_headers, input_classes, output_header, f_get_code,
*['-I%s' % p for p in [lib_dir.abspath()] +
c_array_defs.get_includes()],
methods_filter=methods_filter,
pointer_width=pointer_width)
@task
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_python_code(options):
from arduino_rpc.code_gen import (write_code,
PYTHON_GENERATED_WARNING_MESSAGE)
from arduino_rpc.rpc_data_frame import get_python_code
import c_array_defs
package_name = options.PROPERTIES['package_name']
module_name = package_name.replace('-', '_')
sketch_dir = path(module_name).joinpath('Arduino', module_name)
lib_dir = base_node_rpc.get_lib_directory()
output_file = path(module_name).joinpath('node.py')
input_classes, input_headers = get_base_classes_and_headers(options,
lib_dir,
sketch_dir)
extra_header = ('from base_node_rpc.proxy import ProxyBase, '
'I2cProxyMixin, SerialProxyMixin')
extra_footer = '''
class I2cProxy(I2cProxyMixin, Proxy):
pass
class SerialProxy(SerialProxyMixin, Proxy):
pass
'''
# Prepend auto-generated warning to generated source code.
f_python_code = lambda *args: ((PYTHON_GENERATED_WARNING_MESSAGE %
datetime.now()) +
get_python_code(*args,
extra_header=extra_header,
extra_footer=extra_footer,
pointer_width=
pointer_width))
methods_filter = getattr(options, 'methods_filter', DEFAULT_METHODS_FILTER)
pointer_width = getattr(options, 'pointer_width', DEFAULT_POINTER_BITWIDTH)
write_code(input_headers, input_classes, output_file, f_python_code,
*['-I%s' % p for p in [lib_dir.abspath()] +
c_array_defs.get_includes()], methods_filter=methods_filter,
pointer_width=pointer_width)
@task
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_config_c_code(options):
import nanopb_helpers as npb
from arduino_rpc.code_gen import C_GENERATED_WARNING_MESSAGE
sketch_dir = options.rpc_module.get_sketch_directory()
for proto_path in sketch_dir.abspath().files('*.proto'):
proto_name = proto_path.namebase
options_path = proto_path.parent.joinpath(proto_name +
'.options')
if options_path.isfile():
kwargs = {'options_file': options_path}
else:
kwargs = {}
package_name = options.PROPERTIES['package_name']
module_name = package_name.replace('-', '_')
project_lib_dir = verify_library_directory(options)
arduino_src_dir = project_lib_dir.joinpath('src', project_lib_dir.name)
if not arduino_src_dir.isdir():
arduino_src_dir.makedirs_p()
nano_pb_code = npb.compile_nanopb(proto_path, **kwargs)
c_output_base = arduino_src_dir.joinpath(proto_name + '_pb')
c_header_path = c_output_base + '.h'
with open(c_output_base + '.c', 'wb') as output:
print >> output, C_GENERATED_WARNING_MESSAGE % datetime.now()
output.write(nano_pb_code['source'].replace('{{ header_path }}',
c_header_path.name))
with open(c_header_path, 'wb') as output:
print >> output, C_GENERATED_WARNING_MESSAGE % datetime.now()
output.write(nano_pb_code['header']
.replace('PB_%s_PB_H_INCLUDED' % proto_name.upper(),
'PB__%s__%s_PB_H_INCLUDED' %
(module_name.upper(), proto_name.upper())))
@task
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_config_python_code(options):
import nanopb_helpers as npb
from path_helpers import path
sketch_dir = options.rpc_module.get_sketch_directory()
for proto_path in sketch_dir.abspath().files('*.proto'):
proto_name = proto_path.namebase
pb_code = npb.compile_pb(proto_path)
output_path = path(options.PROPERTIES['package_name']
.replace('-', '_')).joinpath(proto_name + '.py')
output_path.write_bytes(pb_code['python'])
@task
@needs('generate_config_python_code')
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_config_validate_header(options):
sketch_dir = options.rpc_module.get_sketch_directory()
generate_validate_header('Config', sketch_dir)
@task
@needs('generate_config_python_code')
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_state_validate_header():
sketch_dir = options.rpc_module.get_sketch_directory()
generate_validate_header('State', sketch_dir)
@task
@needs('generate_all_code',
'arduino_rpc.pavement_base.build_arduino_library')
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def build_arduino_library(options):
pass
@task
@cmdopts([('overwrite', 'f', 'Force overwrite')])
def init_config():
'''
Write basic config protobuf definition to sketch directory
(`config.proto`).
'''
import jinja2
from . import get_lib_directory
overwrite = getattr(options, 'overwrite', False)
sketch_dir = options.rpc_module.get_sketch_directory()
lib_dir = get_lib_directory()
output_path = sketch_dir.joinpath('config.proto')
template = lib_dir.joinpath('config.protot').bytes()
if not output_path.isfile() or overwrite:
output = jinja2.Template(template).render(package=
options.PROPERTIES['package_name'])
output_path.write_bytes(output)
else:
raise IOError('Output path exists. Use `overwrite` to force '
'overwrite.')
@task
@needs('generate_all_code')
@cmdopts([('sconsflags=', 'f', 'Flags to pass to SCons.'),
('boards=', 'b', 'Comma-separated list of board names to compile '
'for (e.g., `uno`).')])
def build_firmware():
scons_flags = getattr(options, 'sconsflags', '')
boards = [b.strip() for b in getattr(options, 'boards', '').split(',')
if b.strip()]
if not boards:
boards = options.DEFAULT_ARDUINO_BOARDS
for board in boards:
# Compile firmware once for each specified board.
sh('scons %s ARDUINO_BOARD="%s"' % (scons_flags, board))
@task
@needs('build_arduino_library', 'build_firmware', 'generate_setup', 'minilib',
'setuptools.command.sdist')
def sdist():
"""Overrides sdist to make sure that our setup.py is generated."""
pass
@task
@needs('generate_library_main_header', 'generate_config_c_code',
'generate_config_python_code', 'generate_command_processor_header',
'generate_rpc_buffer_header', 'generate_python_code')
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_all_code(options):
'''
Generate all C++ (device) and Python (host) code, but do not compile
device sketch.
'''
pass
@task
@cmdopts(LIB_CMDOPTS, share_with=LIB_GENERATE_TASKS)
def generate_library_main_header(options):
package_name = options.PROPERTIES['package_name']
module_name = package_name.replace('-', '_')
library_dir = verify_library_directory(options)
library_header = library_dir.joinpath('src', '%s.h' % library_dir.name)
if not library_header.isdir():
library_header.parent.makedirs_p()
with library_header.open('wb') as output:
output.write('''
#ifndef ___{module_name_upper}__H___
#define ___{module_name_upper}__H___
#endif // #ifndef ___{module_name_upper}__H___
'''.strip().format(module_name_upper=module_name.upper()))

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

{"is_release": true, "git_version": "645fff9"}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet