Skip to content

Commit

Permalink
Fix #1: Added new command methods and docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaprakash-mcci committed May 26, 2020
1 parent 67a6643 commit 5902d21
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 199 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.1
v1.0.3
293 changes: 128 additions & 165 deletions doc/build/html/Autodoc.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.0.1',
VERSION: '1.0.3',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
Expand Down
8 changes: 7 additions & 1 deletion doc/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Index &mdash; RWC5020x API Library 1.0.1 documentation</title>
<title>Index &mdash; RWC5020x API Library 1.0.3 documentation</title>



Expand Down Expand Up @@ -300,6 +300,8 @@ <h2 id="L">L</h2>
<li><a href="Autodoc.html#rwclib.cRWC5020x.RWCTesterApi.link_gettimedisplay">link_gettimedisplay() (rwclib.cRWC5020x.RWCTesterApi method)</a>
</li>
<li><a href="Autodoc.html#rwclib.cRWC5020x.RWCTesterApi.link_getuplinkdwelltime">link_getuplinkdwelltime() (rwclib.cRWC5020x.RWCTesterApi method)</a>
</li>
<li><a href="Autodoc.html#rwclib.cRWC5020x.RWCTesterApi.link_micerror">link_micerror() (rwclib.cRWC5020x.RWCTesterApi method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down Expand Up @@ -438,6 +440,10 @@ <h2 id="L">L</h2>
<li><a href="Autodoc.html#rwclib.cRWC5020x.RWCTesterApi.link_status">link_status() (rwclib.cRWC5020x.RWCTesterApi method)</a>
</li>
<li><a href="Autodoc.html#rwclib.cRWC5020x.RWCTesterApi.link_stop">link_stop() (rwclib.cRWC5020x.RWCTesterApi method)</a>
</li>
<li><a href="Autodoc.html#rwclib.cRWC5020x.RWCTesterApi.link_xorfhdr">link_xorfhdr() (rwclib.cRWC5020x.RWCTesterApi method)</a>
</li>
<li><a href="Autodoc.html#rwclib.cRWC5020x.RWCTesterApi.link_xormhdr">link_xormhdr() (rwclib.cRWC5020x.RWCTesterApi method)</a>
</li>
</ul></td>
</tr></table>
Expand Down
2 changes: 1 addition & 1 deletion doc/build/html/howto.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>How to use Python Library &mdash; RWC5020x API Library 1.0.1 documentation</title>
<title>How to use Python Library &mdash; RWC5020x API Library 1.0.3 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion doc/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>RWC5020x API Library’s documentation &mdash; RWC5020x API Library 1.0.1 documentation</title>
<title>RWC5020x API Library’s documentation &mdash; RWC5020x API Library 1.0.3 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion doc/build/html/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Python Module Index &mdash; RWC5020x API Library 1.0.1 documentation</title>
<title>Python Module Index &mdash; RWC5020x API Library 1.0.3 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion doc/build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Search &mdash; RWC5020x API Library 1.0.1 documentation</title>
<title>Search &mdash; RWC5020x API Library 1.0.3 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion doc/build/html/searchindex.js

Large diffs are not rendered by default.

109 changes: 84 additions & 25 deletions rwclib/cRWC5020x.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def set_screen(self, submenu):
another sub menu
:param submenu: sub menu type (LINK, POWER_TIME, POWER_CHANNEL,
SENSITIVITY, REMOTE)
SENSITIVITY, REMOTE)
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -500,7 +500,8 @@ def rf_setchannelmask(self, chindexrange, chmaskrange):
:param chindexrange: Channel index (0 - 5)
:param chmaskrange: Channel Mask (For EDT 0x00 ~ 0xFF,
For GWT 0x00 ~ 0xFFFF(US/AU/CN), read-only (others))
For GWT 0x00 ~ 0xFFFF(US/AU/CN),
read-only (others))
:return: ACK on success, NAK on failure
Expand All @@ -527,7 +528,7 @@ def rf_getchannelmask(self, chindexrange):
:param chindexrange: Channel index (0 - 5)
:return: It returns the channel mask with respect to the channel
index; NAK on failure
index; NAK on failure
'''
chindexnum = int(chindexrange)
Expand Down Expand Up @@ -649,7 +650,7 @@ def rf_getchannelgroup(self):
:Parameters: N/A (Query only)
:return: It returns the channel group of US/AU/CN region;
NAK on failure
NAK on failure
'''
cmdGetChGroup = 'READ:RF:CH_GROUP?' + '\n'
Expand Down Expand Up @@ -750,7 +751,8 @@ def rf_setpingdr(self, drvalue):
Configure the data rate of ping channel
:param drvalue: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125,
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125,
DR6_SF7BW250, DR7_FSK50
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -953,7 +955,7 @@ def protocol_setregion(self, region):
Configure an operating Region of RWC5020A
:param region: EU_868, EU_433, US_915, AU_921, CN_490, KR_922,
AS_923, IN_866
AS_923, IN_866
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -1486,7 +1488,7 @@ def protocol_setperiodic_uplinkmsg(self, peruplinkmsg):
Configure the Periodic Uplink message in GWT
:param peruplinkmsg: NONE, LINK_CHECK_REQ, CONFIRMED_UP,
UNCONFIRMRED_UP, DL_COUNTER
UNCONFIRMRED_UP, DL_COUNTER
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -2001,7 +2003,7 @@ def protocol_setdownlinkslot(self, slotval):
Configure the selection of downlink slot (RX window)
:param slotval: For EDT, RX1, RX2, PING(Class B),
For GWT, RX1, RX2, RX1&RX2
For GWT, RX1, RX2, RX1&RX2
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -2044,7 +2046,7 @@ def protocol_setuplinkdatarate(self, dr):
Configure Data Rate of Uplink in GWT mode
:param dr: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125, DR3_SF9BW125,
DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -2166,7 +2168,7 @@ def protocol_setrx2_dr(self, dr):
Configure RX2_DR value for RXParamSetupReq
:param dr: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125, DR3_SF9BW125,
DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -3490,7 +3492,8 @@ def link_setadr_drval(self, macnum, drval):
:param macnum: MAC Command Number
:param drval: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125,
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125,
DR6_SF7BW250, DR7_FSK50
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -3822,7 +3825,7 @@ def link_setmaxeirp(self, macnum, value):
:param macnum: MAC Command Number
:param value: 8, 10, 12, 13, 14, 16, 18, 20, 21, 24, 26, 27, 29,
30, 33, 36
30, 33, 36
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -4424,7 +4427,7 @@ def link_setpingdatarate(self, macnum, datarate):
:param macnum: MAC Command Number
:param datarate: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125,
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -4530,7 +4533,7 @@ def link_setrx2datarate(self, macnum, datarate):
:param macnum: MAC Command Number
:param datarate: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125,
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -4702,7 +4705,7 @@ def link_setrejoindatarate(self, macnum, datarate):
:param macnum: MAC Command Number
:param datarate: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125,
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -5708,6 +5711,7 @@ def link_getmacsendstatus(self):
:Parameters: N/A (Query only)
:return: MAC Command status; NAK on failure
'''
cmdGetMacSendStatus = 'READ:LINK:MAC_SEND_STATUS?' + '\n'
result = RwcSerialSetup.transceive(self, cmdGetMacSendStatus)
Expand All @@ -5721,13 +5725,66 @@ def link_getdutycycle(self):
:return: Duty cycle value; NAK on failure
.. _powerlabel:
'''
cmdGetDutyCycleVal = 'READ:LINK:DUTY_CYCLE?' + '\n'
result = RwcSerialSetup.transceive(self, cmdGetDutyCycleVal)
return result

