2

同时,我买了两个Raspberry Pi Ultimate GPS Hat。我认为第一个 GPS 帽子可能坏了,但它们都表现出相同的行为 - 从 UART 接收的缓冲区完全充满了 0 值(512 字节)!

参见NmeaGpsModule类中的processBuffer(byte[] buffer, int count)方法。

private void processBuffer(byte[] buffer, int count) {
    for (int i = 0; i < count; i++) {
        if (mParser.getFrameStart() == buffer[i]) {
            handleFrameStart();
        } else if (mParser.getFrameEnd() == buffer[i]) {
            handleFrameEnd();
        } else if (buffer[i] != 0){
            //Insert all other characters except '0's into the buffer
            mMessageBuffer.put(buffer[i]);
        }
    }
}

我使用具有以下设置的GPS示例:

public static final int UART_BAUD = 9600;
public static final float ACCURACY = 2.5f; // From GPS datasheet

有任何想法吗?怎么了?

4

1 回答 1

0

尝试关注这篇文章:Raspberry Pi 3 Android Things 上的 UART 外围设备

控制台充斥着垃圾。需要禁用输出来清理它。

于 2017-01-30T22:08:13.640 回答