?///////////////////////////////////////////////////////////////////////
?//
?//  FILE: DPR
?//                                                
?//  VERSION: 1.0b1 04/06/98
?//
?//  DESCRIPTION: This macro is used to test the standby battery life
?//               of IS-136 handsets. It sets up a DCCH with a periodic
?//               registration rate set by the user. The program counts
?//               the number of registrations and the elapsed time.
?//
?//  AUTHOR: Bill Rosenberg
?//
?///////////////////////////////////////////////////////////////////////
?//
?//  Main macro: DPR
?//  Sub macros: reg_ms, dcch_setup, get_ch, ch_a, ch_b
?//
?///////////////////////////////////////////////////////////////////////
?*pmc
?var pch_sub
?var system_select = 2, band_select = 1
?var regperval = 30
?var regcount, pagecount, pagefail
?string regtimef
?var regtimef_h
?var regtimef_m
?var regtimef_s
?string regtimel
?string regtime
?var regtimel_h
?var regtimel_m
?var regtimel_s
?var t_start, t_end, timelapse
?var substr
?var strend
?string strtemp1, strtemp2
?string revnum = "1.1b4"
?string revdate = "03/12/98"
?var num_neigh, neigh_list, hlfreq, scan_interval, scan_option
?var nl_ca[24]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24}
?var nl_cb[24]={334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357}
?var nl_pa[24]={2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25}
?var nl_pb[24]={668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691}
? 
?var phnum       // for storing the MSID, added 8/15/97
?var nfb, neb 
? 
?const SBC_SOC, 4             // sah 8/15/97
? 
?///////////////////////////////////////////////////////////////////////
?//ch_a: choose a side channel
?///////////////////////////////////////////////////////////////////////
?*dmc "ch_a",begin
?var cn
? 
?  case band_select
? 
?    of 1:    // cellular
?       cn = 991
? 
?    of 2:    // PCS
?       cn = 251
? 
?  endcase
? 
? return cn
?end
? 
?///////////////////////////////////////////////////////////////////////
?//ch_b: choose b side channel with input from the user
?///////////////////////////////////////////////////////////////////////
?*dmc "ch_b",begin
?var cn
? 
?  case band_select
? 
?    of 1:    // cellular
?       cn = 767
? 
?    of 2:    // PCS
?       cn = 917
? 
?  endcase
? 
? return cn
? 
?end
? 
?///////////////////////////////////////////////////////////////////////
?//get_ch: get channel based on system selected
?///////////////////////////////////////////////////////////////////////
?*dmc "get_ch",begin
? 
?   if system_select = 1 
?    a = ch_a 
?   endif
? 
?   if system_select = 2
?    a =  ch_b
?   endif
?return a
?end 
? 
?*dmc "page_min", begin
?    :css:spach:bu 5
?    :css:spach:idt 2
?    :css:spach:min1 phnum
?    :css:spach:bcn 0
?    :css:spach:pfm 0
? 
?    send_hard pch_sub
?    print "Sending page"
?    print ""
?    print "Waiting for page response, hit 'Q' to quit"
?    print ""
?end
? 
?///////////////////////////////////////////////////////////////////////
?// reg_ms: This macro waits for the MS to register,
?//      determines the MSID, and sends Reg Accept
?///////////////////////////////////////////////////////////////////////
?*dmc "reg_ms", begin
?  var paid, ns, nsb, nrs, nnp, nb, np
?  var key_value = 0
?  regcount = 0
?  :rdcch:length:normal
?  :rdcch:l3data:sel 0
?  key_value=0
?  print "Waiting for registration, hit 'Q' to quit"
?  print ""
?  do
?  do
?    tpause
?    $ = :rdcch:msgtype?
?    if ($ != "-1") 
?      print $
?    endif
?  until key? or ($ = "REGISTRATION") or ($ = "PAGE RESPONSE")
? 
? 
? 
?  if ($="REGISTRATION")
?    regtime = syst:time?
?res 0                 // No reserved

