gps_hardware_tx_rx.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:RaspberryPi-projects 作者: gary-dalton 项目源码 文件源码
def connect_serial_gps():
    """
    Check if the device is available. If its not, disconnect any currently running gpsd using killall.
    Check availability again. If still not available, raise an error. When device is available, connect
    to the L80GPS object.
    If device does not become available after killall on gpsd, another process such as kismet_server may be
    forcing it to remain connected.
    :return: L80GPS object
    """
    device = get_device_gps()
    if not device_available(device):
        cmd = 'sudo killall gpsd'
        os.system(cmd)
        #rpi_utils.run_program(cmd)
        time.sleep(1)
        if not device_available(device):
            raise serial.SerialException('Device busy ' + device + '. Check your processes.')
    gps = l80gps.L80GPS()
    return gps
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号