I have initailized a varaible EBID as typeset Long EBID=0
i am calculating value of EBID using certian formula as below:
(( CURR_EBID= ($BANDINDEX << 27) | ($CURR_FREQ << 16) | ($CURR_CELLID << 4) | $CURR_SECTOR_VALUE ))
return $CURR_EBID
The output is as below:
+ (( CURR_EBID= (15 << 27) | (125 << 16) | (135 << 4) | 1 ))
+ return 2021460081
+ TEMP_EBID=113
-----------------------------
the value after calculation is correct. But the value stored after returing is wrong.
The above script returns 2021460081 but the value stored is 113.
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#
# In the BTSTemplate -
#
# Replace all instances of the BTS name/ CELL name with "@BTSNAME"
# Replace Traffic Range value with "@TRAFFICRANGE" (METROINV/COMPACTINV)
# Replace Port Number value with "@PORTNUMBER" (METROINV/COMPACTINV)
# Replace CEll ID with "@CELLID" (MSECTOR)
# Replace IP Adress with "@IPADDRESS" (BTSIWFPORT)
# Replace INSASPI with "@SASPI" (BTSIWFPORT & ETHERNETINV)
# Replace EGSASPI with "@SASPI" (BTSIWFPORT & ETHERNETINV)
#
# The BTSTemplate should not contain section adding a new LogicalIPPort
#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
### CONSTANTS ###
HOME="/export/home/bsmbin/" # home directory of the user who is running this script.
BTS_TEMPLATE="new.txt" #input cli template with the token substitution.
FINAL_BATCHFILE="default_finalbatchfile1.cli" # output bsmci batch file location
BTS_COUNT=1 # number BTSs to be created
CELLID=135 #starting cell id number
PORTNUM=40 # starting portnumber
TRAFFICRANGE=11 # starting Traffic range...
typeset String BAND=AWS #
typeset Integer FREQUENCY=125 # starting the fourth element in an IP Address
SECTOR_VALUE=1
TotalSECTOR_COUNT=3
typeset Long EBID=0
typeset Long NeighbourOne=0
typeset Long NeighbourTwo=0
typeset Long ACNID=0
PILOT=24
TRAFFICRANGE_GROUP=4
### FUNCTIONS ###
##################################################### #Function to change the value of #BTS Template
#####################################################
CalculateACNId()
{
CURR_TR=$3
CURR_PORT=$1
CURR_TRM=262144
CURR_PM=2048
CURR_OFFSET=49
CURR_TRG=$2
(( CURR_ACNID= ($CURR_TRG << 24) + ($CURR_TR * $CURR_TRM) + ($CURR_PORT * $CURR_PM) + $CURR_OFFSET ))
return $CURR_ACNID
}
##################################################### #Function to change the value of #BTS Type
#####################################################
CalculateEBID ()
{
typeset Integer CURR_CELLID=$4
typeset Integer CURR_SECTOR_VALUE=$3
typeset String CURR_BAND=$2
typeset Integer CURR_FREQ=$1
case $CURR_BAND
in
800)BANDINDEX=0 ; ;;
1900)BANDINDEX=1 ; ;;
450)BANDINDEX=5 ; ;;
AWS)BANDINDEX=15 ; ;;
SEC_800)BANDINDEX=10 ; ;;
esac
(( CURR_EBID= ($BANDINDEX << 27) | ($CURR_FREQ << 16) | ($CURR_CELLID << 4) | $CURR_SECTOR_VALUE ))
return $CURR_EBID
}
####################################################
#
# MAIN PROGRAM
#
####################################################