Determine whether we should use slow or fast channel coding for the specified direction.
| 808 | |
| 809 | // Determine whether we should use slow or fast channel coding for the specified direction. |
| 810 | ChannelCodingType MSInfo::msGetChannelCoding(RLCDirType wdir) const |
| 811 | { |
| 812 | // Initial channel coding is determined from RSSI from most recent burst from MS. |
| 813 | // If the signal strength was low (less than -40db) then use the slow speed. |
| 814 | // TODO: For subsequent TBFs we should use statistics from previous TBFs. |
| 815 | // BEGINCONFIG |
| 816 | // 'GPRS.ChannelCodingControl.RSSI',-40,0,0,'If the initial signal strength is less than this amount in DB GPRS uses a lower bandwidth but more robust encoding CS-1' |
| 817 | // ENDCONFIG |
| 818 | |
| 819 | // Allow user full control over the codecs with these options: |
| 820 | const char *option = (wdir == RLCDir::Up) ? "GPRS.Codecs.Uplink" : "GPRS.Codecs.Downlink"; |
| 821 | const char *codecs = gConfig.getStr(option).c_str(); |
| 822 | // We only support CS1 and CS4. |
| 823 | bool cs1allowed = strchr(codecs,'1'); |
| 824 | bool cs4allowed = strchr(codecs,'4'); |
| 825 | if (cs1allowed && cs4allowed) { |
| 826 | // Choose codec based on initial signal strength: |
| 827 | int fastRSSI = gConfig.getNum("GPRS.ChannelCodingControl.RSSI"); |
| 828 | return (msRSSI.getCurrent() < fastRSSI) ? ChannelCodingCS1 : ChannelCodingCS4; |
| 829 | } else if (cs4allowed) { |
| 830 | return ChannelCodingCS4; |
| 831 | } else { |
| 832 | return ChannelCodingCS1; |
| 833 | } |
| 834 | } |
| 835 | |
| 836 | // UNUSED |
| 837 | // Not a MSInfo member function, but still related to MSInfo. |