This commit is contained in:
joy,zhou 2021-02-02 15:10:03 +08:00
parent a3a7cf4676
commit 4471e8338c
4 changed files with 7 additions and 4 deletions

BIN
examples/rrpc/demo.zip Normal file

Binary file not shown.

View File

@ -2,11 +2,11 @@
if [ -e "./demo.zip" ] ; then
rm ./demo.zip
fi
rm -rf tmp
mkdir tmp
cp index.py tmp/
cd tmp
pip3 install -t . iotedge_driver_link_sdk==0.0.2.beta #打包驱动SDK
pip3 install -t . iotedge_driver_link_sdk==0.0.2 #打包驱动SDK
zip -r demo.zip .
cd ..
cp tmp/demo.zip .

View File

@ -398,11 +398,14 @@ def _on_message(message):
sub_dev = _connect_map[identify]
if isinstance(topic, str) and topic.startswith("/$system/") and topic.find("/rrpc/request/") > 0:
if sub_dev.rrpc:
_logger.debug("rrpc request: {}".format(str(message)))
resp = sub_dev.rrpc(topic, msg)
if not resp:
if resp:
_logger.debug("rrpc response: {}".format(str(resp)))
topic = topic.replace(
"/rrpc/request/", "/rrpc/response/", 1)
sub_dev.publish(topic, resp)
return
if sub_dev.callback:
sub_dev.callback(topic, msg)

View File

@ -7,7 +7,7 @@ if not (sys.version_info[0] == 3):
setup(
name='iotedge_driver_link_sdk',
version='0.0.2.beta',
version='0.0.2',
author='ucloud.cn',
url='https://pypi.org/project/iotedge_driver_link_sdk/',
author_email='joy.zhou@ucloud.cn',