Skip to content

Commit

Permalink
as: Add new event types
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Vitan committed Aug 29, 2024
1 parent 9ca6723 commit 99201a4
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions pkg/applicationserver/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,36 @@ var (
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkQueueInvalidated = events.Define(
"as.up.downlink.queue.invalidated.forward", "forward downlink queue invalidated",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkFailed = events.Define(
"as.up.downlink.failed.forward", "forward downlink failed",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkSent = events.Define(
"as.up.downlink.sent.forward", "forward downlink sent",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkAck = events.Define(
"as.up.downlink.ack.forward", "forward downlink acknowledged",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkNack = events.Define(
"as.up.downlink.nack.forward", "forward downlink not acknowledged",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtReceiveDataDown = events.Define(
"as.down.data.receive", "receive downlink data message",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
Expand Down Expand Up @@ -283,6 +313,16 @@ func registerForwardUp(ctx context.Context, msg *ttnpb.ApplicationUp) {
events.Publish(evtForwardLocationSolved.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg))
case *ttnpb.ApplicationUp_ServiceData:
events.Publish(evtForwardServiceData.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg))
case *ttnpb.ApplicationUp_DownlinkQueueInvalidated:
events.Publish(evtForwardDownlinkQueueInvalidated.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg))
case *ttnpb.ApplicationUp_DownlinkFailed:
events.Publish(evtForwardDownlinkFailed.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg))
case *ttnpb.ApplicationUp_DownlinkSent:
events.Publish(evtForwardDownlinkSent.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg))
case *ttnpb.ApplicationUp_DownlinkAck:
events.Publish(evtForwardDownlinkAck.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg))
case *ttnpb.ApplicationUp_DownlinkNack:
events.Publish(evtForwardDownlinkNack.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg))
default:
return
}
Expand Down

0 comments on commit 99201a4

Please sign in to comment.