Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

Commit d1b83c0

Browse files
committed
Adding uplink_raw_callback function
1 parent 2ba8b5d commit d1b83c0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ttn/ttnmqtt.py

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def obj2json(self):
3333
class MyEvents(Events):
3434
__events__ = (
3535
"uplink_msg",
36+
"uplink_raw_msg",
3637
"downlink_msg",
3738
"connect",
3839
"close")
@@ -116,6 +117,8 @@ def on_message(client, userdata, msg):
116117
obj = json2obj(j_msg)
117118
if self.__events.uplink_msg:
118119
self.__events.uplink_msg(obj, client=self)
120+
if self.__events.uplink_raw_msg:
121+
self.__events.uplink_raw_msg(msg, client=self)
119122
return on_message
120123

121124
def _on_downlink(self):
@@ -127,6 +130,9 @@ def on_publish(client, userdata, mid):
127130
def set_uplink_callback(self, callback):
128131
self.__events.uplink_msg += callback
129132

133+
def set_uplink_raw_callback(self, callback):
134+
self.__events.uplink_raw_msg += callback
135+
130136
def set_downlink_callback(self, callback):
131137
self.__events.downlink_msg += callback
132138

0 commit comments

Comments
 (0)