context.go 570 B

1234567891011121314151617181920212223242526
  1. package protocol
  2. type PacketContext struct {
  3. ReceiveAddress []byte
  4. DeviceId string
  5. }
  6. // SetReceiveAddress 设置接收表地址
  7. func (a *PacketContext) SetReceiveAddress(address []byte) {
  8. a.ReceiveAddress = address
  9. }
  10. // GetReceiveAddress 获取接收表地址
  11. func (a *PacketContext) GetReceiveAddress() []byte {
  12. return a.ReceiveAddress
  13. }
  14. // SetDeviceId 设置接收表地址
  15. func (a *PacketContext) SetDeviceId(deviceID string) {
  16. a.DeviceId = deviceID
  17. }
  18. // GetDeviceId 获取表地址
  19. func (a *PacketContext) GetDeviceId() string {
  20. return a.DeviceId
  21. }