Skip to content

Sensor Events

Info

This document is a work in progress.

Currently, Sensor events contain below events, still working in progress:

  • Sensor Events
    • GpsProbe Event - HMI/Application should send gps data at specified frequency with the "GPS_PROBE" event all the time after engine start.
    • Gravity Event -
    • Gyroscope Event -
    • Accelerometer Event -
    • Linear Acceleration Event -

GpsProbe Event

HMI/Application should send gps data at 5 Hz with the "GPS_PROBE" event all the time after engine start.

TNGpsProbeEventBuilder Methods Details
items(_ items: [TNProbeListItem]) List of ProbeListItem below at periodic intervals.

ProbeListItem

TNProbeListItemBuilder Methods Details
lat(_ lat: CLLocationDegrees) Set to raw latitude, mandatory data field.
lon(_ lon: CLLocationDegrees) Set to raw longitude, mandatory data field.
altitude(_ altitude: Double) Set altitude, measured in meters, optional data field.
speed(_ speed: Double) Set the instantaneous speed of the device in meters per second, optional data field.
horizontalAccuracy(_ horizontalAccuracy: Double) Set the radius of uncertainty for the location, measured in meters, optional data field.
verticalAccuracy(_ verticalAccuracy: Double) Set the accuracy of the altitude value in meters, optional data field.
direction(_ direction: TNHeadingDirectionType) The direction in which the device is traveling must be enum Heading, optional data field.
locationTime(_ locationTime: Date) The time at which location was determined, mandatory data field.
headingAngle(_ headingAngle: Double) The direction in which the device is traveling with respect no north, degree value(0-360), optional data field.
enum TNHeadingDirectionType Details
N north
NE northeast
E east
SE southeast
S south
SW southwest
W west
NW northwest
1
2
3
4
5
6
7
8
if let item = TNProbeListItem.builder().lat(55).lon(73)
    .locationTime(Date())
    .altitude(20000.3).verticalAccuracy(6)
    .speed(200).horizontalAccuracy(5)
    .direction(.SW).headingAngle(259).build(),
    let event = TNGpsProbeEvent.builder().items([item]).build()
     dataCollectorClient.send(event: event)
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
TNProbeListItemBuilder * itemBuilder = [TNProbeListItem builder];
[[[itemBuilder lat:55] lon:73] locationTime: [NSDate new]];
[[itemBuilder altitude:2000] verticalAccuracy:2];
[[itemBuilder speed:200] horizontalAccuracy:6];
[[itemBuilder headingAngle:259] direction:TNHeadingDirectionTypeNW];
TNProbeListItem * item = [itemBuilder build];
if (item != NULL) {
    TNGpsProbeEvent * event = [[[TNGpsProbeEvent builder] addItem: item] build];
    if (event != NULL) {
        [dataCollectorClient sendWithEvent:event];
    }
}