SignalK / signalk-server-java

DEPRECATED - see https://github.com/SignalK/signalk-java
Apache License 2.0
6 stars 9 forks source link

surfaceToTransducer unicode string? #39

Closed ph1l closed 7 years ago

ph1l commented 7 years ago

According to the spec (https://github.com/SignalK/specification/blob/master/schemas/groups/environment.json#L158) this should be a numeric value not a string

elektron@x61s:~/code/python-signalk-client$ curl -s http://raspberrypi:8080/signalk/v1/api/vessels/urn:mrn:signalk:uuid:48fa5c95-7316-4ad9-bdf1-f99c9124ac46/environment/depth/ | jq .
{
  "surfaceToTransducer": "0.13935455554065423",
  "meta": {
    "warnMethod": "visual",
    "displayUnit": "ft",
    "alarmMethod": "visual",
    "zones": [
      {
        "lower": 0,
        "upper": 0.4571999853696005,
        "state": "alarm",
        "message": "Danger"
      },
      {
        "lower": 0.4571999853696005,
        "upper": 0.5029199839065605,
        "state": "warn",
        "message": "Shallow Water"
      },
      {
        "lower": 0.5029199839065605,
        "upper": 3047.695102473757,
        "state": "normal",
        "message": ""
      }
    ]
  },
  "belowTransducer": {
    "values": {
      "/dev/ttyACM0": {
        "NMEA0183": {
          "DBT": {
            "value": 3,
            "$source": "/dev/ttyACM0.NMEA0183.DBT",
            "timestamp": "2017-03-20T08:57:29.848Z"
          },
          "DPT": {
            "value": 3,
            "$source": "/dev/ttyACM0.NMEA0183.DPT",
            "timestamp": "2017-03-20T08:57:29.770Z"
          }
        }
      }
    },
    "value": 3,
    "$source": "/dev/ttyACM0.NMEA0183.DBT",
    "timestamp": "2017-03-20T08:57:29.848Z"
  }
}
rob42 commented 7 years ago

Is this a bug in the signalk-java-server or the python server?

ph1l commented 7 years ago

According to the spec, environment.depth.surfaceToTransducer should be a numeric value not a string.

I believe this is a bug in signalk-java-server

rob42 commented 7 years ago

Yes it should be a numeric. I saw the ref to the python server above and wasnt sure it was a java-server bug.

rob42 commented 7 years ago

Fixed now

  "surfaceToTransducer": {
      "values": {
        "urn:mrn:signalk:uuid:705f5f1a-efaf-44aa-9cb8-a0fd6305567c": {
          "value": 0.4572,
          "$source": "self",
          "timestamp": "2017-03-20T04:01:23.936Z"
        }
      },
      "value": 0.4572,
      "$source": "self",
      "timestamp": "2017-03-20T04:01:23.936Z"
    },