res 0                 // No reserved
^
-102,"SYNTAX ERROR"
1900CSA -->Main
?  :css:fbcch:con 1                     // Use slot configurtion 1
?  :css:fbcch:dvcc #h2c                 // Use DVCC of #h2c???
?  :css:fbcch:pfc 0                     // Max supported PFC = 0
?  :css:fbcch:pch 0                     // PCH Displacement = 0
?  :css:fbcch:pfm 0                     // PFM Direction = 0
?  :css:fbcch:num:non_pch 0             // Number of non-pch subchannel slots
?  //------------------------------------- FBCCH System Access Message
?  :css:fbcch:msg:acc 1                 // Enable Access Parameters Message
?  :css:fbcch:auth 0                    // Disable Authentication
?  :css:fbcch:s 1                       // Send serial number message
?  :css:fbcch:rand 0                    // Random number for auth = 0
?  :css:fbcch:acc:ms_pwr 2              // Mobile station shall use ATTN=2
?  :css:fbcch:acc:burstsize 0           // Use abbreviated length burst on the RACH ???
?  :css:fbcch:max:retries 7             // Max Retries=7
?  :css:fbcch:max:busy 1                // Max Busy/Reserved = 1
?  :css:fbcch:max:repetitions 3         // Max Repetitions = 3
?  :css:fbcch:max:stop 1                // Max Stop Counter = 1
?  :css:fbcch:rdata:length 0            // R-DATA Message Length = 0
?  :css:fbcch:barred 0                  // Cell Barred = off
?  :css:fbcch:subaddressing 0           // Subaddressing support = no
?  :css:fbcch:dic 0                     // Delay Interval Compenstation = off
?  //------------------------------------- FBCCH Control Channel Selection
?  :css:fbcch:msg:sel 1                   // Enable Control Channel Selection Param.
?  :css:fbcch:ss_suff 0                   // Minimum Signal Strength allowed = -120 dB
?  :css:fbcch:acc:rss_min 0               // Minimum signal strength to access cell = -120 dB
?  :css:fbcch:scan:interval scan_interval // Scan Interval = 0
?  :css:fbcch:initial 0                   // Initial Selection Control = 0
?  :css:fbcch:delay 0     enu 4                // Full Rate DTC

  :css:fbcch:delay 0     enu 4                // Full Rate DTC
                         ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?  :css:ebcch:map:arq 0                 // No ARQ
?  :css:ebcch:map:user 0
?  :css:ebcch:map:sms 3                 // SMS (All rx/tx)
?  //-------------------------------------- FBCCH SOC/BSMC ID Message (sah 8/13/97) moved to ebcch (br 10/4/97)
?  :css:ebcch:msg:soc_bsmc 1            // enable soc_bsmc message
?  :css:ebcch:soc SBC_SOC               // set soc=4 (Soutwestern Bell)
?  :css:ebcch:bsmc 0                    // set bsmc=0
? 
?  ///////////////////////////////////////////////////////////////////////
?  // Added IRA and OATS Service Menu IE's (sah 8/14/97)
?  :css:ebcch:ira 1                // IRA support IE is set on
? 
?  // build OATS Support IE using user defined messaging
?  :css:ebcch:opt:msg 0,8          // build service menu message type
?  :css:ebcch:opt:length 0,1       // IE is 1 bit long
?  :css:ebcch:opt:data 0,0,#h8000  // Set MSB=1 of 16-bit word to set on
?  ///////////////////////////////////////////////////////////////////////
? 
?  //------------------------------------- Build the EBCCH Messages
?  :css:ebcch:build
?  neb = :css:ebcch:length?
?  :css:ebcch:ecl neb  // number of unique ebcch per superframe
?  :css:fbcch:number:fbcch nfb-3    //number:fbcch is number of additional fbcch (past required 3)
?  :css:fbcch:number:ebcch neb-1    // (past required 1)
?//  print "Building EBCCH Messages"
?//  print "Number of EBCCH Messages: ",neb
?  :css:fbcch:build;program
?  :css:ebcch:program nfb,0,neb  // 0 is the start location in the ebcch buffer
?  :css:fdcch:super:increment 1  // automatically increment hyperframe counter
? 
?end

end
   ^
-102,"SYNTAX ERROR"
1900CSA -->Main
? 
?///////////////////////////////////////////////////////////////////////
?// BLIFE:  This is the main macro that will call all the sub macros.
?//         Macro will call to setup the DCCH and then count 
?//         registrations
?///////////////////////////////////////////////////////////////////////
?*dmc "dpage",begin
?  var a
? 
?  a = syst:time?
?  rand a
?  print ""
?  print "DCCH Paging Reliability"
?  print "Version ",revnum,", ",revdate
?  print ""
?  dcch_setup

  dcch_setup
  ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?  
?  user
?  erase:text 0,35,640
?  center "DCCH Paging Reliability", 0, 35, 640  
?  erase:text 0,65,640
?  center "for IS-136 Handsets", 0, 65, 640
?  erase:text 5,5,315
?  ljprint revnum, 5, 5, 315
?  erase:text 320,5,315
?  rjprint revdate, 320, 5, 315
? 
?  ///////////////////////////////////////////////////////////////////////
?      :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_cb[num_neigh-1]

      :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_cb[num_neigh-1]
                                                                    ^
-222,"DATA OUT OF RANGE"
1900CSA -->Main
?      endcase

      endcase
             ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?    of 2:

    of 2:
      ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?      case system_select

      case system_select
          ^
-181,"INVALID OUTSIDE MACRO DEFINITION"
1900CSA -->Main
?      of 1:

      of 1:
        ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pa[num_neigh-1]

        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pa[num_neigh-1]
                                                                      ^
-222,"DATA OUT OF RANGE"
1900CSA -->Main
?      of 2:

      of 2:
        ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pb[num_neigh-1]

        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pb[num_neigh-1]
                                                                      ^
