Skip to content

Commit

Permalink
Merge pull request #7269 from TheThingsNetwork/feature/downlink-event…
Browse files Browse the repository at this point in the history
…s-in-as

Add new event types to application server
  • Loading branch information
vlasebian authored Sep 2, 2024
2 parents 9ca6723 + 404d726 commit a9e1dbc
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
45 changes: 45 additions & 0 deletions config/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -9989,6 +9989,15 @@
"file": "observability.go"
}
},
"event:as.down.data.ack.forward": {
"translations": {
"en": "forward downlink acknowledged"
},
"description": {
"package": "pkg/applicationserver",
"file": "observability.go"
}
},
"event:as.down.data.decode.fail": {
"translations": {
"en": "decode downlink data message failure"
Expand Down Expand Up @@ -10034,6 +10043,15 @@
"file": "observability.go"
}
},
"event:as.down.data.failed.forward": {
"translations": {
"en": "forward downlink failed"
},
"description": {
"package": "pkg/applicationserver",
"file": "observability.go"
}
},
"event:as.down.data.forward": {
"translations": {
"en": "forward downlink data message"
Expand All @@ -10043,6 +10061,24 @@
"file": "observability.go"
}
},
"event:as.down.data.nack.forward": {
"translations": {
"en": "forward downlink not acknowledged"
},
"description": {
"package": "pkg/applicationserver",
"file": "observability.go"
}
},
"event:as.down.data.queue.invalidated.forward": {
"translations": {
"en": "forward downlink queue invalidated"
},
"description": {
"package": "pkg/applicationserver",
"file": "observability.go"
}
},
"event:as.down.data.receive": {
"translations": {
"en": "receive downlink data message"
Expand All @@ -10052,6 +10088,15 @@
"file": "observability.go"
}
},
"event:as.down.data.sent.forward": {
"translations": {
"en": "forward downlink sent"
},
"description": {
"package": "pkg/applicationserver",
"file": "observability.go"
}
},
"event:as.end_device.batch.delete": {
"translations": {
"en": "batch delete end devices"
Expand Down
40 changes: 40 additions & 0 deletions pkg/applicationserver/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,36 @@ var (
events.WithDataType(&ttnpb.ApplicationDownlink{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkQueueInvalidated = events.Define(
"as.down.data.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.down.data.failed.forward", "forward downlink failed",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkSent = events.Define(
"as.down.data.sent.forward", "forward downlink sent",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkAck = events.Define(
"as.down.data.ack.forward", "forward downlink acknowledged",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
evtForwardDownlinkNack = events.Define(
"as.down.data.nack.forward", "forward downlink not acknowledged",
events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ),
events.WithDataType(&ttnpb.ApplicationUp{}),
events.WithPropagateToParent(),
)
)

const (
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
5 changes: 5 additions & 0 deletions pkg/webui/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2706,13 +2706,18 @@
"event:application.update": "アプリケーションを更新",
"event:as.application.subscribe": "アプリケーションに登録",
"event:as.application.unsubscribe": "アプリケーションから退出",
"event:as.down.data.ack.forward": "",
"event:as.down.data.decode.fail": "ダウンリンクデータメッセージのデコード失敗",
"event:as.down.data.decode.warning": "ダウンリンクデータメッセージのデコード警告",
"event:as.down.data.drop": "ダウンリンクデータメッセージをドロップ",
"event:as.down.data.encode.fail": "ダウンリンクデータメッセージのエンコード失敗",
"event:as.down.data.encode.warning": "ダウンリンクデータメッセージのエンコード警告",
"event:as.down.data.failed.forward": "",
"event:as.down.data.forward": "ダウンリンクデータメッセージの転送",
"event:as.down.data.nack.forward": "",
"event:as.down.data.queue.invalidated.forward": "",
"event:as.down.data.receive": "ダウンリンクデータメッセージを受信",
"event:as.down.data.sent.forward": "",
"event:as.end_device.batch.delete": "エンドデバイスをバッチ削除",
"event:as.end_device.create": "エンドデバイスの作成",
"event:as.end_device.delete": "エンドデバイスの削除",
Expand Down

0 comments on commit a9e1dbc

Please sign in to comment.