fix: SubscribeEvents params

This commit is contained in:
Liam Chan 2024-08-22 09:38:05 +08:00
parent 91cb8d7575
commit 23218acc18
2 changed files with 2 additions and 3 deletions

View File

@ -79,7 +79,7 @@ func deleteConnection(c *gin.Context) {
func eventsSubscribe(c *gin.Context) {
xaddr := c.Param("xaddr")
result, err := connections[xaddr].SubscribeEvents("http://172.16.19.230:8080/events/callback")
result, err := connections[xaddr].SubscribeEvents("http://172.16.19.230:8080/events/callback", "PT60S")
if err != nil {
c.JSON(http.StatusServiceUnavailable, gin.H{
"message": err.Error(),

View File

@ -86,9 +86,8 @@ func (c *Connection) GetDeviceInformation() (*device.GetDeviceInformationRespons
func (c *Connection) SubscribeEvents(
consumerAddress event.AttributedURIType,
terminationTime xsd.String,
terminationTime xsd.String, // PT60S
) (*event.SubscribeResponse, error) {
//terminationTime := xsd.String("PT60S")
resp, err := c.Device.CallMethod(event.Subscribe{
ConsumerReference: &event.EndpointReferenceType{
Address: consumerAddress,