ronoth / LoStik

LoRaWAN compatible USB test device
MIT License
132 stars 39 forks source link

return values from send_cmd #7

Open WA4OSH opened 5 years ago

WA4OSH commented 5 years ago

When a python script is used to send data to the RN2903/RN2483, the function call looks something like this. The first parameter is the layer that's being commanded - sys, mac, or radio.

send_cmd("sys set pindig GPIO10 0", delay=1)

When a Python script is used to query data from the RN2903/RN2483, the function call looks something like this:

send_cmd('sys get ver')

But this results in the result getting printed on the console. There are occasions when the return value needs to be put into a variable. For example how would you read a GPIO ?

read button

send_cmd("sys get pindig GPIO12 0") ??

This will be necessary to get LoRaWAN up and running.

WA4OSH commented 5 years ago

For example: 1) We do a 'send mac otaa' The response will be ok. accepted (or denied, or no free channels, etc). Our program actions depend on reading the response. 2) If we send confirmed packets (mac tx cnf 1 1234567890), we need to know if our packet made it to the gateway