Beispiel #1
0
def submitData(dataRaw):
    global APIPipe
    print(APIPipe)
    data = RawCoT()
    data.clientInformation = "SERVER"
    data.xmlString = dataRaw.encode()
    APIPipe.send([data])
Beispiel #2
0
def test(json):
    modelObject = Event.dropPoint()
    out = XMLCoTController().serialize_CoT_to_model(modelObject,
                                                    etree.fromstring(json))
    xml = XMLCoTController().serialize_model_to_CoT(out, 'event')
    from FreeTAKServer.controllers.SpecificCoTControllers.SendDropPointController import SendDropPointController
    rawcot = RawCoT()
    rawcot.xmlString = xml
    rawcot.clientInformation = None
    object = SendDropPointController(rawcot)
    print(
        etree.tostring(object.sendDropPoint.xmlString,
                       pretty_print=True).decode())
    '''EventObject = json
Beispiel #3
0
 def returnReceivedData(self, clientInformation, data, queue):
     try:
         from FreeTAKServer.model.RawCoT import RawCoT
         # print(data)
         RawCoT = RawCoT()
         RawCoT.clientInformation = clientInformation
         RawCoT.xmlString = data
         self.dataPipe.append(RawCoT)
         return 1
     except Exception as e:
         logger.error(loggingConstants.
                      CLIENTRECEPTIONHANDLERRETURNRECEIVEDDATAERROR +
                      str(e))
         return -1
Beispiel #4
0
def SendGeoChat():
    try:
        json = request.json
        modelObject = Event.GeoChat()
        out = ApplyFullJsonController().serializeJsonToModel(modelObject, json)
        xml = XMLCoTController().serialize_model_to_CoT(out, 'event')
        from FreeTAKServer.controllers.SpecificCoTControllers.SendGeoChatController import SendGeoChatController
        rawcot = RawCoT()
        rawcot.xmlString = xml
        rawcot.clientInformation = None
        object = SendGeoChatController(rawcot)
        APIPipe.send(object.getObject())
        return '200', 200
    except Exception as e:
        print(e)
Beispiel #5
0
                return 1
            else:
                raise TypeError(
                    'this function should only be supplied a list object')
        except Exception as e:
            return -1


if __name__ == "__main__":
    import multiprocessing
    from FreeTAKServer.controllers import SendOtherController
    from FreeTAKServer.model.RawCoT import RawCoT
    import time
    temp = RawCoT()
    temp.type = None
    temp.clientInformation = None
    temp.protocol = None
    temp.xmlString = b'<event version="2.0" uid="123e915c-7b9a-44ed-91e7-5165e384b213" type="a-h-G" time="2020-09-02T00:15:50.504Z" start="2020-09-02T00:15:50.504Z" stale="2020-09-02T00:20:50.504Z" how="h-g-i-g-o"><point lat="28.31507" lon="-81.34564" hae="-5.185734847652469" ce="6.0" le="9999999.0"/><detail><contact callsign="2340 Cordova Ct, Kissimmee, FL 34743, USA"/><status readiness="true"/><archive/><link uid="ANDROID-863134036519299" production_time="2020-07-19T18:32:31.535Z" type="a-f-G-E-V-C" parent_callsign="WP4JMV" relation="p-p"/><remarks/><archive/><ce_human_input>true</ce_human_input><color argb="-1"/><_flow-tags_ TAK-Server-c0a2d13e="2020-09-01T12:32:01Z"/></detail></event>'
    a, b = multiprocessing.Pipe()
    #multiprocessing.Process(target=).start()
    FtsObject = SendOtherController(temp).getObject()
    #b.send(FtsObject)
    FederationClientServiceController(a, '192.168.2.105', 9000).start()
    time.sleep(1000)
    x = 1
    '''
    event {
  sendTime: 1598963344000
  startTime: 1599005949000
  staleTime: 1599006324000
  lat: 43.855695