enable to show the MAC frame data rate.

master
Shoichi Sakane 2017-09-26 07:57:29 +09:00
parent efbaf237e5
commit a0b6f4484f
2 changed files with 25 additions and 19 deletions

View File

@ -33,16 +33,21 @@ The default value is aligned to LoRaWAN AS923.
## Examples
% python lorawan_toa.py -v 12 64
PHY payload size : 64 Bytes
MAC payload size : 59 Bytes
Spreading Factor : 12
Band width : 125 kHz
Low data rate opt.: enable
Explicit header : enable
CR (coding rate) : 1 (4/5)
Preamble size : 8 symbols
Time on Air : 2793.472 msec
with the -v option, it shows the ToA as well as the related information.
% python lorawan_toa.py 12 64 -v
PHY payload size : 64 Bytes
MAC payload size : 59 Bytes
Spreading Factor : 12
Band width : 125 kHz
Low data rate opt. : enable
Explicit header : enable
CR (coding rate) : 1 (4/5)
Preamble size : 8 symbols
Time on Air : 2793.472 msec
MAC frame data rate : 63.998 bps
without the -v option, it simply shows the ToA.
% python lorawan_toa.py --band-width=500 7 128
71.744

View File

@ -95,14 +95,15 @@ if __name__ == "__main__" :
disable_h=opt.v_h, n_cr=opt.n_cr,
n_preamble=opt.n_preamble)
if opt.f_verbose:
print "PHY payload size : %d Bytes" % opt.n_size
print "MAC payload size : %d Bytes" % (opt.n_size-5)
print "Spreading Factor : %d" % opt.n_sf
print "Band width : %d kHz" % opt.n_bw
print "Low data rate opt.: %s" % ("enable" if opt.v_de else "disable")
print "Explicit header : %s" % ("disable" if opt.v_h else "enable")
print "CR (coding rate) : %d (4/%d)" % (opt.n_cr, 4+opt.n_cr)
print "Preamble size : %d symbols" % opt.n_preamble
print "Time on Air : %.3f msec" % t_frame
print "PHY payload size : %d Bytes" % opt.n_size
print "MAC payload size : %d Bytes" % (opt.n_size-5)
print "Spreading Factor : %d" % opt.n_sf
print "Band width : %d kHz" % opt.n_bw
print "Low data rate opt. : %s" % ("enable" if opt.v_de else "disable")
print "Explicit header : %s" % ("disable" if opt.v_h else "enable")
print "CR (coding rate) : %d (4/%d)" % (opt.n_cr, 4+opt.n_cr)
print "Preamble size : %d symbols" % opt.n_preamble
print "Time on Air : %.3f msec" % t_frame
print "MAC frame data rate : %.3f bps" % (opt.n_size-5 / t_frame)
else:
print "%.3f" % t_frame