def link_micerror(self, value):
'''
Set Mic Error
:param value: ON, OFF
:return: ACK on success, NAK on failure
'''
cmdValue = value
if (cmdValue == 'ON' or cmdValue == 'OFF'):
cmdMicError = 'CONF:LINK:MIC_ERROR ' + cmdValue + '\n'
result = RwcSerialSetup.transceive(self, cmdMicError)
return result
else:
raise Exception('Invalid parameter received.')

def link_xormhdr(self, value):
'''
Set XOR MHDR
:param value: 8-bit Hex Value
:return: ACK on success, NAK on failure
'''
cmdValue = int(value)
if (cmdValue >= 0 and cmdValue <= 2**8 - 1):
cmdHexValue = hex(cmdValue)
cmdXorMHDR = 'CONF:LINK:XOR_MHDR ' + cmdHexValue + '\n'
result = RwcSerialSetup.transceive(self, cmdXorMHDR)
return result
else:
raise Exception('Invalid parameter received.')

def link_xorfhdr(self, value):
'''
Set XOR FHDR
:param value: 56-bit Hex Value
:return: ACK on success, NAK on failure
.. _powerlabel:
'''
cmdValue = int(value)
if (cmdValue >= 0 and cmdValue <= 2**56 - 1):
cmdHexValue = hex(cmdValue)
cmdXorFHDR = 'CONF:LINK:XOR_FHDR ' + cmdHexValue + '\n'
result = RwcSerialSetup.transceive(self, cmdXorFHDR)
return result
else:
raise Exception('Invalid parameter received.')