-222,"DATA OUT OF RANGE"
1900CSA -->Main
?      endcase

      endcase
             ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?    endcase

    endcase
           ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?    :css:ebcch:neigh:tdma:cell:prot num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:dvcc num_neigh-1,num_neigh
?    :css:ebcch:neigh:tdma:cell:off num_neigh-1,61
?    :css:ebcch:neigh:tdma:cell:ss_suff num_neigh-1,7
?    :css:ebcch:neigh:tdma:cell:delay num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:hl_freq num_neigh-1,hlfreq
?    :css:ebcch:neigh:tdma:cell:sync num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:type:cell num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:type:net num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:retry num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:acc:ms_pwr num_neigh-1,2
?    :css:ebcch:neigh:tdma:cell:acc:rss_min num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:psid_rsid:ind num_neigh-1,0
?    num_neigh--
?  wend

  wend
      ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?  endif

  endif
       ^
-181,"INVALID OUTSIDE MACRO DEFINITION"
1900CSA -->Main
?  //------------------------------------- Build EBCCH Regulatory Config MSG
?  :css:ebcch:msg:rci 1                 // Enable Regulatory Information
?  :css:ebcch:rci 1                     // RCI=1 (ref 6.3.1.1.2)
?  //------------------------------------- Build a Service Menu MSG
?  :css:ebcch:msgtype:service 1         // Enable Service Menu
?  :css:ebcch:map:vpm 0                 // No voice privacy map
?  :css:ebcch:map:dpm 0                 // No digital voice privacy
?  :css:ebcch:map:coder 3               // Support multiple coders
?  :css:ebcch:map:mea:domain 0
?  :css:ebcch:map:mea:algor 0,0         // No message encryption
?  :css:ebcch:map:mek 0
?  :css:ebcch:map:menu 4                // Full Rate DTC
?  :css:ebcch:map:arq 0                 // No ARQ
?  :css:ebcch:map:user 0
?  :css:ebcch:map:sms 3                 // SMS (All rx/tx)
?  //-------------------------------------- FBCCH SOC/BSMC ID Message (sah 8/13/97) moved to ebcch (br 10/4/97)
?  :css:ebcch:msg:soc_bsmc 1            // enable soc_bsmc message
?  :css:ebcch:soc SBC_SOC               // set soc=4 (Soutwestern Bell)
?  :css:ebcch:bsmc 0                    // set bsmc=0
? 
?  ///////////////////////////////////////////////////////////////////////
?  // Added IRA and OATS Service Menu IE's (sah 8/14/97)
?  :css:ebcch:ira 1                // IRA support IE is set on
? 
?  // build OATS Support IE using user defined messaging
?  :css:ebcch:opt:msg 0,8          // build service menu message type
?  :css:ebcch:opt:length 0,1       // IE is 1 bit long
?  :css:ebcch:opt:data 0,0,#h8000  // Set MSB=1 of 16-bit word to set on
?  ///////////////////////////////////////////////////////////////////////
? 
?  //------------------------------------- Build the EBCCH Messages
?  :css:ebcch:build
?  neb = :css:ebcch:length?
?  :css:ebcch:ecl neb  // number of unique ebcch per superframe
?  :css:fbcch:number:fbcch nfb-3    //number:fbcch is number of additional fbcch (past required 3)
?  :css:fbcch:number:ebcch neb-1    // (past required 1)
?//  print "Building EBCCH Messages"
?//  print "Number of EBCCH Messages: ",neb
?  :css:fbcch:build;program
?  :css:ebcch:program nfb,0,neb  // 0 is the start location in the ebcch buffer
?  :css:fdcch:super:increment 1  // automatically increment hyperframe counter
? 
?end

end
   ^
-102,"SYNTAX ERROR"
1900CSA -->Main
? 
?///////////////////////////////////////////////////////////////////////
?// BLIFE:  This is the main macro that will call all the sub macros.
?//         Macro will call to setup the DCCH and then count 
?//         registrations
?///////////////////////////////////////////////////////////////////////
?*dmc "dpage",begin
?  var a
? 
?  a = syst:time?
?  rand a
?  print ""
?  print "DCCH Paging Reliability"
?  print "Version ",revnum,", ",revdate
?  print ""
?  dcch_setup

  dcch_setup
  ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?  
?  user
?  erase:text 0,35,640
?  center "DCCH Paging Reliability", 0, 35, 640  
?  erase:text 0,65,640
?  center "for IS-136 Handsets", 0, 65, 640
?  erase:text 5,5,315
?  ljprint revnum, 5, 5, 315
?  erase:text 320,5,315
?  rjprint revdate, 320, 5, 315
? 
?  ///////////////////////////////////////////////////////////////////////
?    :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_cb[num_neigh-1]

    :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_cb[num_neigh-1]
                                                                  ^
-222,"DATA OUT OF RANGE"
1900CSA -->Main
?      endcase

      endcase
             ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?    of 2:

    of 2:
      ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?      case system_select

      case system_select
          ^
