(gps_data, pcap_data, plugin_version)
return dummy.getvalue()
Transform to wigle entry in file
Transform to wigle entry in file
Transform to wigle entry in file
def _transform_wigle_entry(gps_data, pcap_data, plugin_version):
    """
    Transform to wigle entry in file
    """
    dummy = StringIO()
    # write kismet header
    dummy.write(
        "WigleWifi-1.4,appRelease={},model=pwnagotchi,release={},device=pwnagotchi,display=kismet,board=kismet,brand=pwnagotchi\n".format(plugin_version, __pwnagotchi_version__))
    dummy.write(
        "MAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type")

    writer = csv.writer(dummy, delimiter=",", quoting=csv.QUOTE_NONE, escapechar="\\")
    writer.writerow([
        pcap_data[WifiInfo.BSSID],
        pcap_data[WifiInfo.ESSID],
        _format_auth(pcap_data[WifiInfo.ENCRYPTION]),
        datetime.strptime(gps_data['Updated'].rsplit('.')[0],
                          "%Y-%m-%dT%H:%M:%S").strftime('%Y-%m-%d %H:%M:%S'),
        pcap_data[WifiInfo.CHANNEL],
        pcap_data[WifiInfo.RSSI],
        gps_data['Latitude'],
        gps_data['Longitude'],
        gps_data['Altitude'],
        0,  # accuracy?
        'WIFI'])
    return dummy.getvalue()
def _transform_wigle_entry ( gps_data , pcap_data , plugin_version ) : dummy = StringIO ( ) # write kismet header dummy . write ( "WigleWifi-1.4,appRelease={},model=pwnagotchi,release={},device=pwnagotchi,display=kismet,board=kismet,brand=pwnagotchi\n" . format ( plugin_version , __pwnagotchi_version__ ) ) dummy . write ( "MAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type" ) writer = csv . writer ( dummy , delimiter = "," , quoting = csv . QUOTE_NONE , escapechar = "\\" ) writer . writerow ( [ pcap_data [ WifiInfo . BSSID ] , pcap_data [ WifiInfo . ESSID ] , _format_auth ( pcap_data [ WifiInfo . ENCRYPTION ] ) , datetime . strptime ( gps_data [ 'Updated' ] . rsplit ( '.' ) [ 0 ] , "%Y-%m-%dT%H:%M:%S" ) . strftime ( '%Y-%m-%d %H:%M:%S' ) , pcap_data [ WifiInfo . CHANNEL ] , pcap_data [ WifiInfo . RSSI ] , gps_data [ 'Latitude' ] , gps_data [ 'Longitude' ] , gps_data [ 'Altitude' ] , 0 , # accuracy? 'WIFI' ] ) return dummy . getvalue ( )