@@ -87,16 +87,38 @@ def test_listener():
8787 message_received = json .load (json_file )
8888 listener .__on_receive__ (packet = message_received )
8989
90+ message_received = {
91+ "from" : 1111111111 ,
92+ "to" : 1234567890 ,
93+ "decoded" : {
94+ "portnum" : "TEXT_MESSAGE_APP" ,
95+ "bitfield" : 0 ,
96+ "text" : ""
97+ },
98+ "id" : 222222222 ,
99+ "rxTime" : 0 ,
100+ "rxSnr" : 6.75 ,
101+ "hopLimit" : 7 ,
102+ "wantAck" : True ,
103+ "rxRssi" : - 35 ,
104+ "hopStart" : 7 ,
105+ "publicKey" : "asdfasdfasdfasdfasdfasdfasdf=" ,
106+ "pkiEncrypted" : True ,
107+ "fromId" : "!12345678" ,
108+ "toId" : "!12345678"
109+ }
110+
90111 # a list of commands and the expected response from the BBS
91112 # we'll do a check of response.startswith(expected_response) for each command
92113 test_commands = [
93114 (None , '' ),
94- ('!h' , '' ), # this message will be long, so just check for a basic response
95- ('!r' , 'RX HOPS:' ),
115+ ('!r' , 'RX HOPS: 7 / 7\n RX SNR: 6.75\n RX RSSI: -35' ),
96116 ('!w' , 'Sent 1 waypoint to your map' ), # we created 1 waypoint using the JSON test above
97- ('!i' , 'Meshtastic Listener testing' ),
98- ('!l' , '1234567890 (TEST): testing' ),
99117 ('!c' , 'No health check data available.' ), # no health check data in the test messages
118+ ('!l' , '1234567890 (TEST): testing' ),
119+ ('!t' , 'Traceroute Summary:' ),
120+ ('!i' , 'Meshtastic Listener testing' ),
121+ ('!h' , '' ), # this message will be long, so just check for a basic response
100122
101123 # SUBSCRIPTIONS
102124 # ('!s', 'Subscription Commands:'),
@@ -113,27 +135,6 @@ def test_listener():
113135 # ('!s add *', 'Successfully subscribed to all topics'),
114136 ]
115137
116- message_received = {
117- "from" : 1234567890 ,
118- "to" : 1234567890 ,
119- "decoded" : {
120- "portnum" : "TEXT_MESSAGE_APP" ,
121- "bitfield" : 0 ,
122- "text" : ""
123- },
124- "id" : 1234567890 ,
125- "rxTime" : 0 ,
126- "rxSnr" : 6.75 ,
127- "hopLimit" : 7 ,
128- "wantAck" : True ,
129- "rxRssi" : - 35 ,
130- "hopStart" : 7 ,
131- "publicKey" : "asdfasdfasdfasdfasdfasdfasdf=" ,
132- "pkiEncrypted" : True ,
133- "fromId" : "!12345678" ,
134- "toId" : "!12345678"
135- }
136-
137138 for message in test_commands :
138139 print (f'Sending message: { message [0 ]} ' )
139140 message_received ['rxTime' ] = int (time ())
0 commit comments