-181,"INVALID OUTSIDE MACRO DEFINITION"
1900CSA -->Main
?      of 1:

      of 1:
        ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pa[num_neigh-1]

        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pa[num_neigh-1]
                                                                      ^
-222,"DATA OUT OF RANGE"
1900CSA -->Main
?      of 2:

      of 2:
        ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pb[num_neigh-1]

        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pb[num_neigh-1]
                                                                      ^
-222,"DATA OUT OF RANGE"
1900CSA -->Main
?      endcase

      endcase
             ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?    endcase

    endcase
           ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?    :css:ebcch:neigh:tdma:cell:prot num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:dvcc num_neigh-1,num_neigh
?    :css:ebcch:neigh:tdma:cell:off num_neigh-1,61
?    :css:ebcch:neigh:tdma:cell:ss_suff num_neigh-1,7
?    :css:ebcch:neigh:tdma:cell:delay num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:hl_freq num_neigh-1,hlfreq
?    :css:ebcch:neigh:tdma:cell:sync num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:type:cell num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:type:net num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:retry num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:acc:ms_pwr num_neigh-1,2
?    :css:ebcch:neigh:tdma:cell:acc:rss_min num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:psid_rsid:ind num_neigh-1,0
?    num_neigh--
?  wend

  wend
      ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?  endif

  endif
       ^
-181,"INVALID OUTSIDE MACRO DEFINITION"
1900CSA -->Main
?  //------------------------------------- Build EBCCH Regulatory Config MSG
?  :css:ebcch:msg:rci 1                 // Enable Regulatory Information
?  :css:ebcch:rci 1                     // RCI=1 (ref 6.3.1.1.2)
?  //------------------------------------- Build a Service Menu MSG
?  :css:ebcch:msgtype:service 1         // Enable Service Menu
?  :css:ebcch:map:vpm 0                 // No voice privacy map
?  :css:ebcch:map:dpm 0                 // No digital voice privacy
?  :css:ebcch:map:coder 3               // Support multiple coders
?  :css:ebcch:map:mea:domain 0
?  :css:ebcch:map:mea:algor 0,0         // No message encryption
?  :css:ebcch:map:mek 0
?  :css:ebcch:map:menu 4                // Full Rate DTC
?  :css:ebcch:map:arq 0                 // No ARQ
?  :css:ebcch:map:user 0
?  :css:ebcch:map:sms 3                 // SMS (All rx/tx)
?  //-------------------------------------- FBCCH SOC/BSMC ID Message (sah 8/13/97) moved to ebcch (br 10/4/97)
?  :css:ebcch:msg:soc_bsmc 1            // enable soc_bsmc message
?  :css:ebcch:soc SBC_SOC               // set soc=4 (Soutwestern Bell)
?  :css:ebcch:bsmc 0                    // set bsmc=0
? 
?  ///////////////////////////////////////////////////////////////////////
?  // Added IRA and OATS Service Menu IE's (sah 8/14/97)
?  :css:ebcch:ira 1                // IRA support IE is set on
? 
?  // build OATS Support IE using user defined messaging
?  :css:ebcch:opt:msg 0,8          // build service menu message type
?  :css:ebcch:opt:length 0,1       // IE is 1 bit long
?  :css:ebcch:opt:data 0,0,#h8000  // Set MSB=1 of 16-bit word to set on
?  ///////////////////////////////////////////////////////////////////////
? 
?  //------------------------------------- Build the EBCCH Messages
?  :css:ebcch:build
?  neb = :css:ebcch:length?
?  :css:ebcch:ecl neb  // number of unique ebcch per superframe
?  :css:fbcch:number:fbcch nfb-3    //number:fbcch is number of additional fbcch (past required 3)
?  :css:fbcch:number:ebcch neb-1    // (past required 1)
?//  print "Building EBCCH Messages"
?//  print "Number of EBCCH Messages: ",neb
?  :css:fbcch:build;program
?  :css:ebcch:program nfb,0,neb  // 0 is the start location in the ebcch buffer
?  :css:fdcch:super:increment 1  // automatically increment hyperframe counter
? 
?end

end
   ^
-102,"SYNTAX ERROR"
1900CSA -->Main
? 
?///////////////////////////////////////////////////////////////////////
?// BLIFE:  This is the main macro that will call all the sub macros.
?//         Macro will call to setup the DCCH and then count 
?//         registrations
?///////////////////////////////////////////////////////////////////////
?*dmc "dpage",begin
?  var a
? 
?  a = syst:time?
?  rand a
?  print ""
?  print "DCCH Paging Reliability"
?  print "Version ",revnum,", ",revdate
?  print ""
?  dcch_setup

  dcch_setup
  ^
