コード例 #1
0
 def GetEnodebStatus(
     self,
     request: EnodebIdentity,
     _context=None,
 ) -> SingleEnodebStatus:
     return get_single_enb_status(request.device_serial,
                                  self.state_machine_manager)
コード例 #2
0
ファイル: rpc_servicer.py プロジェクト: talkhasib/magma
 def GetAllEnodebStatus(self, _=None, context=None) -> AllEnodebStatus:
     print_grpc(
         Void(),
         self._print_grpc_payload,
         "GetAllEnodebStatus Request:",
     )
     all_enb_status = AllEnodebStatus()
     serial_list = self.state_machine_manager.get_connected_serial_id_list()
     for enb_serial in serial_list:
         enb_status = get_single_enb_status(
             enb_serial,
             self.state_machine_manager,
         )
         all_enb_status.enb_status_list.add(
             device_serial=enb_status.device_serial,
             ip_address=enb_status.ip_address,
             connected=enb_status.connected,
             configured=enb_status.configured,
             opstate_enabled=enb_status.opstate_enabled,
             rf_tx_on=enb_status.rf_tx_on,
             rf_tx_desired=enb_status.rf_tx_desired,
             gps_connected=enb_status.gps_connected,
             ptp_connected=enb_status.ptp_connected,
             mme_connected=enb_status.mme_connected,
             gps_longitude=enb_status.gps_longitude,
             gps_latitude=enb_status.gps_latitude,
             fsm_state=enb_status.fsm_state,
         )
     print_grpc(
         all_enb_status,
         self._print_grpc_payload,
         "GetAllEnodebStatus Response:",
     )
     return all_enb_status
コード例 #3
0
 def test_get_single_enb_status(self):
     manager = self._get_manager()
     ctx1 = get_spyne_context_with_ip("192.168.60.145")
     inform_msg = Tr069MessageBuilder.get_inform('48BF74',
                                                 'BaiBS_RTS_3.1.6',
                                                 '120200002618AGP0001')
     manager.handle_tr069_message(ctx1, inform_msg)
     status = get_single_enb_status('120200002618AGP0001', manager)
     self.assertEquals(status.connected,
                       SingleEnodebStatus.StatusProperty.Value('ON'),
                       'Status should be connected.')
     self.assertEquals(status.configured,
                       SingleEnodebStatus.StatusProperty.Value('OFF'),
                       'Status should be not configured.')
コード例 #4
0
ファイル: rpc_servicer.py プロジェクト: talkhasib/magma
 def GetEnodebStatus(
     self,
     request: EnodebIdentity,
     _context=None,
 ) -> SingleEnodebStatus:
     print_grpc(
         request,
         self._print_grpc_payload,
         "GetEnodebStatus Request:",
     )
     response = get_single_enb_status(
         request.device_serial,
         self.state_machine_manager,
     )
     print_grpc(
         response,
         self._print_grpc_payload,
         "GetEnodebStatus Response:",
     )
     return response
コード例 #5
0
    def GetAllEnodebStatus(self, _=None, context=None) -> AllEnodebStatus:
        all_enb_status = AllEnodebStatus()
        serial_list = self.state_machine_manager.get_connected_serial_id_list()
        for enb_serial in serial_list:
            enb_status = get_single_enb_status(enb_serial,
                                               self.state_machine_manager)
            all_enb_status.enb_status_list.add(
                device_serial=enb_status.device_serial,
                ip_address=enb_status.ip_address,
                connected=enb_status.connected,
                configured=enb_status.configured,
                opstate_enabled=enb_status.opstate_enabled,
                rf_tx_on=enb_status.rf_tx_on,
                gps_connected=enb_status.gps_connected,
                ptp_connected=enb_status.ptp_connected,
                mme_connected=enb_status.mme_connected,
                gps_longitude=enb_status.gps_longitude,
                gps_latitude=enb_status.gps_latitude,
                fsm_state=enb_status.fsm_state,
            )

        return all_enb_status