#Power Command Methods
def power_setscalemode(self, mode):
'''
Expand Down Expand Up @@ -6186,7 +6243,7 @@ def power_gettargetchmask(self):
:param: Query only
:return: It returns the channel mask value of power measure test;
NAK on failure
NAK on failure
'''
cmdGetTargetChMaskValue = 'READ:POWER:TARGET_CH_MASK? ' + '\n'
Expand Down Expand Up @@ -6220,7 +6277,7 @@ def power_gettargetchmaskopt(self):
:param: Query only
:return: It returns the channel mask value of power measurement;
NAK on failure
NAK on failure
'''
cmdGetTargetChMaskOptValue = 'READ:POWER:TARGET_CH_MASK_OPT? ' + '\n'
Expand Down Expand Up @@ -6264,7 +6321,8 @@ def power_setuldatarate(self, datarate):
Configure the Data Rate to be used in power measure test
:param datarate: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125,
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125, DR6_SF7BW250, DR7_FSK50
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125,
DR6_SF7BW250, DR7_FSK50
:return: ACK on success, NAK on failure
Expand Down Expand Up @@ -6830,7 +6888,7 @@ def sensitivity_gettargetchmask(self):
:param: Query only
:return: It returns the mask value to be used in Sensitivity test;
NAK on failure
NAK on failure
'''
cmdGetTargetChMask = 'READ:SENSITIVITY:TARGET_CH_MASK?' + '\n'
Expand Down Expand Up @@ -6877,7 +6935,7 @@ def sensitivity_settargetdr(self, drvalue):
Configure the DR value to be used in sensitivity test
:param drvalue: DR0_SF12BW125, DR1_SF11BW125, DR2_SF10BW125,
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125
DR3_SF9BW125, DR4_SF8BW125, DR5_SF7BW125
:return: ACK on success, NAK on failure
Expand All @@ -6904,7 +6962,7 @@ def sensitivity_gettargetdr(self):
:param: Query only
:return: It returns the DR value to be used in sensitivity test;
NAK on failure
NAK on failure
'''
cmdGetTargetDr = 'READ:SENSITIVITY:TARGET_DR?' + '\n'
Expand Down Expand Up @@ -6940,7 +6998,7 @@ def sensitivity_gettargetdlch(self, chnum):
:param chnum: Channel Number
:return: It returns the downlink channel frequency value;
NAK on failure
NAK on failure
'''
cmdChNum = str(chnum)
Expand All @@ -6954,7 +7012,8 @@ def sensitivity_setpayloadtype(self, msgtype):
Configure the Message type of user-defined MAC command
:param msgtype: MAC Command Message type
(0000_0000, 1111_1111, 1111_0000, 1010_1010, PRBS, USER)
(0000_0000, 1111_1111, 1111_0000,
1010_1010, PRBS, USER)
:return: ACK on success, NAK on failure
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='rwcpythonapi',
version='1.0.1',
version='1.0.3',
description='RWC5020x LoRa Tester Library',
author='Sivaprakash Veluthambi',
author_email='',
Expand Down

0 comments on commit 5902d21

Please sign in to comment.