tr069 事件类型 (event type)

发布时间: 2023-04-26 22:40:19 作者: 大象笔记

Inform 类型的消息中,包含 Event 信息。

All communications and operations are performed in the scope of the provisioning session. The session is always started by the device (CPE) and begins with the transmission of an Inform message.

触发 provisioning session 的事件列表:

Event List

teamsacs 中 events 的定义

在代码文件 common/cwmp/Message.go:

const (
	// EventBootStrap first connection
	EventBootStrap string = "0 BOOTSTRAP"
	// EventBoot reset or power on
	EventBoot string = "1 BOOT"
	// EventPeriodic periodic inform
	EventPeriodic string = "2 PERIODIC"
	// EventScheduled scheduled infrorm
	EventScheduled string = "3 SCHEDULED"
	// EventValueChange value change event
	EventValueChange string = "4 VALUE CHANGE"
	// EventKicked acs notify cpe
	EventKicked string = "5 KICKED"
	// EventConnectionRequest cpe request connection
	EventConnectionRequest string = "6 CONNECTION REQUEST"
	// EventTransferComplete download complete
	EventTransferComplete string = "7 TRANSFER COMPLETE"
	// EventClientChange custom event client online/offline
	EventClientChange string = "8 CLIENT CHANGE"
)

TeamsACS 中对于 Inform 消息中 Event 类型的判断

位于 tr069/handlers.go 的

func (s *Tr069Server) processInformEvent(c echo.Context, lastInform *cwmp.Inform)

函数中:

打印 lastInform.Events 即可,注意这是个数组。不太好理解,为何会包含多种 Event 类型 ❓

TeamsACS 中有个很好的解释:BOOTSTARP可能和其他事件代码一起组成是事件代码组,例如,在出厂后CPE初始启动时,CPE 发送 BOOTSTARP 和 BOOT 事件代码。

参考

我是一名山东烟台的开发者,联系作者