-102,"SYNTAX ERROR"
1900CSA -->Main
?  
?  user
?  erase:text 0,35,640
?  center "DCCH Paging Reliability", 0, 35, 640  
?  erase:text 0,65,640
?  center "for IS-136 Handsets", 0, 65, 640
?  erase:text 5,5,315
?  ljprint revnum, 5, 5, 315
?  erase:text 320,5,315
?  rjprint revdate, 320, 5, 315
? 
?  ///////////////////////////////////////////////////////////////////////
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
TMAC  Interpreter -- Digital Cellular version
Copyright(c) IFR   Systems, Inc. 1991-1996
1900CSA -->Main
TMAC  Interpreter -- Digital Cellular version
Copyright(c) IFR   Systems, Inc. 1991-1996
1900CSA -->Main
?
?
?
?
?///////////////////////////////////////////////////////////////////////
?//
?//  FILE: DPR
?//                                                
?//  VERSION: 1.0b1 04/06/98
?//
?//  DESCRIPTION: This macro is used to test the standby battery life
?//               of IS-136 handsets. It sets up a DCCH with a periodic
?//               registration rate set by the user. The program counts
?//               the number of registrations and the elapsed time.
?//
?//  AUTHOR: Bill Rosenberg
?//
?///////////////////////////////////////////////////////////////////////
?//
?//  Main macro: DPR
?//  Sub macros: reg_ms, dcch_setup, get_ch, ch_a, ch_b
?//
?///////////////////////////////////////////////////////////////////////
?*pmc
?var pch_sub
?var system_select = 2, band_select = 1
?var regperval = 30
?var regcount, pagecount, pagefail
?string regtimef
?var regtimef_h
?var regtimef_m
?var regtimef_s
?string regtimel
?string regtime
?var regtimel_h
?var regtimel_m
?var regtimel_s
?var t_start, t_end, timelapse
?var substr
?var strend
?string strtemp1, strtemp2
?string revnum = "1.1b4"
?string revdate = "03/12/98"
?var num_neigh, neigh_list, hlfreq, scan_interval, scan_option
?var nl_ca[24]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24}
?var nl_cb[24]={334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357}
?var nl_pa[24]={2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25}
?var nl_pb[24]={668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691}
? 
?var phnum       // for storing the MSID, added 8/15/97
?var nfb, neb 
? 
?const SBC_SOC, 4             // sah 8/15/97
? 
?///////////////////////////////////////////////////////////////////////
?//ch_a: choose a side channel
?///////////////////////////////////////////////////////////////////////
?*dmc "ch_a",begin
?var cn
? 
?  case band_select
? 
?    of 1:    // cellular
?       cn = 991
? 
?    of 2:    // PCS
?       cn = 251
? 
?  endcase
? 
? return cn
?end
? 
?///////////////////////////////////////////////////////////////////////
?//ch_b: choose b side channel with input from the user
?///////////////////////////////////////////////////////////////////////
?*dmc "ch_b",begin
?var cn
? 
?  case band_select
? 
?    of 1:    // cellular
?       cn = 767
? 
?    of 2:    // PCS
?       cn = 917
? 
?  endcase
? 
? return cn
? 
?end
? 
?///////////////////////////////////////////////////////////////////////
?//get_ch: get channel based on system selected
?///////////////////////////////////////////////////////////////////////
?*dmc "get_ch",begin
? 
?   if system_select = 1 
?    a = ch_a 
?   endif
? 
?   if system_select = 2
?    a =  ch_b
?   endif
?return a
?end 
? 
?*dmc "page_min", begin
?    :css:spach:bu 5
?    :css:spach:idt 2
?    :css:spach:min1 phnum
?    :css:spach:bcn 0
?    :css:spach:pfm 0
? 
?    send_hard pch_sub
?    print "Sending page"
?    print ""
?    print "Waiting for page response, hit 'Q' to quit"
?    print ""
?end
? 
?///////////////////////////////////////////////////////////////////////
?// reg_ms: This macro waits for the MS to register,
?//      determines the MSID, and sends Reg Accept
?///////////////////////////////////////////////////////////////////////
?*dmc "reg_ms", begin
?  var paid, ns, nsb, nrs, nnp, nb, np
?  var key_value = 0
?  regcount = 0
?  :rdcch:length:normal
?  :rdcch:l3data:sel 0
?  key_value=0
?  print "Waiting for registration, hit 'Q' to quit"
?  print ""
?  do
?  do
?    tpause
?    $ = :rdcch:msgtype?
?    if ($ != "-1") 
?      print $
?    endif
?  until key? or ($ = "REGISTRATION") or ($ = "PAGE RESPONSE")
? 
? 
? 
?  if ($="REGISTRATION")
?    regtime = syst:time?
?    phnum = :rdcch:min?
?    print ""
?    print "Received from MSID ",phnum," at ",regtime
?    :css:spach:min1 phnum     // added for correct calculation of paid, ckc 9/3/97
?    erase:text 0,125,640
?    center phnum, 0, 125, 640
?    paid = (:css:spach:msid:ls? 0) & #hffff
?//    print "PAID: ", paid
?    ns = 2
?    nsb = :css:fbcch:number:sbcch?
?    nrs = :css:fbcch:number:res?
?    nnp = :css:fbcch:number:non_pch?
?    nb = nfb+neb+nsb+nrs
?//    print  "nb=",nb                 // number of system broadcasts
?    np = (32-nb)-(nnp*2)
?//    print "np=",np
?    pch_sub = ((paid/ns)%np)+nb
?//    print "pch_subchan = ",pch_sub
? 
? 
?    :css:spach:bu 3
?    :css:spach:bt 0
?    :css:spach:idt 2
?    :css:spach:min1 phnum
?    :css:spach:bcn 0
?    :css:spach:pfm 0
?    :css:spach:mm 0
?    :css:spach:ehi 0
?    :css:spach:enable:rnum:list 0
?    :css:spach:enable:pfc:assignment 0
?    :css:spach:enable:msid:assignment 0
?    :css:spach:enable:user:group 0
?    :css:spach:enable:psid_rsid:avail 0
?    :css:spach:enable:disp 0
?    :css:spach:enable:dir:addr 0
?    :css:spach:enable:dir:sub 0
?    :css:spach:msgtype1:reg_accept
? 
?    send_arch pch_sub
?    print "Sending registration accept"
?    print ""
?    page_min
?  elif ($ = "PAGE RESPONSE")
? 
?    print "Got Page Response"
?//    delay 6000
?//    page_min
?  else      // $ != Registration
? 
?    key_value = key
? 
?  endif
?  until key_value=81 or key_value=113
? 
?end
? 
? 
?///////////////////////////////////////////////////////////////////////
?// dcch_setup:This macro sets up the DCCH with all the mandatory FBCCH
?//            and EBCCH messages. 
?///////////////////////////////////////////////////////////////////////
?*dmc "dcch_setup", begin
?var enter_sid
?// var paid,np,nb,nfb,neb,nsb,nrs,nnp,ns  // moved to reg_ms macro
?var i
?var ch_num
? 
?  //-------------------------------------- SETUP EQUIPMENT TO TRANSMIT
?  :css:set
?  delay 500
? 
?  input "Select frequency (1 = 800 MHz, 2 = 1900 MHz): ", band_select
?  freq:band band_select
? 
?  input "Select band (1 = Band A, 2 = Band B): ", system_select
?  ch_num = get_ch
?  :css:chan ch_num                    // Channel number
? 
?  input "Enter registration period (0-511): ", regperval
?  input "Enter SCANINTERVAL (0-15): ", scan_interval
?  input "Select Scanning Option Indicator (0,1): ", scan_option
? 
?  input "Enter number of TDMA neighbors (0-24): ", num_neigh
?  if num_neigh != 0
?    neigh_list = 1
?    input "Select HL_FREQ (0 = Low, 1 = High): ", hlfreq
?  endif
?  // set RF level
?  :css:rflvl -55                      // (DCC 4/5 needs valid DCCH rflvl >= -89 dBm)
?  :css:rate 0                         // Full Rate
? 
?  //sets Automatic Gain Control from 0-255
?  host ":dup:inp:agc:man 100"
? 
?  //sends previous commands out the SCSI to the 1600S
?  hflush
? 
?  //set the rdcch to be rach
?  :css:fdcch:super:acc:rand            // Random Access
?  :css:fdcch:super:access:pe 0         // No collision because we are only conversation on the air
?  enable_sat 0
? 
?  //-------------------------------------- DATA COMMON TO ALL SLOTS
?  :css:fdcch:super:zero                // Set all fields to zero
?  for i = 0 to 31
?    :css:fdcch:super:sfp i,i           // Program the SFP
?    :css:fdcch:super:rn i,0            // RN (received/not received) bits programed to 0
?    :css:fdcch:super:bri i,0           // BRI (busy/resv/idle) bits programed to 0
?    :css:fdcch:super:pe i,0            // PE (partial echo) bits programed to 0
?  next i
?  //by definition, we send *at least* 4 frames
?  for i = 4 to 31                      // Frames 7-32 are SPACH
?    css:fdcch:super:type i,3
?  next i
?  :css:fdcch:super:start
?  :css:fdcch:super:dvcc #h2c
?  :css:fbcch:fc 0                      // F-BCCH Change (new data?)
?  :css:fbcch:ec 0                      // E-BCCH Change (new data?)
?  //------------------------------------- FBCCH Structure Message
?  :css:fbcch:msg:struct 1              // Enable FBCCH Structure Message
?  :css:fbcch:num:fbcch 2               // Number of FBCCH = 0
?  :css:fbcch:num:ebcch 1               // Number of EBCCH = 0
?  :css:fbcch:num:sbcch 0               // No SBCCH
?  :css:fbcch:num:res 0                 // No reserved
?  :css:fbcch:con 1                     // Use slot configurtion 1
?  :css:fbcch:dvcc #h2c                 // Use DVCC of #h2c???
?  :css:fbcch:pfc 0                     // Max supported PFC = 0
?  :css:fbcch:pch 0                     // PCH Displacement = 0
?  :css:fbcch:pfm 0                     // PFM Direction = 0
?  :css:fbcch:num:non_pch 0             // Number of non-pch subchannel slots
?  //------------------------------------- FBCCH System Access Message
?  :css:fbcch:msg:acc 1                 // Enable Access Parameters Message
?  :css:fbcch:auth 0                    // Disable Authentication
?  :css:fbcch:s 1                       // Send serial number message
?  :css:fbcch:rand 0                    // Random number for auth = 0
?  :css:fbcch:acc:ms_pwr 2              // Mobile station shall use ATTN=2
?  :css:fbcch:acc:burstsize 0           // Use abbreviated length burst on the RACH ???
?  :css:fbcch:max:retries 7             // Max Retries=7
?  :css:fbcch:max:busy 1                // Max Busy/Reserved = 1
?  :css:fbcch:max:repetitions 3         // Max Repetitions = 3
?  :css:fbcch:max:stop 1                // Max Stop Counter = 1
?  :css:fbcch:rdata:length 0            // R-DATA Message Length = 0
?  :css:fbcch:barred 0                  // Cell Barred = off
?  :css:fbcch:subaddressing 0           // Subaddressing support = no
?  :css:fbcch:dic 0                     // Delay Interval Compenstation = off
?  //------------------------------------- FBCCH Control Channel Selection
?  :css:fbcch:msg:sel 1                   // Enable Control Channel Selection Param.
?  :css:fbcch:ss_suff 0                   // Minimum Signal Strength allowed = -120 dB
?  :css:fbcch:acc:rss_min 0               // Minimum signal strength to access cell = -120 dB
?  :css:fbcch:scan:interval scan_interval // Scan Interval = 0
?  :css:fbcch:initial 0                   // Initial Selection Control = 0
?  :css:fbcch:delay 0                     // Delay 0 Superframes
?  :css:fbcch:scan:option scan_option     // Do not use optional enhancements
?  //------------------------------------- FBCCH Registration Parameters
?  :css:fbcch:msg:registration 1        // Enable Registration Message
?  :css:fbcch:regh 1                    // Allow home mobile station to register
?  :css:fbcch:regr 1                            // Allow roaming
?  :css:fbcch:pureg 1                           // Allow power-up registration
?  :css:fbcch:pdreg 1                   // Allow power-down registration
?  :css:fbcch:syreg 1                   // Register when entering a new ID area
?  :css:fbcch:lareg 1
?  :css:fbcch:dereg 1                   // Allow de-registration
?  :css:fbcch:foreg 1                   // Forced registration
?  :css:fbcch:capability 1              // Send a Capability Request Message
?  :css:fbcch:enable:regper 1           // Enable periodic registration control
?  :css:fbcch:regper regperval          // Set periodic registration time
?  //------------------------------------- FBCCH System ID
?  :css:fbcch:msg:sysid 1               // Enable System ID Message
?  input "Enter SID to be broadcast: ",enter_sid
?  :css:fbcch:sid  enter_sid            // System ID=??
?  :css:fbcch:net 4                     // Network type = 4 (Public)
?  :css:fbcch:prot 4                    // Protocol Version = 4 (IS136-A, sah 8/13/97)
?  :css:fbcch:enable:psid_rsid 0        // do not build PSID/RSID list
?  :css:fbcch:enable:alpha:sid 1        // Enable ALPHA SID
?  :css:fbcch:alpha:sid "Standby Test"  // Set ALPHA SID
?  //------------------------------------- Build FBCCH Frames
?  :css:fbcch:build
?  nfb =  :css:fbcch:length?
?//  print "Building FBCCH Frames ..."
?//  print "Number of FBCCH Frames = ",nfb
?  if nfb < 0
?    nfb = 0
?  endif
?  //------------------------------------- Build EBCCH Neighbor Cell MSG
?  :css:ebcch:msg:neigh:cell neigh_list   // Enable Neighbor Cell Message
?  if neigh_list = 1
?  :css:ebcch:serv_ss 0                   // Reselection Trigger condition not allowed
?  :css:ebcch:enable:neighbor:tdma neigh_list // Enable TDMA Neighbor List OE
?  :css:ebcch:neigh:tdma:num num_neigh     // Send NL entries
?  while num_neigh != 0
?    case band_select   // select neighbors
?    of 1:
?      case system_select
?      of 1:
?        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_ca[num_neigh-1]
?      of 2:
?        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_cb[num_neigh-1]
?      endcase
?    of 2:
?      case system_select
?      of 1:
?        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pa[num_neigh-1]
?      of 2:
?        :css:ebcch:neigh:tdma:cell:chan num_neigh-1,nl_pb[num_neigh-1]
?      endcase
?    endcase
?    :css:ebcch:neigh:tdma:cell:prot num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:dvcc num_neigh-1,num_neigh
?    :css:ebcch:neigh:tdma:cell:off num_neigh-1,61
?    :css:ebcch:neigh:tdma:cell:ss_suff num_neigh-1,7
?    :css:ebcch:neigh:tdma:cell:delay num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:hl_freq num_neigh-1,hlfreq
?    :css:ebcch:neigh:tdma:cell:sync num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:type:cell num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:type:net num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:retry num_neigh-1,0
?    :css:ebcch:neigh:tdma:cell:acc:ms_pwr num_neigh-1,2
?    :css:ebcch:neigh:tdma:cell:acc:rss_min num_neigh-1,4
?    :css:ebcch:neigh:tdma:cell:psid_rsid:ind num_neigh-1,0
?    num_neigh--
?  wend
?  endif
?  //------------------------------------- Build EBCCH Regulatory Config MSG
?  :css:ebcch:msg:rci 1                 // Enable Regulatory Information
?  :css:ebcch:rci 1                     // RCI=1 (ref 6.3.1.1.2)
?  //------------------------------------- Build a Service Menu MSG
?  :css:ebcch:msgtype:service 1         // Enable Service Menu
?  :css:ebcch:map:vpm 0                 // No voice privacy map
?  :css:ebcch:map:dpm 0                 // No digital voice privacy
?  :css:ebcch:map:coder 3               // Support multiple coders
?  :css:ebcch:map:mea:domain 0
?  :css:ebcch:map:mea:algor 0,0         // No message encryption
?  :css:ebcch:map:mek 0
?  :css:ebcch:map:menu 4                // Full Rate DTC
?  :css:ebcch:map:arq 0                 // No ARQ
?  :css:ebcch:map:user 0
?  :css:ebcch:map:sms 3                 // SMS (All rx/tx)
?  //-------------------------------------- FBCCH SOC/BSMC ID Message (sah 8/13/97) moved to ebcch (br 10/4/97)
?  :css:ebcch:msg:soc_bsmc 1            // enable soc_bsmc message
?  :css:ebcch:soc SBC_SOC               // set soc=4 (Soutwestern Bell)
?  :css:ebcch:bsmc 0                    // set bsmc=0
? 
?  ///////////////////////////////////////////////////////////////////////
?  // Added IRA and OATS Service Menu IE's (sah 8/14/97)
?  :css:ebcch:ira 1                // IRA support IE is set on
? 
?  // build OATS Support IE using user defined messaging
?  :css:ebcch:opt:msg 0,8          // build service menu message type
?  :css:ebcch:opt:length 0,1       // IE is 1 bit long
?  :css:ebcch:opt:data 0,0,#h8000  // Set MSB=1 of 16-bit word to set on
?  ///////////////////////////////////////////////////////////////////////
? 
?  //------------------------------------- Build the EBCCH Messages
?  :css:ebcch:build
?  neb = :css:ebcch:length?
?  :css:ebcch:ecl neb  // number of unique ebcch per superframe
?  :css:fbcch:number:fbcch nfb-3    //number:fbcch is number of additional fbcch (past required 3)
?  :css:fbcch:number:ebcch neb-1    // (past required 1)
?//  print "Building EBCCH Messages"
?//  print "Number of EBCCH Messages: ",neb
?  :css:fbcch:build;program
?  :css:ebcch:program nfb,0,neb  // 0 is the start location in the ebcch buffer
?  :css:fdcch:super:increment 1  // automatically increment hyperframe counter
? 
?end
? 
?///////////////////////////////////////////////////////////////////////
?// BLIFE:  This is the main macro that will call all the sub macros.
?//         Macro will call to setup the DCCH and then count 
?//         registrations
?///////////////////////////////////////////////////////////////////////
?*dmc "dpage",begin
?  var a
? 
?  a = syst:time?
?  rand a
?  print ""
?  print "DCCH Paging Reliability"
?  print "Version ",revnum,", ",revdate
?  print ""
?  dcch_setup
?  
?  user
?  erase:text 0,35,640
?  center "DCCH Paging Reliability", 0, 35, 640  
?  erase:text 0,65,640
?  center "for IS-136 Handsets", 0, 65, 640
?  erase:text 5,5,315
?  ljprint revnum, 5, 5, 315
?  erase:text 320,5,315
?  rjprint revdate, 320, 5, 315
? 
?  ///////////////////////////////////////////////////////////////////////
?  // Added by sah 8/15/97 to get MIN at power up
?  print ""
?  print "POWER UP THE HANDSET"
?  print ""
?  reg_ms
?  print "End of test"
? 
?end
?
?
?dpage

DCCH Paging Reliability
Version 1.1b4, 03/12/98

Select frequency (1 = 800 MHz, 2 = 1900 MHz): ?1
Select band (1 = Band A, 2 = Band B): ?2
