Documentation
¶
Index ¶
- func ABCD(rx typex.RuleX) func(*lua.LState) int
- func ActionReplyFailed(rx typex.RuleX) func(*lua.LState) int
- func ActionReplySuccess(rx typex.RuleX) func(*lua.LState) int
- func AsByteSlice(b string) []byte
- func AsHexSlice(b string) []string
- func B64S2B(rx typex.RuleX) func(*lua.LState) int
- func BADC(rx typex.RuleX) func(*lua.LState) int
- func Bin2Str(rx typex.RuleX) func(l *lua.LState) int
- func BinToFloat32(rx typex.RuleX) func(*lua.LState) int
- func BinToFloat64(rx typex.RuleX) func(*lua.LState) int
- func BitStringToBytes(rx typex.RuleX) func(*lua.LState) int
- func ByteToBitString(rx typex.RuleX) func(*lua.LState) int
- func ByteToInt(b []byte, order binary.ByteOrder) uint64
- func ByteToInt64(rx typex.RuleX) func(*lua.LState) int
- func Bytes2Hexs(rx typex.RuleX) func(*lua.LState) int
- func CDAB(rx typex.RuleX) func(*lua.LState) int
- func CRC16(rx typex.RuleX) func(*lua.LState) int
- func CtrlDevice(rx typex.RuleX) func(*lua.LState) int
- func DCACall(rx typex.RuleX) func(*lua.LState) int
- func DCBA(rx typex.RuleX) func(*lua.LState) int
- func DataToHttp(rx typex.RuleX) func(*lua.LState) int
- func DataToMongo(rx typex.RuleX) func(*lua.LState) int
- func DataToMqtt(rx typex.RuleX) func(*lua.LState) int
- func DataToMqttTopic(rx typex.RuleX) func(*lua.LState) int
- func DataToTarget(rx typex.RuleX) func(*lua.LState) int
- func DataToTdEngine(rx typex.RuleX) func(*lua.LState) int
- func DataToUdp(rx typex.RuleX) func(*lua.LState) int
- func DataToUiComponent(rx typex.RuleX) func(l *lua.LState) int
- func Debug(rx typex.RuleX, uuid string) func(*lua.LState) int
- func DebugAPP(rx typex.RuleX, uuid string) func(*lua.LState) int
- func DecodeValue(L *lua.LState, value interface{}) lua.LValue
- func EEKIT_GPIOGet(rx typex.RuleX) func(*lua.LState) int
- func EEKIT_GPIOSet(rx typex.RuleX) func(*lua.LState) int
- func Endian(endian byte) binary.ByteOrder
- func F1(rx typex.RuleX) func(l *lua.LState) int
- func F2(rx typex.RuleX) func(l *lua.LState) int
- func F3(rx typex.RuleX) func(l *lua.LState) int
- func F4(rx typex.RuleX) func(l *lua.LState) int
- func FailedCmd(rx typex.RuleX) func(*lua.LState) int
- func FinishCmd(rx typex.RuleX) func(*lua.LState) int
- func GetABitOnByte(rx typex.RuleX) func(*lua.LState) int
- func H3DO1Set(rx typex.RuleX) func(*lua.LState) int
- func H3DO2Set(rx typex.RuleX) func(*lua.LState) int
- func HToN(rx typex.RuleX) func(*lua.LState) int
- func HexToNumber(s string) (int64, error)
- func Hexs2Bytes(rx typex.RuleX) func(*lua.LState) int
- func HsubToN(rx typex.RuleX) func(*lua.LState) int
- func Infer(rx typex.RuleX) func(*lua.LState) int
- func JQ(jqExpression string, inputData interface{}) ([]interface{}, error)
- func JSOND(rx typex.RuleX) func(l *lua.LState) int
- func JSONE(rx typex.RuleX) func(l *lua.LState) int
- func JqSelect(rx typex.RuleX) func(*lua.LState) int
- func MatchBinary(rx typex.RuleX) func(*lua.LState) int
- func MatchBinaryHex(rx typex.RuleX) func(*lua.LState) int
- func MatchHex(rx typex.RuleX) func(*lua.LState) int
- func MatchUInt(rx typex.RuleX) func(*lua.LState) int
- func NewJsonDecodeLib() typex.XLib
- func NewJsonEncodeLib() typex.XLib
- func NtpTime(rx typex.RuleX) func(l *lua.LState) int
- func Output(rx typex.RuleX) func(l *lua.LState) int
- func ParseGPS(rx typex.RuleX) func(*lua.LState) int
- func PlayMusic(rx typex.RuleX) func(l *lua.LState) int
- func PropertyReplyFailed(rx typex.RuleX) func(l *lua.LState) int
- func PropertyReplySuccess(rx typex.RuleX) func(l *lua.LState) int
- func RASPI4_GPIOGet(rx typex.RuleX) func(*lua.LState) int
- func RASPI4_GPIOSet(rx typex.RuleX) func(*lua.LState) int
- func RPCDecode(rx typex.RuleX) func(*lua.LState) int
- func RPCEncode(rx typex.RuleX) func(*lua.LState) int
- func ReadDevice(rx typex.RuleX) func(*lua.LState) int
- func ReadSource(rx typex.RuleX) func(*lua.LState) int
- func ReverseBits(b byte) byte
- func ReverseByteOrder(b []byte) []byte
- func ReverseString(text string) string
- func SelfRuleUUID(rx typex.RuleX, uuid string) func(*lua.LState) int
- func SetModelValue(rx typex.RuleX) func(*lua.LState) int
- func Sleep(rx typex.RuleX) func(l *lua.LState) int
- func StoreDelete(rx typex.RuleX) func(l *lua.LState) int
- func StoreGet(rx typex.RuleX) func(l *lua.LState) int
- func StoreSet(rx typex.RuleX) func(l *lua.LState) int
- func SubStr(data string, start, end int) (string, error)
- func T2Str(rx typex.RuleX) func(l *lua.LState) int
- func Throw(rx typex.RuleX) func(l *lua.LState) int
- func Time(rx typex.RuleX) func(l *lua.LState) int
- func TimeMs(rx typex.RuleX) func(l *lua.LState) int
- func TruncateFloat(rx typex.RuleX) func(*lua.LState) int
- func TsUnix(rx typex.RuleX) func(l *lua.LState) int
- func TsUnixNano(rx typex.RuleX) func(l *lua.LState) int
- func UrlBuild(rx typex.RuleX) func(*lua.LState) int
- func UrlBuildQS(rx typex.RuleX) func(*lua.LState) int
- func UrlParse(rx typex.RuleX) func(*lua.LState) int
- func UrlResolve(rx typex.RuleX) func(*lua.LState) int
- func VerifyJqExpression(jqExpression string) (*gojq.Query, error)
- func WKYWS1608_GPIOGet(rx typex.RuleX) func(*lua.LState) int
- func WKYWS1608_GPIOSet(rx typex.RuleX) func(*lua.LState) int
- func WriteDevice(rx typex.RuleX) func(*lua.LState) int
- func WriteSource(rx typex.RuleX) func(l *lua.LState) int
- func XOR(rx typex.RuleX) func(*lua.LState) int
- type Fun
- type FunArg
- type HexSegment
- type JsonDecodeLib
- type JsonEncodeLib
- type Kl
- type ModbusW
- type ReturnValue
- type RulexLibDoc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionReplyFailed ¶
* 设备行为调用失败 * { * "method": "action_reply", * "id": "20a4ccfd", * "code": 0, * "status": "message", * "out": {属性} * } *
func ActionReplySuccess ¶
* 设备行为调用成功 * { * "method": "action_reply", * "id": "20a4ccfd", * "code": 0, * "status": "message", * "out": {属性} * } *
func CtrlDevice ¶
* * 控制操作[2023年4月16日新增, 需求来自总线控制多个不对等设备] *
func DataToHttp ¶
* * 数据转发到HTTP:local err: = rulexlib:DataToHttp(uuid, data) *
func DataToTarget ¶
* 注意:该接口是通用的,如果觉得这个不清晰,可以尝试具体的'DataToXXX' * 数据转发到具体的目的地:local err: = rulexlib:DataToTarget(uuid, data) *
func DataToUiComponent ¶ added in v0.6.3
func DecodeValue ¶
DecodeValue converts the value to a Lua value.
This function only converts values that the encoding/json package decodes to. All other values will return lua.LNil.
func EEKIT_GPIOGet ¶
* * 读GPIO, lua的函数调用应该是这样: eekith3:GPIOGet(pin) -> v,error *
func EEKIT_GPIOSet ¶
* * 写GPIO, lua的函数调用应该是这样: eekith3:GPIOSet(pin, v) -> error *
func F1 ¶
--------------------------------------------
|Function | Register Type
--------------------------------------------
| 1 | Read Coil | 2 | Read Discrete Input | 3 | Read Holding Registers | 4 | Read Input Registers | 5 | Write Single Coil | 6 | Write Single Holding Register | 15 | Write Multiple Coils | 16 | Write Multiple Holding Registers
--------------------------------------------
* * Modbus Function1 *
func JQ ¶
JQ * * In either case, you cannot use custom type values as the query input. * The type should be []interface{} for an array and map[string]interface{} for a map (just like decoded to an interface{} using the encoding/json package). * You can't use []int or map[string]string, for example. * If you want to query your custom struct, marshal to JSON, unmarshal to interface{} and use it as the query input.
func MatchBinary ¶
* * 二进制匹匹配, [<|> K1:LEN1 K2:LEN2... ]返回一个K-V table * 其中K是字符串, V是二进制字符串 *
func MatchHex ¶
*--------------------------------------------------------------------------- * 十六进制字符串匹配: MatchHex("FFFFFF014CB2AA55", "age:[1,232];sex:[4,5]") *---------------------------------------------------------------------------
func MatchUInt ¶ added in v0.5.1
* * 匹配十六进制转成整数 * MatchHex("FFFFFF014CB2AA55", "age:[1,1];sex:[4,5]") *
func NewJsonDecodeLib ¶
func NewJsonEncodeLib ¶
func Output ¶ added in v0.6.3
* * 对外输出数据,这个函数的数据会被推到 yqueue 里面,然后yqueue会再次把数据推到其实现的各种pipe里, * 可能是个 websocket,也可能是个 TCP 或者 UDP Server。 *
func PropertyReplyFailed ¶
* * 属性下发到设备,回复失败 *
func PropertyReplySuccess ¶
* * 属性下发到设备,回复成功 *
func RASPI4_GPIOGet ¶
* * 读GPIO, lua的函数调用应该是这样: eekith3:GPIOGet(pin) -> v,error *
func RASPI4_GPIOSet ¶
* * 写GPIO, lua的函数调用应该是这样: eekith3:GPIOSet(pin, v) -> error *
func ReverseString ¶
* * 逆转字符串 *
Reverse reverses the input while respecting UTF8 encoding and combined characters
func SelfRuleUUID ¶
* * 获取当前的规则UUID *
func TruncateFloat ¶ added in v0.6.3
* * 取小数位 applib:Float(number, decimalPlaces) -> float *
func WKYWS1608_GPIOGet ¶ added in v0.5.2
* * 读GPIO, lua的函数调用应该是这样: ws1608:GPIOGet(pin) -> v,error *
func WKYWS1608_GPIOSet ¶ added in v0.5.2
* * 写GPIO, lua的函数调用应该是这样: ws1608:GPIOSet(pin, v) -> error *
Types ¶
type Fun ¶
type Fun struct { NameSpace string // 函数名 FunName string // 函数名 FunArgs []FunArg // 函数参数 ReturnValue []ReturnValue // 函数返回值 Description string // 描述文本 Example string // 示例 }
func (*Fun) BuildSection ¶
type HexSegment ¶
func (HexSegment) ToHexString ¶
func (sgm HexSegment) ToHexString() string
func (HexSegment) ToUInt64 ¶ added in v0.5.1
func (sgm HexSegment) ToUInt64() uint64
func (HexSegment) ToUint16 ¶ added in v0.5.1
func (sgm HexSegment) ToUint16() uint16
func (HexSegment) ToUint32 ¶ added in v0.5.1
func (sgm HexSegment) ToUint32() uint32
type JsonDecodeLib ¶
type JsonDecodeLib struct { }
* * JsonDecodeLib, _Decode converts the JSON encoded data to Lua values. *
func (*JsonDecodeLib) Name ¶
func (l *JsonDecodeLib) Name() string
type JsonEncodeLib ¶
type JsonEncodeLib struct { }
* * JsonEncodeLib,_Encode converts Lua values to JSON. *
func (*JsonEncodeLib) Name ¶
func (l *JsonEncodeLib) Name() string
type Kl ¶
func (Kl) ToHexString ¶
type ModbusW ¶
type ModbusW struct { SlaverId byte // 从机ID Function int // 功能码 Address uint16 // 地址 Quantity uint16 // 读写数量 Value []byte // 值 }
* * 这里规定一些LUA和golang的类型映射 * local t = { * ["type"] = 5, * ["params"] = { * ["address"] = 1, * ["quantity"] = 1, * ["value"] = 0xFF00 * } * } *
type ReturnValue ¶
type RulexLibDoc ¶
func (*RulexLibDoc) AddFunc ¶
func (doc *RulexLibDoc) AddFunc(f Fun)
func (*RulexLibDoc) BuildDoc ¶
func (doc *RulexLibDoc) BuildDoc()
Source Files
¶
- aibase_lib.go
- amlogic_s805_ws1608_lib.go
- base_math_lib.go
- binary_lib.go
- byte_order_lib.go
- cmd_state_lib.go
- codec_lib.go
- common.go
- data_model_lib.go
- data_to_http_lib.go
- data_to_mongo_lib.go
- data_to_mqtt_lib.go
- data_to_target_lib.go
- data_to_tdengine_lib.go
- data_to_udp_lib.go
- dca_lib.go
- device_lib.go
- docbuilder.go
- eekith3_adda_lib.go
- errors_lib.go
- gps_parse_lib.go
- hex_lib.go
- iothub_lib.go
- jq_lib.go
- log_lib.go
- lua_runtime_lib.go
- luajson.go
- misc_lib.go
- modbus_lib.go
- queue_lib.go
- raspberry4b_adda_lib.go
- rhinoh3_audio_lib.go
- schame_data_to_component_lib.go
- size_t.go
- source_lib.go
- storelib.go
- string_lib.go
- time_lib.go
- urllib.go