@echo off

:: setCpeRTS.bat
::
:: set the RTS threshold for atmel-based 802.11b radio
:: (tested on smartbridges devices)
::
:: usage: setCpeRTS [newThreshold]
::
:: blame: shardy@@methownet.com
::
:: uses: snmpget.exe/snmpset.exe from freeware ucd-snmp
::       sleep.exe from one of the reskits

setlocal

:: see AT76C510.mib for definitions

set RtsAddr=enterprises.410.1.2.1.4.0
set UpdAddr=enterprises.410.1.1.1.6.0

set cmty=private
set RtsThresh=500

if not %1.==. set RtsThresh=%1

for /f %%a in (CpeDevices.txt) do (
  snmpget -c %cmty% %%a %RtsAddr%
  snmpset -c %cmty% %%a %RtsAddr% i %RtsThresh%
  snmpget -c %cmty% %%a %RtsAddr% 
  snmpset -c %cmty% %%a %UpdAddr% i 1
  snmpget -c %cmty% %%a %UpdAddr% 
  sleep.exe 5
  )

endlocal