@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


:: see AT76C510.mib for definitions

set RtsAddr=enterprises.410.
set UpdAddr=enterprises.410.

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