Hi all,
Here is the summary:
EXAMPLE FILE:Â Â Â Â benchmark_rx.py
FUNCTION:Â Â Â Â Â Â Â Â Â Â rx_callback(ok, payload)
ARGUMENT:Â Â Â Â Â Â Â Â payloadÂ
PROBLEM:Â Â Â Â Â Â Â Â Â Â Â Can any one please tell me how to access and assess
individual elements/entities/values of the argument ‘payload’ in the
function “rx_callback(ok, payload)” in benchmark_rx.py.
NEED:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Need to calculate bit/byte-error rate and so need
to compare transmitted and received words.
It seems to be a binary-stream and I am transmitting a packet with just
0’s and 1’s.
I have tried writing payload to both, .txt and .bin files and output
contains wierd characters. (Ofcourse, writing .txt file required me use
repr() ).Â
I am done with trying decode it using utf-8, utf-16, latin-1 and ascii
encodings, but all in vain. None of these schemes can decode a packet
correctly if CRC is False. (Shows error that value is out of range)
payload.count(0) returns an error: “TypeError: expected a character
buffer object”.
Feeling sleepy now, wish I can get some answer by tomorrow. I guess
working-hours’s gonna start in Europe and already in Asia etc :). Any
help would be highly appreciated.
-Ahmed