forked from thinkgos/go-iecp5
/
error.go
31 lines (25 loc) · 1.4 KB
/
error.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2020 thinkgos (thinkgo@aliyun.com). All rights reserved.
// Use of this source code is governed by a version 3 of the GNU General
// Public License, license that can be found in the LICENSE file.
package asdu
import (
"errors"
"fmt"
)
// error defined
var (
ErrTypeIdentifier = errors.New("asdu: type identification unknown")
ErrCauseZero = errors.New("asdu: cause of transmission 0 is not used")
ErrCommonAddrZero = errors.New("asdu: common address 0 is not used")
ErrParam = errors.New("asdu: system parameter out of range")
ErrInvalidTimeTag = errors.New("asdu: invalid time tag")
ErrOriginAddrFit = errors.New("asdu: originator address not allowed with cause size 1 system parameter")
ErrCommonAddrFit = errors.New("asdu: common address exceeds size system parameter")
ErrInfoObjAddrFit = errors.New("asdu: information object address exceeds size system parameter")
ErrInfoObjIndexFit = errors.New("asdu: information object index not in [1, 127]")
ErrInroGroupNumFit = errors.New("asdu: interrogation group number exceeds 16")
ErrLengthOutOfRange = fmt.Errorf("asdu: asdu filed length large than max %d", ASDUSizeMax)
ErrNotAnyObjInfo = errors.New("asdu: not any object information")
ErrTypeIDNotMatch = errors.New("asdu: type identifier doesn't match call or time tag")
ErrCmdCause = errors.New("asdu: cause of transmission for command not standard requirement")
)