Exemplo n.º 1
0
 def set_network_band(self, config):
     bands = self._get_param(config, 'bands')
     #Fuge to always add the extra unexplained values
     bands.append('EXTRA')
     net = xmlobjects.NetworkMode()
     net.parseXML(self.mode)
     net.set_network_band(bands)
     return self.api('net/net-mode', net)
Exemplo n.º 2
0
 def set_lte_band(self, config):
     '''
     <NetworkMode>00</NetworkMode>
     <NetworkBand>100200000CE80380</NetworkBand>
     <LTEBand>80080000C5</LTEBand>
     '''
     bands = self._get_param(config, 'bands')
     net = xmlobjects.NetworkMode()
     net.parseXML(self.mode)
     net.set_lte_band(bands)
     return self.api('net/net-mode', net)
Exemplo n.º 3
0
    def modelist2(self):
        net = xmlobjects.NetworkMode()
        net.parseXML(self.mode)

        net_bands = []
        for band in xmlobjects.NetworkMode.band_from_hex(net.NetworkBand):
            if (band == 'EXTRA'):
                continue
            net_bands.append(xmlobjects.CustomXml({'Band': band}))

        lte_bands = []
        for band in xmlobjects.NetworkMode.lte_from_hex(net.LTEBand):
            lte_bands.append(xmlobjects.CustomXml({'Band': band}))
        xml = xmlobjects.CustomXml({
            'NetworkMode':
            xmlobjects.NetworkMode.get_mode(net.NetworkMode),
            'NetworkBands':
            net_bands,
            'LTEBands':
            lte_bands
        })
        return xml.buildXmlResponse()
Exemplo n.º 4
0
 def set_network_mode(self, config):
     mode = self._get_param(config, 'mode')
     net = xmlobjects.NetworkMode()
     net.parseXML(self.mode)
     net.set_network_mode(mode)
     return self.api('net/net-mode', net)