github.com/jingruilea/kubeedge@v1.2.0-beta.0.0.20200410162146-4bb8902b3879/cloud/test/integration/fixtures/constants.go (about) 1 /* 2 Copyright 2019 The KubeEdge Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package fixtures 18 19 // CRD API Constants 20 const ( 21 apiVersion = "devices.kubeedge.io/v1alpha1" 22 deviceModelKind = "DeviceModel" 23 deviceKind = "Device" 24 ) 25 26 const ( 27 ResourceDeviceModel = "devicemodels" 28 ResourceDevice = "devices" 29 ) 30 31 // Device Model Constants 32 const ( 33 devicePropertyTemperature = "temperature" 34 devicePropertyTemperatureDesc = "temperature in degree celsius" 35 devicePropertyUnit = "degree celsius" 36 ) 37 38 // Device instance constants 39 const ( 40 DefaultNamespace = "default" 41 DeviceModelRef = "sensor-tag-model" 42 ) 43 44 type deviceProtocol string 45 46 // Supported protocols constants 47 const ( 48 deviceProtocolBluetooth deviceProtocol = "bluetooth" 49 deviceProtocolModbus deviceProtocol = "modbus" 50 deviceProtocolModbusRTU deviceProtocol = "modbusRTU" 51 deviceProtocolModbusTCP deviceProtocol = "modbusTCP" 52 deviceProtocolOPCUA deviceProtocol = "opcua" 53 ) 54 55 // integer property type constants 56 const ( 57 minimum = 0 58 maximum = 100 59 ) 60 61 // Bluetooth Protocol Constants 62 const ( 63 characteristicUUID = "f000aa0104514000b000000000000000" 64 startIndex = 1 65 endIndex = 2 66 operationValue = 0.03125 67 offset = 2 68 limit = 1 69 ) 70 71 // Modbus RTU Protocol Constants 72 const ( 73 baudRate = 110 74 dataBits = 8 75 stopBits = 1 76 serialPort = "1" 77 parity = "none" 78 slaveID = 100 79 )