Geofence
Note
The Streaming API encoded message must be first decoded using CloudEvents proto file before decoding using the event specific proto file below
Endpoint
Connect to the following WebSocket endpoint to receive Geofence events:
wss://<host>/network-services/v1alpha1/geofence
Ensure that you replace host value with your Central Base URL. Please check out our Getting Started guide for more information.
Proto File
Event messages published by Central are encoded using Google Protocol Buffers and sent over the WebSocket connection in serialized form.
To deserialize these messages, users must use the following .proto file, which defines the schema used by Central when encoding the Geofence event payloads.
syntax = "proto3";
package network_services.geofence.v1alpha1;
message StreamGeofenceMessage {
oneof geofence_event {
WifiClientGeofence wifi_client_geofence = 1; // event-type: com.hpe.greenlake.network-services.v1alpha1.wifi-client-geofence-crossed
AssetTagGeofence asset_tag_geofence = 2; // event-type: com.hpe.greenlake.network-services.v1alpha1.asset-tag-geofence-crossed
}
}
message WifiClientGeofence {
enum EventType {
EVENT_TYPE_UNSPECIFIED = 0;
EVENT_TYPE_ENTER = 1;
EVENT_TYPE_EXIT = 2;
}
optional string zone_id = 1; // Geofence Zone Identifier
optional EventType event_type = 2;
optional string sta_eth_mac = 3; // Wi-Fi Client's MAC Address
optional string assoc_bssid = 4; // Associated BSSID of the Wi-Fi Client
optional string hashed_sta_eth_mac = 5; // Hashed MAC Address for privacy
optional uint32 dwell_time_in_seconds = 6; // Time spent in the zone before event triggered
}
message AssetTagGeofence {
enum EventType {
EVENT_TYPE_UNSPECIFIED = 0;
EVENT_TYPE_ENTER = 1;
EVENT_TYPE_EXIT = 2;
}
optional string zone_id = 1; // Geofence Zone Identifier
optional EventType event_type = 2;
optional string device_id = 3; // Asset Tag's Device Identifier
optional uint32 dwell_time_in_seconds = 4; // Time spent in the zone before event triggered
}
Supported Event Types
Geofence supports 2 event type. This value can be used when filtering events at subscription time.
| Title | Event Types |
|---|---|
| Wifi Client Geofence Crossed | com.hpe.greenlake.network-services.v1alpha1.wifi-client-geofence-crossed |
| Asset Tag Geofence Crosssed | com.hpe.greenlake.network-services.v1alpha1.asset-tag-geofence-crossed |
Updated 5 days ago