diff --git a/application/src/main/data/lwm2m-registry/0.xml b/application/src/main/data/lwm2m-registry/0.xml new file mode 100644 index 0000000000..60744d35c7 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/0.xml @@ -0,0 +1,405 @@ + + + + + + + LWM2M Security + + 0 + urn:oma:lwm2m:oma:0:1.2 + 1.1 + 1.2 + Multiple + Mandatory + + + LWM2M Server URI + + Single + Mandatory + String + 0..255 + + + + + Bootstrap-Server + + Single + Mandatory + Boolean + + + + + + Security Mode + + Single + Mandatory + Integer + 0..4 + + + + + Public Key or Identity + + Single + Mandatory + Opaque + + + + + + Server Public Key + + Single + Mandatory + Opaque + + + + + + Secret Key + + Single + Mandatory + Opaque + + + + + + SMS Security Mode + + Single + Optional + Integer + 0..255 + + + + + SMS Binding Key Parameters + + Single + Optional + Opaque + 6 + + + + + SMS Binding Secret Key(s) + + Single + Optional + Opaque + 16,32,48 + + + + + LwM2M Server SMS Number + + Single + Optional + String + + + + + + Short Server ID + + Single + Optional + Integer + 1..65534 + + + + + Client Hold Off Time + + Single + Optional + Integer + + s + + + + Bootstrap-Server Account Timeout + + Single + Optional + Integer + + s + + + + Matching Type + + Single + Optional + Unsigned Integer + 0..3 + + + + + SNI + + Single + Optional + String + + + + + + Certificate Usage + + Single + Optional + Unsigned Integer + 0..3 + + + + + DTLS/TLS Ciphersuite + + Multiple + Optional + Unsigned Integer + + + + + OSCORE Security Mode + + Single + Optional + Objlnk + + + + + + Groups To Use by Client + + Multiple + Optional + Unsigned Integer + 0..65535 + + + + + Signature Algorithms Supported by Server + + Multiple + Optional + Unsigned Integer + 0..65535 + + + + Signature Algorithms To Use by Client + + Multiple + Optional + Unsigned Integer + 0..65535 + + + + + Signature Algorithm Certs Supported by Server + + Multiple + Optional + Unsigned Integer + 0..65535 + + + + + TLS 1.3 Features To Use by Client + + Single + Optional + Unsigned Integer + 0..65535 + + + + + TLS Extensions Supported by Server + + Single + Optional + Unsigned Integer + 0..65535 + + + + + TLS Extensions To Use by Client + + Single + Optional + Unsigned Integer + 0..65535 + + + + + Secondary LwM2M Server URI + + Multiple + Optional + String + 0..255 + + + + MQTT Server + + Single + Optional + Objlnk + + + + + LwM2M COSE Security + + Multiple + Optional + Objlnk + + + + + RDS Destination Port + + Single + Optional + Integer + 0..15 + + + + RDS Source Port + + Single + Optional + Integer + 0..15 + + + + RDS Application ID + + Single + Optional + String + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/1.xml b/application/src/main/data/lwm2m-registry/1.xml new file mode 100644 index 0000000000..ace9efcc6a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/1.xml @@ -0,0 +1,360 @@ + + + + + + + LwM2M Server + + 1 + urn:oma:lwm2m:oma:1:1.2 + 1.2 + 1.2 + Multiple + Mandatory + + + Short Server ID + R + Single + Mandatory + Integer + 1..65534 + + + + + Lifetime + RW + Single + Mandatory + Integer + + s + + + + Default Minimum Period + RW + Single + Optional + Integer + + s + + + + Default Maximum Period + RW + Single + Optional + Integer + + s + + + + Disable + E + Single + Optional + + + + + + + Disable Timeout + RW + Single + Optional + Integer + + s + + + + Notification Storing When Disabled or Offline + RW + Single + Mandatory + Boolean + + + + + + Binding + RW + Single + Mandatory + String + + + + + + Registration Update Trigger + E + Single + Mandatory + + + + + + + Bootstrap-Request Trigger + E + Single + Optional + + + + + + + APN Link + RW + Single + Optional + Objlnk + + + + + + TLS-DTLS Alert Code + R + Single + Optional + Unsigned Integer + 0..255 + + + + + Last Bootstrapped + R + Single + Optional + Time + + + + + + Registration Priority Order + R + Single + Optional + Unsigned Integer + + + + + + Initial Registration Delay Timer + RW + Single + Optional + Unsigned Integer + + s + + + + Registration Failure Block + R + Single + Optional + Boolean + + + + + + Bootstrap on Registration Failure + R + Single + Optional + Boolean + + + + + + Communication Retry Count + RW + Single + Optional + Unsigned Integer + + + + + + Communication Retry Timer + RW + Single + Optional + Unsigned Integer + + s + + + + Communication Sequence Delay Timer + RW + Single + Optional + Unsigned Integer + + s + + + + Communication Sequence Retry Count + RW + Single + Optional + Unsigned Integer + + + + + + Trigger + RW + Single + Optional + Boolean + + + + + + Preferred Transport + RW + Single + Optional + String + The possible values are those listed in the LwM2M Core Specification + + + + Mute Send + RW + Single + Optional + Boolean + + + + + + Alternate APN Links + RW + Multiple + Optional + Objlnk + + + + + + Supported Server Versions + RW + Multiple + Optional + String + + + + + + Default Notification Mode + RW + Single + Optional + Integer + 0..1 + + + + + Profile ID Hash Algorithm + RW + Single + Optional + Unsigned Integer + 0..255 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10.xml b/application/src/main/data/lwm2m-registry/10.xml new file mode 100644 index 0000000000..af87413a94 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10.xml @@ -0,0 +1,217 @@ + + + + + + LWM2M Cellular Connectivity + + 10 + urn:oma:lwm2m:oma:10:1.1 + 1.1 + 1.1 + Single + Optional + + SMSC address + RW + Single + Optional + String + + + + + Disable radio period + RW + Single + Optional + Integer + 0..65535 + + 0 the device SHALL disconnect. When the period has elapsed the device MAY reconnect.]]> + + Module activation code + RW + Single + Optional + String + + + + + Vendor specific extensions + R + Single + Optional + Objlnk + + + + + PSM Timer + RW + Single + Optional + Integer + + s + + + Active Timer + RW + Single + Optional + Integer + + s + + + eDRX parameters for Iu mode + RW + Single + Optional + Opaque + 0..255 + + + + eDRX parameters for WB-S1 mode + RW + Single + Optional + Opaque + 0..255 + + + + eDRX parameters for NB-S1 mode + RW + Single + Optional + Opaque + 0..255 + + + + eDRX parameters for A/Gb mode + RW + Single + Optional + Opaque + 0..255 + + + + Activated Profile Names + R + Multiple + Mandatory + Objlnk + + + + + + Supported Power Saving Modes + R + Single + Optional + Unsigned Integer + 0..255 + + + + + Active Power Saving Modes + RW + Single + Optional + Unsigned Integer + 0..255 + + + + + Release Assistance Indication Usage + RW + Single + Optional + Unsigned Integer + 0..255 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10241.xml b/application/src/main/data/lwm2m-registry/10241.xml new file mode 100644 index 0000000000..5a499100f3 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10241.xml @@ -0,0 +1,81 @@ + + + + + HostDeviceInfo + + 10241 + urn:oma:lwm2m:x:10241 + 1.0 + 1.0 + Multiple + Optional + + Host Device Manufacturer + R + Multiple + Mandatory + String + + + + + Host Device Model Number + R + Multiple + Mandatory + String + + + + + Host Device Unique ID + R + Multiple + Mandatory + String + + + + + Host Device Software Version + R + Multiple + Mandatory + String + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10242.xml b/application/src/main/data/lwm2m-registry/10242.xml new file mode 100644 index 0000000000..09a62806d3 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10242.xml @@ -0,0 +1,659 @@ + + + + + + + 3-Phase Power Meter + + + + 10242 + urn:oma:lwm2m:x:10242 + 1.0 + 1.0 + Multiple + Optional + + + Manufacturer + R + Single + Optional + String + + + + + + + + Model Number + R + Single + Optional + String + + + + + + + + Serial Number + R + Single + Optional + String + + + + + + + + Description + R + Single + Optional + String + + + + + + + + Tension R + R + Single + Mandatory + Float + + V + + + + + + Current R + R + Single + Mandatory + Float + + A + + + + + + Active Power R + R + Single + Optional + Float + + kW + + + + + + Reactive Power R + R + Single + Optional + Float + + kvar + + + + + + Inductive Reactive Power R + R + Single + Optional + Float + + kvar + + + + + + Capacitive Reactive Power R + R + Single + Optional + Float + + kvar + + + + + + Apparent Power R + R + Single + Optional + Float + + kVA + + + + + + Power Factor R + R + Single + Optional + Float + -1..1 + + + + + + + THD-V R + R + Single + Optional + Float + + /100 + + + + + + THD-A R + R + Single + Optional + Float + + /100 + + + + + + Tension S + R + Single + Mandatory + Float + + V + + + + + + Current S + R + Single + Mandatory + Float + + A + + + + + + Active Power S + R + Single + Optional + Float + + kW + + + + + + Reactive Power S + R + Single + Optional + Float + + kvar + + + + + + Inductive Reactive Power S + R + Single + Optional + Float + + kvar + + + + + + Capacitive Reactive Power S + R + Single + Optional + Float + + kvar + + + + + + Apparent Power S + R + Single + Optional + Float + + kVA + + + + + + Power Factor S + R + Single + Optional + Float + -1..1 + + + + + + + THD-V S + R + Single + Optional + Float + + /100 + + + + + + THD-A S + R + Single + Optional + Float + + /100 + + + + + + Tension T + R + Single + Mandatory + Float + + V + + + + + + Current T + R + Single + Mandatory + Float + + A + + + + + + Active Power T + R + Single + Optional + Float + + kW + + + + + + Reactive Power T + R + Single + Optional + Float + + kvar + + + + + + Inductive Reactive Power T + R + Single + Optional + Float + + kvar + + + + + + Capacitive Reactive Power T + R + Single + Optional + Float + + kvar + + + + + + Apparent Power T + R + Single + Optional + Float + + kVA + + + + + + Power Factor T + R + Single + Optional + Float + -1..1 + + + + + + + THD-V T + R + Single + Optional + Float + + /100 + + + + + + THD-A T + R + Single + Optional + Float + + /100 + + + + + + 3-Phase Active Power + R + Single + Optional + Float + + kW + + + + + + 3-Phase Reactive Power + R + Single + Optional + Float + + kvar + + + + + + 3-Phase Inductive Reactive Power + R + Single + Optional + Float + + kvar + + + + + + 3-Phase Capacitive Reactive Power + R + Single + Optional + Float + + kvar + + + + + + 3-Phase Apparent Power + R + Single + Optional + Float + + kVA + + + + + + 3-Phase Power Factor + R + Single + Optional + Float + -1..1 + + + + + + + 3-Phase phi cosine + R + Single + Optional + Float + -1..1 + + + + + + + Active Energy + R + Single + Optional + Float + + kWh + + + + + + Reactive Energy + R + Single + Optional + Float + + kvarh + + + + + + Inductive Reactive Energy + R + Single + Optional + Float + + kvarh + + + + + + Capacitive Reactive Energy + R + Single + Optional + Float + + kvarh + + + + + + Apparent Energy + R + Single + Optional + Float + + kVAh + + + + + + Tension R-S + R + Single + Optional + Float + + V + + + + + + Tension S-T + R + Single + Optional + Float + + V + + + + + + Tension T-R + R + Single + Optional + Float + + V + + + + + + Frequency + R + Single + Optional + Float + + Hz + + + + + + Neutral Current + R + Single + Optional + Float + + A + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10243.xml b/application/src/main/data/lwm2m-registry/10243.xml new file mode 100644 index 0000000000..b73ce20021 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10243.xml @@ -0,0 +1,263 @@ + + + + + + + Single-Phase Power Meter + + + + 10243 + urn:oma:lwm2m:x:10243:2.0 + 1.0 + 2.0 + Multiple + Optional + + + Manufacturer + R + Single + Optional + String + + + + + + + + Model Number + R + Single + Optional + String + + + + + + + + Serial Number + R + Single + Optional + String + + + + + + + + Description + R + Single + Optional + String + + + + + + + + Tension + R + Single + Mandatory + Float + + V + + + + + + Current + R + Single + Mandatory + Float + + A + + + + + + Active Power + R + Single + Optional + Float + + kW + + + + + + Reactive Power + R + Single + Optional + Float + + kvar + + + + + + Inductive Reactive Power + R + Single + Optional + Float + + kvar + + + + + + Capacitive Reactive Power + R + Single + Optional + Float + + kvar + + + + + + Apparent Power + R + Single + Optional + Float + + kVA + + + + + + Power Factor + R + Single + Optional + Float + -1..1 + + + + + + + THD-V + R + Single + Optional + Float + + /100 + + + + + + THD-A + R + Single + Optional + Float + + /100 + + + + + + Active Energy + R + Single + Optional + Float + + kWh + + + + + + Reactive Energy + R + Single + Optional + Float + + kvarh + + + + + + Apparent Energy + R + Single + Optional + Float + + kVAh + + + + + + Frequency + R + Single + Optional + Float + + Hz + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10244.xml b/application/src/main/data/lwm2m-registry/10244.xml new file mode 100644 index 0000000000..9f55cd47de --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10244.xml @@ -0,0 +1,303 @@ + + + VehicleControlUnit + + 10244 + urn:oma:lwm2m:x:10244 + 1.0 + 1.0 + Single + Optional + + Vehicle UI State + R + Single + Mandatory + Integer + 0..15 + + + + Vehicle Speed + R + Single + Mandatory + Integer + + km/h + + + Vehicle Shift Status + R + Single + Mandatory + Integer + 0..3 + + + + Vehicle AP Position + R + Single + Mandatory + Integer + 0..100 + /100 + + + Vehicle Power + R + Single + Optional + Float + + kW + + + Vehicle Drive Energy + R + Single + Optional + Float + + Wh + + + Vehicle Energy Consumption Efficiency + R + Single + Optional + Float + + Wh/km + + + Vehicle Estimated Mileage + R + Single + Optional + Integer + + km + + + Vehicle Charge Cable Status + R + Single + Mandatory + Boolean + + + + + Vehicle Charge Status + R + Single + Mandatory + Integer + 0..15 + + + + Vehicle Charge Voltage + R + Single + Mandatory + Float + + V + + + Vehicle Charge Current + R + Single + Mandatory + Float + + A + + + Vehicle Charge Remaining Time + R + Single + Mandatory + Integer + + min + + + Battery Pack Voltage + R + Single + Mandatory + Float + + V + + + Battery Pack Current + R + Single + Mandatory + Float + + A + + + Battery Pack Remaining Capacity + R + Single + Mandatory + Integer + + Ah + + + Battery Pack SOC + R + Single + Mandatory + Integer + 0..100 + /100 + + + Battery Pack SOH + R + Single + Mandatory + Integer + 0..100 + /100 + + + Battery Cell MinVolt + R + Single + Mandatory + Integer + + mV + + + Battery Cell MaxVolt + R + Single + Mandatory + Integer + + mV + + + Battery Module MinTemp + R + Single + Mandatory + Integer + + Cel + + + Battery Module MaxTemp + R + Single + Mandatory + Integer + + Cel + + + Battery Connection Status + R + Single + Mandatory + Boolean + + + + + + MCU Voltage + R + Single + Mandatory + Integer + + V + + + MCU Temperature + R + Single + Mandatory + Integer + + Cel + + + Motor Speed + R + Single + Mandatory + Integer + + 1/min + + + Motor Temperature + R + Single + Mandatory + Integer + + Cel + + + Motor OT Warning + R + Single + Optional + Boolean + + + + + MCU OT Warning + R + Single + Optional + Boolean + + + + + Battery Pack OT Warning + R + Single + Optional + Boolean + + + + + MCU fault + R + Single + Optional + Boolean + + + + + Motor Error + R + Single + Optional + Boolean + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10245.xml b/application/src/main/data/lwm2m-registry/10245.xml new file mode 100644 index 0000000000..b29349130d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10245.xml @@ -0,0 +1,217 @@ + + + + + + Relay Management + This LWM2M Object provides a range of eNB related measurements and parameters of which several are changeable. Furthermore, it includes Resources to enable/disable the eNB. + 10245 + urn:oma:lwm2m:x:10245 + 1.0 + 1.0 + Single + Optional + + + eNB Availability + R + Single + Mandatory + Boolean + AVAILABLE; UNAVAILABLE + + This field indicates to the CCC whether or not the eNB of the CrowdBox is available for activation: AVAILABLE = TRUE; UNAVAILABLE = FALSE This is set by the CrowdBox itself using an algorithm specific to the use case and based on parameters known to the CrowdBox which may not necessarily be signalled to the network. In the absence of a more specific algorithm, this parameter should be set to AVAILABLE, unless a fault is detected which would prevent activation of the eNB, in which case it should be set to UNAVAILABLE. + + + GPS Status + R + Single + Mandatory + Boolean + UNSYNCHRONISED; SYNCHRONISED + + States whether the CrowdBox GPS receiver is synchronised to GPS time or not: UNSYCHRONISED = FALSE; SYNCHRONISED = TRUE If more than one GPS receiver is used by the CrowdBox, then SYNCHRONISED should be reported only if all receivers are synchronised. + + + Orientation + R + Single + Optional + Integer + -180..180 + deg + Orientation of CrowdBox with respect to magnetic north. The reference orientation of the CrowdBox shall be the pointing direction of the eNB antenna(s) or, in the case of an omni-directional CrowdBox antenna, as defined in the accompanying product documentation. + + + eNB EARFCN + RW + Single + Mandatory + Integer + 0..65535 + + EARFCN currently used by the eNB. Highest valid value in 3GPP is currently 46589. If the requested EARFCN is not supported by the eNB, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + eNB Bandwidth + RW + Single + Mandatory + Integer + 5, 10, 15, 20 + + Bandwidth of the currently used eNB carrier. If the requested bandwidth is not supported by the eNB, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + Backhaul Primary EARFCN + RW + Single + Mandatory + Integer + 0..65535 + + EARFCN of primary cell used for the backhaul. If the requested EARFCN is not supported by the CrowdBox UE, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + Backhaul Secondary EARFCN + RW + Multiple + Mandatory + Integer + 0..65535 + + EARFCN of any secondary cells used for the backhaul, in the event that carrier aggregation is being used. If the requested EARFCN is not supported by the CrowdBox UE, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + Cumulative Measurement Window + RW + Single + Mandatory + Integer + 0..65535 + s + The current measurement interval over which cumulative statistics are collected for the following resources: Cumulative Number of Unique Users, Cumulative Downlink Throughput per Connected User, Cumulative Uplink Throughput per Connected User. Note that this measurement period is a sliding window rather than a granularity period. Measurements should never be reset, but rather old measurements should be removed from the cumulative total as they fall outside of the window. A value of 0 shall be interpreted as meaning only the current value should be reported. A value of 65535 shall be interpreted as an infinite window size (i.e. old measurements are never discarded). + + + eNB ECI + R + Single + Mandatory + Integer + 0..2^28-1 + + A 28 bit E-UTRAN Cell Identifier (ECI) + + + eNB Status + RW + Single + Mandatory + Boolean + + + This resource indicates the current status of the eNB and can be used by the CCC to change the state from enabled to disabled. TRUE = eNB enabled FALSE = eNB disabled + + + Enable eNB + E + Single + Mandatory + + + + Enables the eNB. In addition the CrowdBox shall also update its configuration to reflect the current state of other relevant parameters. This might require a reboot. + + + eNB Maximum Power + RW + Single + Mandatory + Integer + 0..63 + dBm + Maximum power for the eNB measured as the sum of input powers to all antenna connectors. The maximum power per antenna port is equal to the maximum eNB power divided by the number of antenna ports. If the requested power is above or below the maximum or minimum power levels of the eNB, then the power level should be set to the maximum or minimum respectively. The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + Backhaul Primary q-OffsetFreq + RW + Single + Mandatory + Integer + -24..24 + dB + q-OffsetFreq parameter for the backhaul primary EARFCN in SIB5 of the CrowdBox eNB BCCH. See TS 36.331 for details. Range: dB-24; dB-22 .. dB24 The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + Backhaul Secondary q-OffsetFreq + RW + Multiple + Mandatory + Integer + -24..24 + dB + q-OffsetFreq parameter for the backhaul secondary EARFCN in SIB5 of the CrowdBox eNB BCCH. See TS 36.331 for details Range: dB-24; dB-22 .. dB24 The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + Neighbour CrowdBox EARFCN + RW + Multiple + Mandatory + Integer + 0..66635 + + EARFCN of a neighbour CrowdBox. Each instance of this resource relates to the same instance of resource ID 15. + + + Neighbour CrowdBox q-OffsetFreq + RW + Multiple + Mandatory + Integer + -24..24 + dB + q-OffsetFreq parameter of the Neighbour CrowdBox EARFCN in SIB5 of the Neighbour CrowdBox eNB BCCH. See TS 36.331 for details Range: dB-24; dB-22 .. dB24 Each instance of this resource relates to the same instance of resource ID 14. The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + Serving Macro eNB cellIndividualOffset + RW + Single + Mandatory + Integer + -24..24 + dB + Specifies the value of the cellIndividualOffset parameter applicable to the CrowdBox macro serving cell that is to be signalled to connected UEs in their measurement configuration information . See TS 36.331 for details. The CrowdBox shall only apply a change of this resource upon execution of the "Enable eNB" command. + + + + + diff --git a/application/src/main/data/lwm2m-registry/10246.xml b/application/src/main/data/lwm2m-registry/10246.xml new file mode 100644 index 0000000000..c3977d9538 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10246.xml @@ -0,0 +1,108 @@ + + + + + + + CrowdBox Measurements + This LWM2M Object provides CrowdBox-related measurements such as serving cell parameters, backhaul timing advance, and neighbour cell reports. + 10246 + urn:oma:lwm2m:x:10246 + 1.0 + 1.0 + Single + Optional + + + Serving Cell ID + R + Single + Mandatory + Integer + 0..2^32-1 + + Serving cell ID as specified by the cellIdentity field broadcast in SIB1 of the serving cell (see TS 36.331). + + + Serving Cell RSRP + R + Single + Mandatory + Integer + 0..97 + + Serving cell RSRP, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 + + + Serving Cell RSRQ + R + Single + Mandatory + Integer + -30..46 + + Serving cell RSRQ, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 + + + Serving Cell SINR + R + Single + Mandatory + Integer + -10..30 + dB + SINR of serving cell as estimated by the CrowdBox. Note that this is a proprietary measurement dependent on the UE chipset manufacturer. The UE chipset used should be stated in the accompanying product documentation. + + + Cumulative Backhaul Timing Advance + R + Single + Optional + Integer + 0..65535 + + The cumulative timing advance signalled by the current serving cell to the CrowdBox. This is the sum of the initial timing advance signalled in the MAC payload of the Random Access Response (11 bits, 0 .. 1282) and subsequent adjustments signalled in the MAC PDU of DL-SCH transmissions (6 bits, -31 .. 32). See TS 36.321 for details. + + + Neighbour Cell Report + R + Multiple + Mandatory + Objlnk + + + A link to the "Neighbour Cell Report" object for each neighbour cell of the CrowdBox. + + + + + diff --git a/application/src/main/data/lwm2m-registry/10247.xml b/application/src/main/data/lwm2m-registry/10247.xml new file mode 100644 index 0000000000..eba05417e8 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10247.xml @@ -0,0 +1,98 @@ + + + + + + + Neighbour Cell Report + This LWM2M Object provides the neighbour cell report. The CrowdBox Measurements Object and the Connected UE Report Object have both Objlnk Resources pointing to this Object. + 10247 + urn:oma:lwm2m:x:10247 + 1.0 + 1.0 + Multiple + Optional + + + Neighbour PCI + R + Single + Mandatory + Integer + 0..503 + + Physical Cell ID of neighbouring LTE cell, as defined in TS 36.211 + + + Neighbour Cell ID + R + Single + Optional + Integer + 0..2^32-1 + + Neighbour cell ID as specified by the cellIdentity field broadcast in SIB1 of the neighbour cell (see TS 36.331). + + + Neighbour Cell Rank + R + Single + Mandatory + Integer + 0..255 + + Current neighbour cell rank. Neighbour cells should be ordered (ranked) by the CrowdBox according to neighbour cell RSRP, with a higher RSRP corresponding to a lower index. Hence the neighbouring cell with the highest RSRP should be neighbour cell 0, the second neighbour cell 1, and so on. + + + Neighbour Cell RSRP + R + Single + Mandatory + Integer + 0..97 + + Neighbour cell RSRP, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 + + + Neighbour Cell RSRQ + R + Single + Mandatory + Integer + -30..46 + + Neighbour cell RSRQ, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 + + + + + diff --git a/application/src/main/data/lwm2m-registry/10248.xml b/application/src/main/data/lwm2m-registry/10248.xml new file mode 100644 index 0000000000..e9f69f7889 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10248.xml @@ -0,0 +1,78 @@ + + + + + + + Connected UE Measurements + This LWM2M Object provides a range of measurements of connected UEs and provides an Object link to the Connected UE report. + 10248 + urn:oma:lwm2m:x:10248 + 1.0 + 1.0 + Single + Optional + + + Number of Connected Users + R + Single + Mandatory + Integer + 0..255 + + The number of different UEs currently connected to the eNB (i.e. in RRC_CONNECTED state). + + + Cumulative Number of Unique Users + R + Single + Mandatory + Integer + 0..65535 + + The number of different UEs that have connected to the eNB over the immediately preceding period specified by the "Cumulative Measurement Window" field. + + + Connected UE Report + R + Multiple + Mandatory + Objlnk + + + Provides an Object link to the Connected UE Report which provides a range of information related to the connected UEs. + + + + + diff --git a/application/src/main/data/lwm2m-registry/10249.xml b/application/src/main/data/lwm2m-registry/10249.xml new file mode 100644 index 0000000000..e1257c3dda --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10249.xml @@ -0,0 +1,138 @@ + + + + + + + Connected UE Report + This LWM2M Object provides a range of information related to the connected UEs. + 10249 + urn:oma:lwm2m:x:10249 + 1.0 + 1.0 + Multiple + Optional + + + Connected User MMEC + R + Single + Mandatory + Integer + 0..255 + + MMEC signalled by the UE to the eNB in the RRCConnectionRequest message (see TS 36.331). + + + Connected User M-TMSI + R + Single + Mandatory + Integer + 0..2^32-1 + + M-TMSI signalled by the UE to the eNB in the RRCConnectionRequest message (see TS 36.331). + + + Serving Cell (CrowdBox) eNB RSRP + R + Single + Mandatory + Integer + 0..97 + + The RSRP of the CrowdBox eNB, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 + + + Serving Cell (CrowdBox) eNB RSRQ + R + Single + Mandatory + Integer + -30..46 + + The RSRQ of the CrowdBox eNB, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 + + + Cumulative Timing Advance per Connected User + R + Single + Optional + Integer + 0..65535 + + The cumulative timing advance signalled by the eNB to each currently connected UE. This is the sum of the initial timing advance signalled in the MAC payload of the Random Access Response (11 bits, 0 .. 1282) and subsequent adjustments signalled in the MAC PDU of DL-SCH transmissions (6 bits, -31 .. 32). See TS 36.321 for details. + + + Last downlink CQI report per Connected User + R + Single + Mandatory + Integer + 0..255 + + The last downlink wideband CQI reported by a connected user the eNB. The CQI format is defined in Table 7.2.3-1 of TS 36.213. + + + Cumulative Downlink Throughput per Connected User + R + Single + Mandatory + Integer + 0..2^32-1 + B + The total number of MAC bytes sent to the connected user over the immediately preceding period specified by the "Cumulative Measurement Window" field. + + + Cumulative Uplink Throughput per Connected User + R + Single + Mandatory + Integer + 0..2^32-1 + B + The total number of MAC bytes received from the connected user over the immediately preceding period specified by the "Cumulative Measurement Window" field. + + + Neighbour Cell Report + R + Multiple + Mandatory + Objlnk + + + A link to the "Neighbour Cell Report" object for each neighbour cell reported to the CrowdBox by the connected UE + + + + + diff --git a/application/src/main/data/lwm2m-registry/10250.xml b/application/src/main/data/lwm2m-registry/10250.xml new file mode 100644 index 0000000000..015149fae2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10250.xml @@ -0,0 +1,70 @@ + + + + + App Data Container + + 10250 + urn:oma:lwm2m:x:10250 + 1.0 + 1.0 + Single + Optional + + + UL data + R + Single + Mandatory + Opaque + + + + + + + + DL data + W + Single + Mandatory + Opaque + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10251.xml b/application/src/main/data/lwm2m-registry/10251.xml new file mode 100644 index 0000000000..3fb1c00154 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10251.xml @@ -0,0 +1,96 @@ + + + + + + AT Command + + 10251 + urn:oma:lwm2m:x:10251 + 1.0 + 1.0 + Multiple + Optional + + + Command + RW + Single + Mandatory + String + + + + + + Response + R + Multiple + Mandatory + String + + + + + + Status + R + Multiple + Mandatory + String + + + + + + Timeout + RW + Single + Optional + Integer + + + + + + Run + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10252.xml b/application/src/main/data/lwm2m-registry/10252.xml new file mode 100644 index 0000000000..ddaf7cb1f2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10252.xml @@ -0,0 +1,229 @@ + + + + + Manifest + + 10252 + urn:oma:lwm2m:x:10252 + 1.0 + 1.0 + Single + Optional + + + Manifest + W + Single + Mandatory + Opaque + + + + + + + + State + R + Single + Mandatory + Integer + 0..8 + + + + + + Manifest Result + R + Single + Mandatory + Integer + 0..19 + + + + + + Payload Result + R + Single + Mandatory + Opaque + + + + + + + + Asset Hash + R + Single + Mandatory + Opaque + + + + + + + + Manifest version + R + Single + Mandatory + Integer + + + + + + + + Asset Installation Progress + R + Single + Mandatory + Integer + + + + + + + + Campaign Id + RW + Single + Mandatory + String + + + + + + + + Manual Trigger + E + Single + Mandatory + + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10253.xml b/application/src/main/data/lwm2m-registry/10253.xml new file mode 100644 index 0000000000..27da37d16a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10253.xml @@ -0,0 +1,72 @@ + + + + + + + Confidential Data + + 10253 + urn:oma:lwm2m:x:10253 + 1.0 + 1.0 + Single + Optional + + + Public Key + RW + Single + Mandatory + Opaque + + + + + + + + Application Data + R + Single + Mandatory + Opaque + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10254.xml b/application/src/main/data/lwm2m-registry/10254.xml new file mode 100644 index 0000000000..ea37cf8cd8 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10254.xml @@ -0,0 +1,119 @@ + + + + + Current Loop Input + + 10254 + urn:oma:lwm2m:x:10254:1.0 + 1.0 + 1.0 + Multiple + Optional + + + Current Loop Input Current Value + R + Single + Mandatory + Float + 0; 3.8..20.5 + mA + + + + Min Measured Value + R + Single + Optional + Float + + + + + + Max Measured Value + R + Single + Optional + Float + + + + + + Min Range Value + R + Single + Optional + Float + + + + + + Max Range Value + R + Single + Optional + Float + + + + + + Reset Min and Max Measured Values + E + Single + Optional + + + + + + + Sensor Units + R + Single + Optional + String + + + + + + Application Type + RW + Single + Optional + String + + + + + + Current Calibration + RW + Single + Optional + Float + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10255.xml b/application/src/main/data/lwm2m-registry/10255.xml new file mode 100644 index 0000000000..fd63016952 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10255.xml @@ -0,0 +1,165 @@ + + + + + Device Metadata + + 10255 + urn:oma:lwm2m:x:10255 + 1.0 + 1.0 + Single + Optional + + + Protocol supported + R + Single + Mandatory + Integer + + + + + + + + Bootloader hash + R + Single + Mandatory + Opaque + + + + + + + + OEM bootloader hash + R + Single + Mandatory + Opaque + + + + + + + + Vendor + R + Single + Mandatory + String + + + + + + + + Class + R + Single + Mandatory + String + + + + + + + + Device + R + Single + Mandatory + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10256.xml b/application/src/main/data/lwm2m-registry/10256.xml new file mode 100644 index 0000000000..dbcad740d0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10256.xml @@ -0,0 +1,117 @@ + + + + ECID-Signal Measurement Information + + 10256 + urn:oma:lwm2m:x:10256 + 1.0 + 1.0 + Multiple + Optional + + + physCellId + R + Single + Mandatory + Integer + + + + + + + + ECGI + R + Single + Optional + Integer + + + + + + + + arfcnEUTRA + R + Single + Mandatory + Integer + + + + + + + + rsrp-Result + R + Single + Mandatory + Integer + + + + + + + + rsrq-Result + R + Single + Optional + Integer + + + + + + + + ue-RxTxTimeDiff + R + Single + Optional + Integer + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10257.xml b/application/src/main/data/lwm2m-registry/10257.xml new file mode 100644 index 0000000000..75864d542b --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10257.xml @@ -0,0 +1,275 @@ + + + + Heat / Cooling meter + + 10257 + urn:oma:lwm2m:x:10257 + 1.0 + 1.0 + Multiple + Optional + + + Manufacturer + R + Single + Optional + String + + + + + + Model Number + R + Single + Optional + String + + + + + + Serial Number + R + Single + Optional + String + + + + + + Description + R + Single + Optional + String + + + + + + Error code + R + Multiple + Optional + Integer + + + + + + + Instantaneous active power + R + Single + Optional + Float + + W + + + + Max Measured active power + R + Multiple + Mandatory + Float + + W + + + + Cumulative active power + R + Single + Optional + Float + + Wh + + + + Flow temperature + R + Single + Optional + Float + + Cel + + + + Max Measured flow temperature + R + Single + Optional + Float + + Cel + + + + Return temperature + R + Single + Optional + Float + + Cel + + + + Max Measured return temperature + R + Single + Optional + Float + + Cel + + + + Temperature difference + R + Single + Optional + Float + + K + + + + Flow rate + R + Single + Optional + Float + + m3/s + + + + Max Measured flow + R + Single + Optional + Float + + m3/s + + + + Flow volume + R + Single + Optional + Float + + m3 + + + + Return volume + R + Single + Optional + Float + + m3 + + + + Current Time + RW + Single + Optional + Time + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10258.xml b/application/src/main/data/lwm2m-registry/10258.xml new file mode 100644 index 0000000000..e2a9438170 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10258.xml @@ -0,0 +1,89 @@ + + + + + Current Loop Output + + 10258 + urn:oma:lwm2m:x:10258 + 1.0 + 1.0 + Multiple + Optional + + + Current Loop Output Current Value + RW + Single + Mandatory + Float + 3.8..20.5 + mA + + + + Min Range Value + R + Single + Optional + Float + + + + + + Max Range Value + R + Single + Optional + Float + + + + + + Sensor Units + R + Single + Optional + String + + + + + + Application Type + RW + Single + Optional + String + + + + + + Current Calibration + RW + Single + Optional + Float + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10259.xml b/application/src/main/data/lwm2m-registry/10259.xml new file mode 100644 index 0000000000..d75869a122 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10259.xml @@ -0,0 +1,115 @@ + + + + + + + System Log + + 10259 + urn:oma:lwm2m:x:10259 + 1.0 + 1.0 + Multiple + Optional + + + Name + R + Single + Mandatory + String + + + + + + + + Read All + R + Single + Mandatory + String + + + + + + + + Read + R + Single + Optional + String + + + + + + + + Enabled + RW + Single + Optional + Boolean + + + + + + + + Capture Level + RW + Single + Optional + Integer + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10260.xml b/application/src/main/data/lwm2m-registry/10260.xml new file mode 100644 index 0000000000..5cd084af73 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10260.xml @@ -0,0 +1,95 @@ + + + + + + RDB + + 10260 + urn:oma:lwm2m:x:10260:2.0 + 1.0 + 2.0 + Multiple + Optional + + + Key + RW + Single + Mandatory + String + + + + + + + + Value + RW + Single + Optional + String + + + + + + + + Exists + RW + Single + Optional + Boolean + + + + + + + + Persistent + RW + Single + Optional + Boolean + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10262.xml b/application/src/main/data/lwm2m-registry/10262.xml new file mode 100644 index 0000000000..9fd47ac3af --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10262.xml @@ -0,0 +1,89 @@ + + + + + + + Interval Data Delivery + + 10262 + urn:oma:lwm2m:x:10262 + 1.0 + 1.0 + Multiple + Optional + + + Name + RW + Single + Mandatory + String + + + + + + Interval Data Links + RW + Multiple + Mandatory + Objlnk + + + + + + Latest Payload + R + Multiple + Mandatory + Opaque + + + + + + Schedule + RW + Single + Optional + Objlnk + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10263.xml b/application/src/main/data/lwm2m-registry/10263.xml new file mode 100644 index 0000000000..07b9cde3ca --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10263.xml @@ -0,0 +1,92 @@ + + + + + + + Event Data Delivery + + 10263 + urn:oma:lwm2m:x:10263 + 1.0 + 1.0 + Multiple + Optional + + + Name + RW + Single + Mandatory + String + + + + + + Event Data Links + RW + Multiple + Mandatory + Objlnk + + + + + + Latest Eventlog + R + Multiple + Mandatory + Opaque + + + + + + Schedule + RW + Single + Mandatory + Objlnk + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10264.xml b/application/src/main/data/lwm2m-registry/10264.xml new file mode 100644 index 0000000000..b11c42a21d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10264.xml @@ -0,0 +1,119 @@ + + + + + + + Delivery Schedule + + 10264 + urn:oma:lwm2m:x:10264 + 1.0 + 1.0 + Multiple + Optional + + + Schedule Start Time + RW + Single + Mandatory + Integer + + + + + + Schedule UTC Offset + RW + Single + Mandatory + String + + + + + + Delivery Frequency + RW + Single + Mandatory + Integer + + + + + + Randomised Delivery Window + RW + Single + Optional + Integer + + + + + + Number of Retries + RW + Single + Optional + Integer + + + + + + Retry Period + RW + Single + Optional + Integer + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10265.xml b/application/src/main/data/lwm2m-registry/10265.xml new file mode 100644 index 0000000000..2604ae86d7 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10265.xml @@ -0,0 +1,138 @@ + + + + + + + Leakage Detection Configuration + + 10265 + urn:oma:lwm2m:x:10265 + 1.0 + 1.0 + Single + Optional + + + Sample Times + RW + Multiple + Mandatory + Integer + + + + + + Sample UTC Offset + RW + Single + Optional + String + + + + + + Detection Mode + RW + Single + Mandatory + Integer + 0..3 + + + + + Top Frequency Count + RW + Single + Optional + Integer + + + + + + Frequency Thresholds + RW + Multiple + Optional + Integer + 0..999 + + + + + Frequency Values + R + Multiple + Optional + Integer + + + + + + Firmware Version + R + Single + Mandatory + String + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10266.xml b/application/src/main/data/lwm2m-registry/10266.xml new file mode 100644 index 0000000000..48ee41319a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10266.xml @@ -0,0 +1,246 @@ + + + + + + + Water Flow Readings + + 10266 + urn:oma:lwm2m:x:10266 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Optional + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Optional + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10267.xml b/application/src/main/data/lwm2m-registry/10267.xml new file mode 100644 index 0000000000..ffe70b5f2f --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10267.xml @@ -0,0 +1,246 @@ + + + + + + + Daily Maximum Flow Rate Readings + + 10267 + urn:oma:lwm2m:x:10267 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Optional + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Optional + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10268.xml b/application/src/main/data/lwm2m-registry/10268.xml new file mode 100644 index 0000000000..a1ccd43888 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10268.xml @@ -0,0 +1,246 @@ + + + + + + + Temperature Readings + + 10268 + urn:oma:lwm2m:x:10268 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Optional + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Optional + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10269.xml b/application/src/main/data/lwm2m-registry/10269.xml new file mode 100644 index 0000000000..e4156e055e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10269.xml @@ -0,0 +1,246 @@ + + + + + + + Pressure Readings + + 10269 + urn:oma:lwm2m:x:10269 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Optional + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Optional + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10270.xml b/application/src/main/data/lwm2m-registry/10270.xml new file mode 100644 index 0000000000..b7d171920c --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10270.xml @@ -0,0 +1,246 @@ + + + + + + + Battery Level Readings + + 10270 + urn:oma:lwm2m:x:10270 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Optional + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Optional + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10271.xml b/application/src/main/data/lwm2m-registry/10271.xml new file mode 100644 index 0000000000..b4f8dfa6d5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10271.xml @@ -0,0 +1,246 @@ + + + + + + + Communications Activity Time Readings + + 10271 + urn:oma:lwm2m:x:10271 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Optional + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Optional + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10272.xml b/application/src/main/data/lwm2m-registry/10272.xml new file mode 100644 index 0000000000..0464c98a73 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10272.xml @@ -0,0 +1,232 @@ + + + + + + + Water Meter Customer Leakage Alarm + + 10272 + urn:oma:lwm2m:x:10272 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10273.xml b/application/src/main/data/lwm2m-registry/10273.xml new file mode 100644 index 0000000000..823adae0ed --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10273.xml @@ -0,0 +1,232 @@ + + + + + + + Water Meter Reverse Flow Alarm + + 10273 + urn:oma:lwm2m:x:10273 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10274.xml b/application/src/main/data/lwm2m-registry/10274.xml new file mode 100644 index 0000000000..f61554ca88 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10274.xml @@ -0,0 +1,232 @@ + + + + + + + Water Meter Empty Pipe Alarm + + 10274 + urn:oma:lwm2m:x:10274 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10275.xml b/application/src/main/data/lwm2m-registry/10275.xml new file mode 100644 index 0000000000..10248ea511 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10275.xml @@ -0,0 +1,232 @@ + + + + + + + Water Meter Tamper Alarm + + 10275 + urn:oma:lwm2m:x:10275 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10276.xml b/application/src/main/data/lwm2m-registry/10276.xml new file mode 100644 index 0000000000..5863f0326b --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10276.xml @@ -0,0 +1,232 @@ + + + + + + + Water Meter High Pressure Alarm + + 10276 + urn:oma:lwm2m:x:10276 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10277.xml b/application/src/main/data/lwm2m-registry/10277.xml new file mode 100644 index 0000000000..83c6d4f0d5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10277.xml @@ -0,0 +1,232 @@ + + + + + + + Water Meter Low Pressure Alarm + + 10277 + urn:oma:lwm2m:x:10277 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10278.xml b/application/src/main/data/lwm2m-registry/10278.xml new file mode 100644 index 0000000000..d004f89de6 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10278.xml @@ -0,0 +1,232 @@ + + + + + + + High Temperature Alarm + + 10278 + urn:oma:lwm2m:x:10278 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10279.xml b/application/src/main/data/lwm2m-registry/10279.xml new file mode 100644 index 0000000000..38838e7c94 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10279.xml @@ -0,0 +1,232 @@ + + + + + + + Low Temperature Alarm + + 10279 + urn:oma:lwm2m:x:10279 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10280.xml b/application/src/main/data/lwm2m-registry/10280.xml new file mode 100644 index 0000000000..de2b7b6732 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10280.xml @@ -0,0 +1,232 @@ + + + + + + + Water Network Leak Alarm + + 10280 + urn:oma:lwm2m:x:10280 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10281.xml b/application/src/main/data/lwm2m-registry/10281.xml new file mode 100644 index 0000000000..99eab667f2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10281.xml @@ -0,0 +1,232 @@ + + + + + + + Low Battery Alarm + + 10281 + urn:oma:lwm2m:x:10281 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10282.xml b/application/src/main/data/lwm2m-registry/10282.xml new file mode 100644 index 0000000000..e603de36b3 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10282.xml @@ -0,0 +1,232 @@ + + + + + + + Daughter Board Failure Alarm + + 10282 + urn:oma:lwm2m:x:10282 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10283.xml b/application/src/main/data/lwm2m-registry/10283.xml new file mode 100644 index 0000000000..fd130fa713 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10283.xml @@ -0,0 +1,232 @@ + + + + + + + Device Reboot Event + + 10283 + urn:oma:lwm2m:x:10283 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10284.xml b/application/src/main/data/lwm2m-registry/10284.xml new file mode 100644 index 0000000000..1e889da48a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10284.xml @@ -0,0 +1,232 @@ + + + + + + + Time Synchronisation Event + + 10284 + urn:oma:lwm2m:x:10284 + 1.0 + 1.0 + Multiple + Optional + + + Event Type + RW + Single + Mandatory + Integer + + + + + + Alarm Realtime + RW + Single + Mandatory + Boolean + + + + + + Alarm State + R + Single + Optional + Boolean + + + + + + Alarm Set Threshold + RW + Single + Optional + Float + + + + + + Alarm Set Operator + RW + Single + Optional + Integer + + + + + + Alarm Clear Threshold + RW + Single + Optional + Float + + + + + + Alarm Clear Operator + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Count + RW + Single + Optional + Integer + + + + + + Alarm Maximum Event Period + RW + Single + Optional + Integer + 1..864000 + s + + + + Latest Delivered Event Time + RW + Single + Optional + Time + + + + + + Latest Recorded Event Time + R + Single + Mandatory + Time + + + + + + Alarm Clear + E + Single + Optional + + + + + + + Alarm Auto Clear + RW + Single + Optional + Boolean + + + + + + Event Code + R + Single + Mandatory + Integer + 100..255 + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10286.xml b/application/src/main/data/lwm2m-registry/10286.xml new file mode 100644 index 0000000000..39e0809788 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10286.xml @@ -0,0 +1,48 @@ + + + + App Fota Container + + 10286 + urn:oma:lwm2m:x:10286 + 1.0 + 1.0 + Single + Optional + + + UL data + R + Single + Mandatory + Opaque + + + + + + + + DL data + W + Single + Mandatory + Opaque + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10290.xml b/application/src/main/data/lwm2m-registry/10290.xml new file mode 100644 index 0000000000..7b89cc06c0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10290.xml @@ -0,0 +1,198 @@ + + + + + + + Voltage Logging + + 10290 + urn:oma:lwm2m:x:10290 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Optional + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Optional + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10291.xml b/application/src/main/data/lwm2m-registry/10291.xml new file mode 100644 index 0000000000..a232ed02f9 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10291.xml @@ -0,0 +1,208 @@ + + + + + + + Voltage Transient + + 10291 + urn:oma:lwm2m:x:10291 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Mandatory + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Mandatory + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + Sample Frequency + RW + Single + Mandatory + Float + 0.0..86400.0 + s + How often the inputs are read/sampled.This value can be changed by doing a write command + + + + + diff --git a/application/src/main/data/lwm2m-registry/10292.xml b/application/src/main/data/lwm2m-registry/10292.xml new file mode 100644 index 0000000000..00fe33e320 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10292.xml @@ -0,0 +1,208 @@ + + + + + + + Pressure Transient + + 10292 + urn:oma:lwm2m:x:10292 + 1.0 + 1.0 + Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Mandatory + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Mandatory + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + Sample Frequency + RW + Single + Mandatory + Float + 0.0..86400.0 + s + How often the inputs are read/sampled.This value can be changed by doing a write command + + + + + diff --git a/application/src/main/data/lwm2m-registry/10299.xml b/application/src/main/data/lwm2m-registry/10299.xml new file mode 100644 index 0000000000..a16a7c4fc2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10299.xml @@ -0,0 +1,113 @@ + + + + + + + HostDevice + This LWM2M Object provides a range of host device related information which can be queried by the LWM2M Server. The host device is any integrated device with an embedded cellular radio module. + 10299 + urn:oma:lwm2m:x:10299 + 1.0 + 1.0 + Single + Optional + + + Manufacturer + R + Single + Mandatory + String + + + Host device manufacturers name (OEM). + + + Model + R + Single + Mandatory + String + + Identifier of the model name or number determined by device manufacturer. + UniqueID + R + Single + Mandatory + String + + + Unique ID assigned by an manufacturer or other body. Used to uniquely identify a host device. Examples include serial # or UUID. + + + FirmwareVersion + R + Single + Mandatory + String + + + Current Firmware version of the host device. (manufacturer specified string). + + SoftwareVersion + R + Single + Optional + String + + + Current software version of the host device. (manufacturer specified string). + + HardwareVersion + R + Single + Optional + String + + + Current hardware version of the host device. (manufacturer specified string). + + + DateStamp + R + Single + Optional + String + + + UTC value of the time and date of the last Firmware or Software update. Format:MM:DD:YYYY HH:MM:SS + + + + + diff --git a/application/src/main/data/lwm2m-registry/10300.xml b/application/src/main/data/lwm2m-registry/10300.xml new file mode 100644 index 0000000000..234f0301a4 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10300.xml @@ -0,0 +1,142 @@ + + + + + + + LWM2M Meta Object + + + + 10300 + urn:oma:lwm2m:x:10300 + 1.0 + 1.0 + Multiple + Optional + + + ObjectID + R + Single + Mandatory + Integer + + + + + + + + ObjectURN + R + Single + Mandatory + String + + + + + + + + ObjectInstanceHandle + R + Single + Optional + Objlnk + + + + + + + + URI + R + Multiple + Mandatory + String + + + + + + + + SHAType + R + Single + Optional + Integer + 0..8 + + + + + + + ChecksumValue + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10308.xml b/application/src/main/data/lwm2m-registry/10308.xml new file mode 100644 index 0000000000..0ed1a6ea30 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10308.xml @@ -0,0 +1,145 @@ + + + + + + + AT&T Connectivity Extension + + 10308 + urn:oma:lwm2m:x:10308:2.0 + 1.0 + 2.0 + Multiple + Optional + + + ICCID + R + Single + Mandatory + String + + + + + + + IMSI + R + Single + Mandatory + String + + + + + + + MSISDN + RW + Single + Mandatory + String + + + + + + + APN Retries + RW + Single + Mandatory + Integer + + + + + + + APN Retry Period + RW + Single + Mandatory + Integer + + + s + + + + APN Retry Back-Off Period + RW + Single + Mandatory + Integer + + + s + + + + SINR + R + Single + Mandatory + Integer + <7 to >12.5 + + + + + SRXLEV + R + Single + Mandatory + Integer + + + + + + + CE_LEVEL + R + Single + Mandatory + Integer + 0,1,2 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10309.xml b/application/src/main/data/lwm2m-registry/10309.xml new file mode 100644 index 0000000000..b37b435724 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10309.xml @@ -0,0 +1,115 @@ + + + + + Shareparkinglot + + 10309 + urn:oma:lwm2m:x:10309 + 1.0 + 1.0 + Multiple + Optional + + + LockID + R + Single + Mandatory + Integer + + + + + + LockType + R + Single + Optional + String + + + + + + LightSwitchState + R + Multiple + Optional + Boolean + + + + + + RSSI + R + Multiple + Mandatory + Integer + -30..-120 + dBm + + + + BatteryCapacity + R + Multiple + Optional + Float + 0..100 + %EL + + + + DataUpTime + R + Multiple + Mandatory + Time + + + + + + Latitude + R + Multiple + Optional + String + + + + + + Longitude + R + Multiple + Optional + String + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10311.xml b/application/src/main/data/lwm2m-registry/10311.xml new file mode 100644 index 0000000000..6b6a78d21d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10311.xml @@ -0,0 +1,192 @@ + + + + + + + Solar Radiation + This Object is used to report solar irradiance (SI), i.e. power per unit area received from the Sun in the form of electromagnetic radiation, on a planar surface measured by a pyranometer or similar instrument. A pyranometer measures solar irradiance from the hemisphere above within a wavelength range 0.3 um to 3 um. For example, the application of solar radiation measurement can be meterological networks and solar energy applications. + 10311 + urn:oma:lwm2m:x:10311:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Min Measured Value + R + Single + Optional + Float + + + + The minimum value measured by the sensor since power ON or reset. + + + + Max Measured Value + R + Single + Optional + Float + + + + The maximum value measured by the sensor since power ON or reset. + + + + Min Range Value + R + Single + Optional + Float + + + + The minimum value that can be measured by the sensor. + + + + Max Range Value + R + Single + Optional + Float + + + + The maximum value that can be measured by the sensor. + + + + Reset Min and Max Measured Values + E + Single + Optional + + + + + Reset the Min and Max Measured Values to Current Value. + + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + + Measurement Units Definition. + + + + Application Type + RW + Single + Optional + String + + + + The application type of the sensor or actuator as a string depending on the use case. + + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/10313.xml b/application/src/main/data/lwm2m-registry/10313.xml new file mode 100644 index 0000000000..4875e5d6b0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10313.xml @@ -0,0 +1,253 @@ + + + + + + + Gas Readings + + 10313 + urn:oma:lwm2m:x:103131.0 + 1.0Multiple + Optional + + + Interval Period + R + Single + Mandatory + Integer + 1..864000 + s + + + + Interval Start Offset + R + Single + Optional + Integer + 0..86399 + s + + + + Interval UTC Offset + R + Single + Optional + String + + + + + + Interval Collection Start Time + R + Single + Mandatory + Time + + + + + + Oldest Recorded Interval + R + Single + Mandatory + Time + + + + + + Last Delivered Interval + RW + Single + Optional + Time + + + + + + Latest Recorded Interval + R + Single + Mandatory + Time + + + + + + Interval Delivery Midnight Aligned + RW + Single + Mandatory + Boolean + + + + + + Interval Historical Read + E + Single + Optional + + + + + + + Interval Historical Read Payload + R + Single + Optional + Opaque + + + + + + Interval Change Configuration + E + Single + Optional + + + + + + + Start + E + Single + Optional + + + + + + + Stop + E + Single + Optional + + + + + + + Status + R + Single + Optional + Integer + + + + + + Latest Payload + R + Single + Mandatory + Opaque + + + + + + Sensor Warm-up Time + RW + Single + Optional + Integer + 0..86400 + s + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10314.xml b/application/src/main/data/lwm2m-registry/10314.xml new file mode 100644 index 0000000000..f003fa03c2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10314.xml @@ -0,0 +1,106 @@ + + + + + + + Particulates + + 10314 + urn:oma:lwm2m:x:10314 + 1.0 + 1.0 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + + + + Min Measured Value + R + Single + Optional + Float + + + + + + Max Measured Value + R + Single + Optional + Float + + + + + + Max Range Value + R + Single + Optional + Float + + + + + + Sensor Units + R + Single + Optional + String + + + + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + + + + Measured Particle Size + R + Single + Mandatory + Float + + m + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10315.xml b/application/src/main/data/lwm2m-registry/10315.xml new file mode 100644 index 0000000000..da7ff8c67e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10315.xml @@ -0,0 +1,129 @@ + + + + + + Robot + + 10315 + urn:oma:lwm2m:x:10315 + 1.0 + 1.0 + Single + Mandatory + + + Robot ID + R + Single + Mandatory + String + 0..255 + + + + + Robot Type + R + Single + Mandatory + String + 0..63 + + + + + Robot Serial Number + R + Single + Mandatory + String + 0..63 + + + + + Battery Level + R + Single + Mandatory + Integer + 0..100 + % + + + + Charging + R + Single + Mandatory + Boolean + + + + + + On time + RW + Single + Mandatory + Integer + + s + + + + Positioning + R + Single + Optional + Boolean + + + + + + Location + R + Single + Optional + Objlnk + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10316.xml b/application/src/main/data/lwm2m-registry/10316.xml new file mode 100644 index 0000000000..d10dabf99b --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10316.xml @@ -0,0 +1,233 @@ + + + + + + RCU + + 10316 + urn:oma:lwm2m:x:10316 + 1.0 + 1.0 + Single + Mandatory + + + RCU ID + R + Single + Mandatory + String + 0..127 + + + + + RCU Serial Number + R + Single + Mandatory + String + 0..63 + + + + + RCU Software Version + R + Single + Mandatory + String + 0..63 + + + + + RCU OS Version + R + Single + Mandatory + String + 0..127 + + + + + RCU CPU Info + R + Single + Mandatory + String + 64 + + + + + RCU RAM Info + R + Single + Mandatory + String + 64 + + + + + RCU ROM Size + R + Single + Mandatory + Integer + + GB + + + + RCU ROM Available Size + R + Single + Mandatory + Integer + + GB + + + + SD Storage + R + Single + Mandatory + Integer + + GB + + + + SD Available Storage + R + Single + Mandatory + Integer + + GB + + + + RCU GPS Location + R + Single + Optional + Objlnk + + + + + + Wi-Fi MAC + R + Single + Optional + String + 12 + + + + + Bluetooth MAC + R + Single + Optional + String + 12 + + + + + Camera Info + R + Single + Optional + String + 64 + + + + + + Battery Level + R + Single + Mandatory + Integer + 0..100 + /100 + + + + + On time + RW + Single + Mandatory + Integer + + s + + + + + Downloaded APP Packages + R + Multiple + Mandatory + String + + + + + + + RCU APPs + R + Multiple + Optional + Objlnk + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10318.xml b/application/src/main/data/lwm2m-registry/10318.xml new file mode 100644 index 0000000000..989db0de7e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10318.xml @@ -0,0 +1,189 @@ + + + + + + RCU PM + + 10318 + urn:oma:lwm2m:x:10318 + 1.0 + 1.0 + Single + Mandatory + + + CPU Usage + R + Single + Mandatory + Integer + 0..100 + /100 + + + + Max CPU Usage + R + Single + Mandatory + Integer + 0..100 + /100 + + + + Memory Usage + R + Single + Mandatory + Integer + 0..100 + /100 + + + + Storage Usage + R + Single + Mandatory + Integer + 0..100 + /100 + + + + + Battery Level + R + Single + Mandatory + Integer + 0..100 + /100 + + + + Network Bandwidth + R + Single + Mandatory + Float + + Mbit/s + + + + Mobile Signal + R + Single + Mandatory + Integer + + + + + + GPS Signal + R + Single + Optional + Integer + + + + + + Wi-Fi Signal + R + Single + Mandatory + Integer + + + + + + UpLink Rate + R + Single + Mandatory + Float + + Mbit/s + + + + DownLink Rate + R + Single + Mandatory + Float + + Mbit/s + + + + Packet Loss Rate + R + Single + Mandatory + Integer + 0..100 + /100 + + + + Network Latency + R + Single + Mandatory + Integer + + ms + + + + + Battery Temperature + R + Single + Mandatory + Float + + Cel + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10319.xml b/application/src/main/data/lwm2m-registry/10319.xml new file mode 100644 index 0000000000..b8ebcef6fb --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10319.xml @@ -0,0 +1,130 @@ + + + + + + RCU Control + + 10319 + urn:oma:lwm2m:x:10319 + 1.0 + 1.0 + Single + Mandatory + + + RCU Diagnostics Mode + R + Single + Optional + Boolean + + + + + + RCU Log Recording + R + Single + Optional + Boolean + + + + + + + RCU Shutdown + E + Single + Mandatory + + + + + + + RCU Restart + E + Single + Mandatory + + + + + + + RCU Deactivate + E + Single + Mandatory + + + + + + + RCU Reset + E + Single + Mandatory + + + + + + + RCU Diagnostics Mode Control + E + Single + Mandatory + + + + + + + RCU Log Recording Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10320.xml b/application/src/main/data/lwm2m-registry/10320.xml new file mode 100644 index 0000000000..fb48c814f0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10320.xml @@ -0,0 +1,141 @@ + + + + + + CCU + + 10320 + urn:oma:lwm2m:x:10320 + 1.0 + 1.0 + Multiple + Optional + + + CCU ID + R + Single + Mandatory + String + + + + + + CCU FM Version + R + Single + Mandatory + String + + + + + + CCU SW Version + R + Single + Mandatory + String + + + + + + CCU Memory Size + R + Single + Mandatory + Integer + + GB + + + + CCU Storage + R + Single + Mandatory + Integer + + GB + + + + CCU Available Storage + R + Single + Mandatory + Integer + + GB + + + + + On time + RW + Single + Mandatory + Integer + + s + + + + + Downloaded APP Packages + R + Multiple + Optional + String + + + + + + CCU APPs + R + Multiple + Optional + Objlnk + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10322.xml b/application/src/main/data/lwm2m-registry/10322.xml new file mode 100644 index 0000000000..98822e0efe --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10322.xml @@ -0,0 +1,87 @@ + + + + + + CCU PM + + 10322 + urn:oma:lwm2m:x:10322 + 1.0 + 1.0 + Multiple + Optional + + + CPU Usage + R + Single + Optional + Integer + 0..100 + % + + + + Max CPU Usage + R + Single + Optional + Integer + 0..100 + % + + + + Memory Usage + R + Single + Optional + Integer + 0..100 + % + + + + Storage Usage + R + Single + Optional + Integer + 0..100 + % + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10323.xml b/application/src/main/data/lwm2m-registry/10323.xml new file mode 100644 index 0000000000..dcbdaeb91d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10323.xml @@ -0,0 +1,90 @@ + + + + + + CCU Control + + 10323 + urn:oma:lwm2m:x:10323 + 1.0 + 1.0 + Multiple + Optional + + + + CCU Restart + E + Single + Mandatory + + + + + + + CCU Reset + E + Single + Mandatory + + + + + + + CCU Self-checking + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10324.xml b/application/src/main/data/lwm2m-registry/10324.xml new file mode 100644 index 0000000000..b3db2b4f06 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10324.xml @@ -0,0 +1,77 @@ + + + + + + ECU + + 10324 + urn:oma:lwm2m:x:10324 + 1.0 + 1.0 + Multiple + Optional + + + ECU ID + R + Single + Mandatory + String + + + + + + ECU FM Version + R + Single + Mandatory + String + + + + + + On time + RW + Single + Mandatory + Integer + + s + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10326.xml b/application/src/main/data/lwm2m-registry/10326.xml new file mode 100644 index 0000000000..cdc01a0e61 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10326.xml @@ -0,0 +1,722 @@ + + + + + + Robot PM + + 10326 + urn:oma:lwm2m:x:10326 + 1.0 + 1.0 + Single + Mandatory + + + Battery Level + R + Single + Mandatory + Integer + 0..100 + /100 + , for example: ]]> + + + + Battery Temperature + R + Single + Mandatory + Integer + + Cel + + + + Temperature + R + Single + Optional + Float + + Cel + + + + Humidity + R + Single + Optional + Integer + 0..100 + /100 + + + + PM2.5 + R + Single + Optional + Integer + + ug/m3 + + + + Smog + R + Single + Optional + Float + + ug/m3 + + + + CO + R + Single + Optional + Float + + ppm + + + + CO2 + R + Single + Optional + Float + + ppm + + + + PM10 + R + Single + Optional + Integer + + ug/m3 + + + + Speed + R + Single + Optional + Float + + m/h + + + + Water Used + R + Single + Optional + Integer + 0..100 + /100 + + + + Dust Box Used + R + Single + Optional + Integer + 0..100 + /100 + + + + Obstacle Distance + R + Single + Optional + Integer + + cm + + + + + Robot Temperate + R + Single + Optional + Float + + Cel + + + + Confidence Index + R + Single + Optional + Integer + 0..100 + /100 + + + + + Data Traffic Used + R + Single + Mandatory + Float + + Mbit/s + + + + Images Handled + R + Single + Optional + Integer + + + + + + HARI S-Voice Requests + R + Single + Optional + Integer + + + + + + HARI S-Vision Requests + R + Single + Optional + Integer + + + + + + HARI S-Motion Requests + R + Single + Optional + Integer + + + + + + HARI S-Map Requests + R + Single + Optional + Integer + + + + + + Successful HARI S-Voice Requests + R + Single + Optional + Integer + + + + + + Successful HARI S-Vision Requests + R + Single + Optional + Integer + + + + + + Successful HARI S-Motion Requests + R + Single + Optional + Integer + + + + + + Successful HARI S-Map Requests + R + Single + Optional + Integer + + + + + + Questions Answered + R + Single + Optional + Integer + + + + + + Unknown Questions + R + Single + Optional + Integer + + + + + + Mileage + R + Single + Optional + Integer + + m + + + + Cleaned Times + R + Single + Optional + Integer + + + + + + Cleaned Area + R + Single + Optional + Float + + m2 + + + + Cleaned Time + R + Single + Optional + Integer + + s + + + + ASR Recognized + R + Single + Optional + Integer + + B + + + + Incorrect ASR Recognitions + R + Single + Optional + Integer + + B + + + + Tried TTS Texts + R + Single + Optional + Integer + + B + + + + Successful TTS Texts + R + Single + Optional + Integer + + B + + + + ASR Recognized (CH) + R + Single + Optional + Integer + + B + + + + Tried TTS Texts (CH) + R + Single + Optional + Integer + + B + + + + Successful TTS Texts (CH) + R + Single + Optional + Integer + + B + + + + ASR Recognized (EN) + R + Single + Optional + Integer + + B + + + + Tried TTS Texts (EN) + R + Single + Optional + Integer + + B + + + + Successful TTS Texts (EN) + R + Single + Optional + Integer + + B + + + + ASR Recognized (ES) + R + Single + Optional + Integer + + B + + + + Tried TTS Texts (ES) + R + Single + Optional + Integer + + B + + + + Successful TTS Texts (ES) + R + Single + Optional + Integer + + B + + + + ASR Recognized (JA) + R + Single + Optional + Integer + + B + + + + Tried TTS Texts (JA) + R + Single + Optional + Integer + + B + + + + Successful TTS Texts (JA) + R + Single + Optional + Integer + + B + + + + ASR Recognized (SCCH) + R + Single + Optional + Integer + + B + + + + Tried TTS Texts (SCCH) + R + Single + Optional + Integer + + B + + + + Successful TTS Texts (SCCH) + R + Single + Optional + Integer + + B + + + + ASR Recognized (GDCH) + R + Single + Optional + Integer + + B + + + + Tried TTS Texts (GDCH) + R + Single + Optional + Integer + + B + + + + Successful TTS Texts (GDCH) + R + Single + Optional + Integer + + B + + + + ASR Recognized (TCH) + R + Single + Optional + Integer + + B + + + + Tried TTS Texts (TCH) + R + Single + Optional + Integer + + B + + + + Successful TTS Texts (TCH) + R + Single + Optional + Integer + + B + + + + + Objects Recognition Tries + R + Single + Optional + Integer + + + + + + Successful Object Recognition + R + Single + Optional + Integer + + + + + + Face Recognition Tries + R + Single + Optional + Integer + + + + + + Successful Face Recognitions + R + Single + Optional + Integer + + + + + + Vehicle Plate Recognition Tries + R + Single + Optional + Integer + + + + + + Successful Vehicle Plate Recognitions + R + Single + Optional + Integer + + + + + + Tasks Assigned + R + Single + Mandatory + Integer + + + + + + Successful Tasks Executed + R + Single + Mandatory + Integer + + + + + + Images Uploaded + R + Single + Optional + Integer + + + + + + Videos Uploaded + R + Single + Optional + Integer + + + + + + Images Matted + R + Single + Optional + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10327.xml b/application/src/main/data/lwm2m-registry/10327.xml new file mode 100644 index 0000000000..5f0e232a22 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10327.xml @@ -0,0 +1,68 @@ + + + + + + Compressor + + 10327 + urn:oma:lwm2m:x:10327 + 1.0 + 1.0 + Multiple + Optional + + + Compressor Name + R + Single + Mandatory + String + + + + + + + Compressor Status + R + Single + Mandatory + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10328.xml b/application/src/main/data/lwm2m-registry/10328.xml new file mode 100644 index 0000000000..fdf39d5dc1 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10328.xml @@ -0,0 +1,80 @@ + + + + + + SCA PM + + 10328 + urn:oma:lwm2m:x:10328 + 1.0 + 1.0 + Multiple + Optional + + + SCA Name + R + Single + Mandatory + String + + + + + + + + + SCA Current + R + Single + Mandatory + Float + + A + + + + SCA Temperate + R + Single + Mandatory + Float + + Cel + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10329.xml b/application/src/main/data/lwm2m-registry/10329.xml new file mode 100644 index 0000000000..7470bec6e1 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10329.xml @@ -0,0 +1,433 @@ + + + + + + Robot Control + + 10329 + urn:oma:lwm2m:x:10329 + 1.0 + 1.0 + Single + Mandatory + + + Collision Detection + R + Single + Optional + Boolean + + + + + + Drop Detection + R + Single + Optional + Boolean + + + + + + Automatic Navigation + R + Single + Optional + Boolean + + + + + + Robot Shutdown + E + Single + Mandatory + + + + + + + Robot Reboot + E + Single + Mandatory + + + + + + + Robot Reset + E + Single + Mandatory + + + + + + + Robot Wakeup + E + Single + Mandatory + + + + + + + Robot Sleep + E + Single + Mandatory + + + + + + + Robot Self-checking + E + Single + Mandatory + + + + + + + Emergency Braking + E + Single + Mandatory + + + + + + + Emergency Braking Release + E + Single + Mandatory + + + + + + + Action Execution + E + Single + Optional + + + + + + + Action List Upload + E + Single + Optional + + + + + + + Action List Download + E + Single + Optional + + + + + + + Group Dancing Program Control + E + Single + Optional + + + + + + + Navigation Map Upload + E + Single + Optional + + + + + + + Group Dancing Program Control + E + Single + Optional + + + + + + + Navigation Map Download + E + Single + Optional + + + + + + + Route list Execution + E + Single + Optional + + + + + + + Route list Upload + E + Single + Optional + + + + + + + Route list Download + E + Single + Optional + + + + + + + Automatic Navigation Control + E + Single + Optional + + + + + + + Manual Navigation + E + Single + Optional + + + + + + + Moving to Charging Station + E + Single + Optional + + + + + + + Moving to Specified location + E + Single + Optional + + + + + + + Low Frequency Patrol Broadcasting + E + Single + Optional + + + + + + + Task Start + E + Single + Optional + + + + + + + Task Stop + E + Single + Optional + + + + + + + Task Suspend + E + Single + Optional + + + + + + + Task Resume + E + Single + Optional + + + + + + + Video Upload + E + Single + Optional + + + + + + + Picture Upload + E + Single + Optional + + + + + + + Default Language Switching + E + Single + Optional + + + + + + + Intonation Change + E + Single + Optional + + + + + + + Intonation Change + E + Single + Optional + + + + + + + Speaking with Action + E + Single + Optional + + + + + + + Collision Detection Control + E + Single + Mandatory + + + + + + + Drop Detection Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10330.xml b/application/src/main/data/lwm2m-registry/10330.xml new file mode 100644 index 0000000000..75c5a2ecdd --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10330.xml @@ -0,0 +1,120 @@ + + + + + + Network Info + + 10330 + urn:oma:lwm2m:x:10330 + 1.0 + 1.0 + Single + Mandatory + + + IMEI + R + Single + Mandatory + String + 15 + + + + + IMSI + R + Single + Mandatory + String + 15 + + + + + Radio Connectivity + R + Single + Mandatory + Objlnk + + + + + + + + GPS Signal Status + R + Single + Optional + Integer + 1..4 + + + + + VBN Connection Status + R + Single + Mandatory + Integer + 0..1 + + + + + HARI Connection Status + R + Single + Mandatory + Integer + 0..1 + + + + + CCU Connection Status + R + Multiple + Optional + Integer + 0..1 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10331.xml b/application/src/main/data/lwm2m-registry/10331.xml new file mode 100644 index 0000000000..ca555cc0d9 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10331.xml @@ -0,0 +1,221 @@ + + + + + + Robot Service Info + + 10331 + urn:oma:lwm2m:x:10331 + 1.0 + 1.0 + Single + Mandatory + + + Current status + R + Single + Mandatory + String + 0..127 + + + + + Services Providing + R + Single + Optional + String + 0..127 + + + + + Advertising Contents + R + Single + Mandatory + String + + + + + + Current Language + R + Single + Optional + String + 0..127 + + + + + Volume + R + Single + Optional + String + 0..100 + /100 + + + + Moving Status + R + Single + Optional + Integer + 0..2 + + + + + Moving Speed + R + Single + Optional + Float + + m/h + + + + Location + R + Single + Optional + Objlnk + + + + + + + + Map List + R + Single + Optional + String + + + + + + Planned Route list + R + Single + Optional + String + + + + + + Current Route + R + Single + Optional + String + + + + + + Route to-do List + R + Single + Optional + String + + + + + + Synchronous Whistle + R + Single + Mandatory + Boolean + + + + + + Current Actions + R + Single + Optional + String + + + + + + ASR Type + R + Single + Optional + Integer + 0..2 + + + + + + TTS Vendor + R + Single + Optional + String + + + + + + TTS Speaker + R + Single + Optional + String + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10332.xml b/application/src/main/data/lwm2m-registry/10332.xml new file mode 100644 index 0000000000..f582373043 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10332.xml @@ -0,0 +1,69 @@ + + + + + + Robot Selfcheck Info + + 10332 + urn:oma:lwm2m:x:10332 + 1.0 + 1.0 + Multiple + Optional + + + Entity + R + Single + Mandatory + String + 4..63 + + + .]]> + + + + Status + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10333.xml b/application/src/main/data/lwm2m-registry/10333.xml new file mode 100644 index 0000000000..aaeb25487d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10333.xml @@ -0,0 +1,88 @@ + + + + + + PM Threshold + + 10333 + urn:oma:lwm2m:x:10333 + 1.0 + 1.0 + Single + Optional + + + Entity + RW + Multiple + Mandatory + String + 4..63 + + .]]> + + + Performance Type + RW + Multiple + Mandatory + String + + + , for example:/10322/2/4]]> + + + High Threshold + RW + Multiple + Mandatory + Float + + + + + + Low Threshold + RW + Multiple + Mandatory + Float + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10334.xml b/application/src/main/data/lwm2m-registry/10334.xml new file mode 100644 index 0000000000..479406630c --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10334.xml @@ -0,0 +1,129 @@ + + + + + + Robot Alarm + + 10334 + urn:oma:lwm2m:x:10334 + 1.0 + 1.0 + Multiple + Optional + + + Entity + R + Single + Mandatory + String + 4..63 + + .]]> + + + Probable Cause + R + Single + Mandatory + Integer + 0..65535 + + + + + Specific Problem + R + Single + Mandatory + String + + + + + + Alarm Type + R + Single + Mandatory + Integer + 2..6 + + + + + Severity + R + Single + Mandatory + Integer + 1..5 + + + + + Report Time + R + Single + Mandatory + Time + + + + + + Sequence No + R + Single + Mandatory + Integer + 0..2^63-1 + + + + + Additional Info + R + Single + Optional + String + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10335.xml b/application/src/main/data/lwm2m-registry/10335.xml new file mode 100644 index 0000000000..91fe8cd9c5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10335.xml @@ -0,0 +1,97 @@ + + + + + + Event + + 10335 + urn:oma:lwm2m:x:10335 + 1.0 + 1.0 + Multiple + Optional + + + Entity + R + Single + Mandatory + String + 4..63 + + .]]> + + + Event Type + R + Single + Mandatory + Integer + 0..65535 + + + + + Time + R + Single + Mandatory + Time + + + + + + Sequence No + R + Single + Mandatory + Integer + 0..2^63-1 + + + + + Additional Info + R + Single + Optional + String + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10336.xml b/application/src/main/data/lwm2m-registry/10336.xml new file mode 100644 index 0000000000..5016e6ee13 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10336.xml @@ -0,0 +1,84 @@ + + + + + + MIC + + 10336 + urn:oma:lwm2m:x:10336 + 1.0 + 1.0 + Single + Optional + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10337.xml b/application/src/main/data/lwm2m-registry/10337.xml new file mode 100644 index 0000000000..6204020400 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10337.xml @@ -0,0 +1,118 @@ + + + + + + SCA + + 10337 + urn:oma:lwm2m:x:10337 + 1.0 + 1.0 + Multiple + Optional + + + SCA Name + R + Single + Mandatory + String + + + + + + + + + + SCA Motion Status + R + Single + Optional + Integer + 0..2 + + + + + + SCA Motion Control + E + Single + Optional + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10338.xml b/application/src/main/data/lwm2m-registry/10338.xml new file mode 100644 index 0000000000..c66df8addf --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10338.xml @@ -0,0 +1,124 @@ + + + + + + Speaker + + 10338 + urn:oma:lwm2m:x:10338 + 1.0 + 1.0 + Single + Optional + + + Speaker status + R + Single + Mandatory + Boolean + + + + + + Voice Warning + R + Single + Mandatory + Boolean + + + + + + + Voice Control + E + Single + Mandatory + + + + + + + Voice Warning Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10339.xml b/application/src/main/data/lwm2m-registry/10339.xml new file mode 100644 index 0000000000..5376de4a6c --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10339.xml @@ -0,0 +1,114 @@ + + + + + + Tripod Head + + 10339 + urn:oma:lwm2m:x:10339 + 1.0 + 1.0 + Single + Optional + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + Tripod Direction Control + E + Single + Optional + + + + + + + Tripod Automatic Control + E + Single + Optional + + + + + + + Tripod Reset + E + Single + Optional + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10340.xml b/application/src/main/data/lwm2m-registry/10340.xml new file mode 100644 index 0000000000..679b46f150 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10340.xml @@ -0,0 +1,218 @@ + + + + + + Camera + + 10340 + urn:oma:lwm2m:x:10340 + 1.0 + 1.0 + Multiple + Optional + + + Camera Name + R + Single + Mandatory + String + + + + + + + + Camera Status + R + Single + Mandatory + Boolean + + + + + + Connection Status + R + Single + Mandatory + Boolean + + + + + + Working Status + R + Single + Mandatory + Integer + 0..15 + + + + + Local Recording + R + Single + Mandatory + Boolean + + + + + + Image Matting + R + Single + Mandatory + Boolean + + + + + + Camera Snapshot + R + Single + Mandatory + Boolean + + + + + + Camera Recording + R + Single + Mandatory + Boolean + + + + + + + Camera Control + E + Single + Mandatory + + + + + + + Local Recording Control + E + Single + Mandatory + + + + + + + Image Matting Control + E + Single + Mandatory + + + + + + + Camera Snapshot Control + E + Single + Mandatory + + + + + + + Camera Recording Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10341.xml b/application/src/main/data/lwm2m-registry/10341.xml new file mode 100644 index 0000000000..c632fd5c57 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10341.xml @@ -0,0 +1,84 @@ + + + + + + GPS + + 10341 + urn:oma:lwm2m:x:10341 + 1.0 + 1.0 + Single + Optional + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10342.xml b/application/src/main/data/lwm2m-registry/10342.xml new file mode 100644 index 0000000000..644bcf9071 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10342.xml @@ -0,0 +1,84 @@ + + + + + + IMU + + 10342 + urn:oma:lwm2m:x:10342 + 1.0 + 1.0 + Single + Optional + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10343.xml b/application/src/main/data/lwm2m-registry/10343.xml new file mode 100644 index 0000000000..a34c80f3a6 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10343.xml @@ -0,0 +1,96 @@ + + + + + + LiDAR + + 10343 + urn:oma:lwm2m:x:10343 + 1.0 + 1.0 + Multiple + Optional + + + LiDAR Name + R + Single + Mandatory + String + + + + + + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10344.xml b/application/src/main/data/lwm2m-registry/10344.xml new file mode 100644 index 0000000000..d28d343ae3 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10344.xml @@ -0,0 +1,96 @@ + + + + + + Arm + + 10344 + urn:oma:lwm2m:x:10344 + 1.0 + 1.0 + Multiple + Optional + + + Arm Name + R + Single + Mandatory + String + + + + + + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10345.xml b/application/src/main/data/lwm2m-registry/10345.xml new file mode 100644 index 0000000000..ad489a7faa --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10345.xml @@ -0,0 +1,96 @@ + + + + + + Leg + + 10345 + urn:oma:lwm2m:x:10345 + 1.0 + 1.0 + Multiple + Optional + + + Leg Name + R + Single + Mandatory + String + + + + + + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10346.xml b/application/src/main/data/lwm2m-registry/10346.xml new file mode 100644 index 0000000000..4ee595e16a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10346.xml @@ -0,0 +1,96 @@ + + + + + + Servomotor + + 10346 + urn:oma:lwm2m:x:10346 + 1.0 + 1.0 + Multiple + Optional + + + Servomotor Name + R + Single + Mandatory + String + + + + + + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10347.xml b/application/src/main/data/lwm2m-registry/10347.xml new file mode 100644 index 0000000000..6c0808ed61 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10347.xml @@ -0,0 +1,154 @@ + + + + + + Screen + + 10347 + urn:oma:lwm2m:x:10347 + 1.0 + 1.0 + Single + Optional + + + Screen Status + R + Single + Mandatory + Boolean + + + + + + Startup Page + R + Single + Optional + String + + + The Startup Page of the screen. + + + Current Displaying Page or Current Screen Play List + R + Single + Optional + String + + + Current Displaying Page or Current Screen Play List. + + + + Screen Control + E + Single + Mandatory + + + + + + + Startup Page Set + E + Single + Mandatory + + + + + + + Screen Page Set + E + Single + Mandatory + + + + + + + Screen Play List Set + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10348.xml b/application/src/main/data/lwm2m-registry/10348.xml new file mode 100644 index 0000000000..76451605f0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10348.xml @@ -0,0 +1,96 @@ + + + + + + Wheel + + 10348 + urn:oma:lwm2m:x:10348 + 1.0 + 1.0 + Multiple + Optional + + + Wheel Name + R + Single + Mandatory + String + + + + + + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10349.xml b/application/src/main/data/lwm2m-registry/10349.xml new file mode 100644 index 0000000000..a4212558c4 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10349.xml @@ -0,0 +1,84 @@ + + + + + + Chassis + + 10349 + urn:oma:lwm2m:x:10349 + 1.0 + 1.0 + Single + Optional + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10350.xml b/application/src/main/data/lwm2m-registry/10350.xml new file mode 100644 index 0000000000..1942cabe0c --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10350.xml @@ -0,0 +1,116 @@ + + + + + + Light + + 10350 + urn:oma:lwm2m:x:10350 + 1.0 + 1.0 + Multiple + Optional + + + Light Name + R + Single + Mandatory + String + + + + + + + + Light Status + R + Single + Mandatory + Boolean + + + + + + + Light Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10351.xml b/application/src/main/data/lwm2m-registry/10351.xml new file mode 100644 index 0000000000..473b440b02 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10351.xml @@ -0,0 +1,79 @@ + + + + + + Door + + 10351 + urn:oma:lwm2m:x:10351 + 1.0 + 1.0 + Multiple + Optional + + + Door Name + R + Single + Mandatory + String + + + + + + + Door Status + R + Single + Mandatory + Boolean + + + + + + + Door Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10352.xml b/application/src/main/data/lwm2m-registry/10352.xml new file mode 100644 index 0000000000..1e7503ef42 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10352.xml @@ -0,0 +1,114 @@ + + + + + + Thermal Imager + + 10352 + urn:oma:lwm2m:x:10352 + 1.0 + 1.0 + Single + Optional + + + + Highest Temperature + R + Single + Mandatory + Float + -100.0..100.0 + Cel + The Highest Temperature of the thermal imager. + + + Lowest Temperature + R + Single + Mandatory + Float + -100.0..100.0 + Cel + The Lowest Temperature of the thermal imager. + + + Average Temperature + R + Single + Mandatory + Float + -100.0..100.0 + Cel + The Average Temperature of the thermal imager. + + + + + diff --git a/application/src/main/data/lwm2m-registry/10353.xml b/application/src/main/data/lwm2m-registry/10353.xml new file mode 100644 index 0000000000..0b6bb56cc4 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10353.xml @@ -0,0 +1,87 @@ + + + + + + Warning Light + + 10353 + urn:oma:lwm2m:x:10353 + 1.0 + 1.0 + Single + Optional + + + Light Status + R + Single + Mandatory + Boolean + + + + + + Light Warning + R + Single + Mandatory + Boolean + + + + + + Light Control + E + Single + Mandatory + + + + + + + Light Warning Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10354.xml b/application/src/main/data/lwm2m-registry/10354.xml new file mode 100644 index 0000000000..60d5fc0050 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10354.xml @@ -0,0 +1,217 @@ + + + + + + APP + + 10354 + urn:oma:lwm2m:x:10354 + 1.0 + 1.0 + Multiple + Mandatory + + + APP Name + RW + Single + Mandatory + String + + + The name of the APP, human readable string. + + + APP Version + RW + Single + Mandatory + String + + + The version of the APP, human readable string. + + + APP Build No + RW + Single + Optional + String + + + The Build No of the APP, human readable string. + + + APP Patch No + RW + Single + Optional + String + + + The Patch No of the APP, human readable string. + + + Package URI + W + Single + Optional + String + 0..255 bytes + + + + + Vendor Name + RW + Single + Optional + String + + + The vendor of the package. + + + Installation Target + RW + Single + Mandatory + Objlnk + + + + + + APP Status + R + Single + Mandatory + Integer + 0..5 + + The Status of the APP, 0:Downloading, 1:Downloaded, 2:Installed, 3:Verified, 4:Activated, 5:Stopped. + + + APP Restart + E + Single + Mandatory + + + + + + + APP Start + E + Single + Mandatory + + + + + + + APP Stop + E + Single + Mandatory + + + + + + + APP Download + E + Single + Mandatory + + + + + + + APP Install + E + Single + Mandatory + + + + + + + APP Uninstall + E + Single + Mandatory + + + + + + + APP Activate + E + Single + Mandatory + + + + + + + APP Deactivate + E + Single + Mandatory + + + + + + + APP Verify + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10355.xml b/application/src/main/data/lwm2m-registry/10355.xml new file mode 100644 index 0000000000..fb38ee2767 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10355.xml @@ -0,0 +1,95 @@ + + + + + + General Info + + 10355 + urn:oma:lwm2m:x:10355 + 1.0 + 1.0 + Single + Optional + + + Robot General Info + R + Single + Mandatory + Objlnk + + + + + + + + RCU General Info + R + Single + Mandatory + Objlnk + + + + + + + + CCU General Info + R + Multiple + Optional + Objlnk + + + + + + + + ECU General Info + R + Multiple + Optional + Objlnk + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10356.xml b/application/src/main/data/lwm2m-registry/10356.xml new file mode 100644 index 0000000000..2e362ce052 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10356.xml @@ -0,0 +1,203 @@ + + + + + + Service Info + + 10356 + urn:oma:lwm2m:x:10356 + 1.0 + 1.0 + Single + Optional + + + Robot Service Info + R + Single + Mandatory + Objlnk + + + + + + + + SCA Info + R + Multiple + Optional + Objlnk + + + + + + + + Speaker Info + R + Single + Optional + Objlnk + + + + + + + + Camera Info + R + Multiple + Optional + Objlnk + + + + + + + + Screen Info + R + Single + Optional + Objlnk + + + + + + + + Light Info + R + Multiple + Optional + Objlnk + + + + + + + + Warning Light Info + R + Single + Optional + Objlnk + + + + + + + + Door Info + R + Multiple + Optional + Objlnk + + + + + + + + Thermal Imager Info + R + Single + Optional + Objlnk + + + + + + + + Compressor Info + R + Multiple + Optional + Objlnk + + + + + + + + Lock Info + R + Multiple + Optional + Objlnk + + + + + + + + Collision Sensor Info + R + Multiple + Optional + Objlnk + + + + + + + + Drop Sensor Info + R + Multiple + Optional + Objlnk + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10357.xml b/application/src/main/data/lwm2m-registry/10357.xml new file mode 100644 index 0000000000..9487b2813d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10357.xml @@ -0,0 +1,95 @@ + + + + + + PM + + 10357 + urn:oma:lwm2m:x:10357 + 1.0 + 1.0 + Single + Optional + + + Robot PM + R + Single + Mandatory + Objlnk + + + + + + + + RCU PM + R + Single + Mandatory + Objlnk + + + + + + + + CCU PM + R + Multiple + Optional + Objlnk + + + + + + + + SCA PM + R + Multiple + Optional + Objlnk + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10358.xml b/application/src/main/data/lwm2m-registry/10358.xml new file mode 100644 index 0000000000..27a3684b22 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10358.xml @@ -0,0 +1,70 @@ + + + + + + Fan PM + + 10358 + urn:oma:lwm2m:x:10358 + 1.0 + 1.0 + Multiple + Optional + + + Fan Name + R + Single + Mandatory + String + + + + + + + + + Fan Speed + R + Single + Optional + Integer + + 1/min + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10359.xml b/application/src/main/data/lwm2m-registry/10359.xml new file mode 100644 index 0000000000..2fc8af9677 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10359.xml @@ -0,0 +1,78 @@ + + + + + + Lock + + 10359 + urn:oma:lwm2m:x:10359 + 1.0 + 1.0 + Multiple + Optional + + + Lock Name + R + Single + Mandatory + String + + + + + + Lock Status + R + Single + Optional + Boolean + + + + + + + Lock Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10360.xml b/application/src/main/data/lwm2m-registry/10360.xml new file mode 100644 index 0000000000..935fea848c --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10360.xml @@ -0,0 +1,70 @@ + + + + + + Ultrasonic Sensor + + 10360 + urn:oma:lwm2m:x:10360 + 1.0 + 1.0 + Multiple + Optional + + + Name + R + Single + Mandatory + String + + + + + + + + + Status + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10361.xml b/application/src/main/data/lwm2m-registry/10361.xml new file mode 100644 index 0000000000..3525647afd --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10361.xml @@ -0,0 +1,92 @@ + + + + + + Collision Sensor + + 10361 + urn:oma:lwm2m:x:10361 + 1.0 + 1.0 + Multiple + Optional + + + Name + R + Single + Mandatory + String + + + + + + + + Status + R + Single + Mandatory + Integer + + + + + + + Collision Detection + R + Single + Optional + Boolean + + + + + + + Collision Detection Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10362.xml b/application/src/main/data/lwm2m-registry/10362.xml new file mode 100644 index 0000000000..8a928e4425 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10362.xml @@ -0,0 +1,91 @@ + + + + + + Drop Sensor + + 10362 + urn:oma:lwm2m:x:10362 + 1.0 + 1.0 + Multiple + Optional + + + Name + R + Single + Mandatory + String + + + + + + + + Status + R + Single + Mandatory + Integer + + + + + + Drop Detection + R + Single + Optional + Boolean + + + + + + + Drop Detection Control + E + Single + Mandatory + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10363.xml b/application/src/main/data/lwm2m-registry/10363.xml new file mode 100644 index 0000000000..ca9d064f2f --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10363.xml @@ -0,0 +1,57 @@ + + + + + + Temperature Sensor + + 10363 + urn:oma:lwm2m:x:10363 + 1.0 + 1.0 + Single + Optional + + + Status + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10364.xml b/application/src/main/data/lwm2m-registry/10364.xml new file mode 100644 index 0000000000..3519665e62 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10364.xml @@ -0,0 +1,57 @@ + + + + + + Humidity Sensor + + 10364 + urn:oma:lwm2m:x:10364 + 1.0 + 1.0 + Single + Optional + + + Status + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10365.xml b/application/src/main/data/lwm2m-registry/10365.xml new file mode 100644 index 0000000000..792844271e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10365.xml @@ -0,0 +1,57 @@ + + + + + + Gas-Dust Sensor + + 10365 + urn:oma:lwm2m:x:10365 + 1.0 + 1.0 + Single + Optional + + + Status + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10366.xml b/application/src/main/data/lwm2m-registry/10366.xml new file mode 100644 index 0000000000..44e94ae51d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10366.xml @@ -0,0 +1,59 @@ + + + + + + Fan + + 10366 + urn:oma:lwm2m:x:10366 + 1.0 + 1.0 + Multiple + Optional + + + Fan Name + R + Single + Mandatory + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10368.xml b/application/src/main/data/lwm2m-registry/10368.xml new file mode 100644 index 0000000000..68d3dd3ee3 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10368.xml @@ -0,0 +1,96 @@ + + + + + + SpringMotor + + 10368 + urn:oma:lwm2m:x:10368 + 1.0 + 1.0 + Multiple + Optional + + + SpringMotor Name + R + Single + Mandatory + String + + + + + + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10369.xml b/application/src/main/data/lwm2m-registry/10369.xml new file mode 100644 index 0000000000..dcf8190bda --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10369.xml @@ -0,0 +1,84 @@ + + + + + + MCU + + 10369 + urn:oma:lwm2m:x:10369 + 1.0 + 1.0 + Single + Optional + + + Host Device Unique ID + R + Single + Optional + String + + + + + + + + Host Device Manufacturer + R + Single + Optional + String + + + + + + + + Host Device Model Number + R + Single + Optional + String + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10371.xml b/application/src/main/data/lwm2m-registry/10371.xml new file mode 100644 index 0000000000..73a4476865 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10371.xml @@ -0,0 +1,85 @@ + + + + + Reboot Status + + 10371 + urn:oma:lwm2m:x:10371 + 1.0 + 1.0 + Single + Optional + + + Reboot State + R + Single + Mandatory + Integer + 0..2 + + + + + Reboot Error Message + R + Single + Mandatory + String + + + + + + Reset Factory State + R + Single + Optional + Integer + 0..3 + + + + + Reset Factory Error Message + R + Single + Optional + String + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10374.xml b/application/src/main/data/lwm2m-registry/10374.xml new file mode 100644 index 0000000000..a51646b95f --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10374.xml @@ -0,0 +1,161 @@ + + + + Modbus Connection + + 10374 + urn:oma:lwm2m:x:10374 + 1.0 + 1.0 + Multiple + Optional + + + Address + RW + Single + Mandatory + String + + + + + + Physical Layer Type + RW + Single + Mandatory + Integer + 0..2 + + + + + Enable + RW + Single + Mandatory + Boolean + + + + + + Baudrate + RW + Single + Optional + Integer + + bit/s + + + + Stop Bits + RW + Single + Optional + Integer + 1..2 + + + + + Parity + RW + Single + Optional + Integer + 0..2 + + + + + Hardware Control Flow Mode + RW + Single + Optional + Integer + 0..2 + + + + + Available RTU Ports + R + Multiple + Optional + String + + + + + + State + R + Single + Mandatory + Integer + 0..4 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10375.xml b/application/src/main/data/lwm2m-registry/10375.xml new file mode 100644 index 0000000000..5818491c51 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10375.xml @@ -0,0 +1,148 @@ + + + + Modbus Register Cluster + + 10375 + urn:oma:lwm2m:x:10375 + 1.0 + 1.0 + Multiple + Optional + + + Connection + RW + Single + Mandatory + Objlnk + + + + + + Register Type + RW + Single + Mandatory + Integer + 1..4 + + + + + Unit ID + RW + Single + Mandatory + Integer + 0..247, 255 + + + + + Starting Register Address + RW + Single + Mandatory + Integer + 0..65535 + + + + + Quantity of Registers + RW + Single + Optional + Integer + 1..2000 + + + + + Values + RW + Multiple + Mandatory + Integer + 0..65535 + + + + + Minimum Measured Values + R + Multiple + Optional + Integer + 0..65535 + + + + + Maximum Measured Values + R + Multiple + Optional + Integer + 0..65535 + + + + + Reset Minimum and Maximum Measured Values + E + Single + Optional + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10376.xml b/application/src/main/data/lwm2m-registry/10376.xml new file mode 100644 index 0000000000..faec95398e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10376.xml @@ -0,0 +1,211 @@ + + + + + Periodic Activity + + + + 10376 + urn:oma:lwm2m:x:10376 + 1.0 + 1.0 + Multiple + Optional + + + Activity Name + R + Single + Mandatory + String + + + + + + + Activity Description + R + Single + Mandatory + String + + + + + + + Activity Settings + RW + Single + Optional + Opaque + + + + + + + Start Mask + RW + Single + Mandatory + String + + + + + + Periodic Interval + RW + Single + Mandatory + Integer + + s + + + + + Run Period + RW + Single + Optional + Integer + + s + + + + + Record + R + Single + Optional + Opaque + + + + + + Record Head Index + R + Single + Optional + Integer + + + + + + + Record Tail Index + R + Single + Optional + Integer + + + + + + + Record Read Index + RW + Single + Optional + Integer + + + + + + + Record Dispatch Start Mask + RW + Single + Optional + String + + + + + + Record Dispatch Interval + RW + Single + Optional + Integer + + s + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10377.xml b/application/src/main/data/lwm2m-registry/10377.xml new file mode 100644 index 0000000000..f46ace72aa --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10377.xml @@ -0,0 +1,251 @@ + + + + + Data Monitoring + + 10377 + urn:oma:lwm2m:x:10377 + 1.0 + 1.0 + Multiple + Optional + + + Monitoring Name + R + Single + Mandatory + String + + + + + + + Monitoring Description + R + Single + Mandatory + String + + + + + + + Monitoring Settings + RW + Single + Optional + Opaque + + + + + + + Data + R + Single + Mandatory + Opaque + + + + + + + Data Sampling Start Mask + RW + Single + Optional + String + + + + + + Data Sampling Interval + RW + Single + Optional + Integer + + s + + + + Data Sampling Run Period + RW + Single + Optional + Integer + + s + + + + Reference A + RW + Single + Mandatory + Opaque + + + + + + + Comparison A + RW + Single + Mandatory + Integer + + + Reference A +2: Data >= Reference A +3: Data < Reference A +4: Data <= Reference A +5: Data equals Reference A +6: Data not equal Reference A +]]> + + + Reference B + RW + Single + Optional + Opaque + + + + + + + Comparison B + RW + Single + Optional + Integer + + + Reference B +2: Data >= Reference B +3: Data < Reference B +4: Data <= Reference B +5: Data equals Reference B +6: Data not equal Reference B +]]> + + + Reference C + RW + Single + Optional + Opaque + + + + + + + Comparison C + RW + Single + Optional + Integer + + + Reference C +2: Data >= Reference C +3: Data < Reference C +4: Data <= Reference C +5: Data equals Reference C +6: Data not equal Reference C +]]> + + + Monitoring Results + RW + Single + Mandatory + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/10378.xml b/application/src/main/data/lwm2m-registry/10378.xml new file mode 100644 index 0000000000..bbd45811d0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/10378.xml @@ -0,0 +1,91 @@ + + + + + Edge Application Server Configuration + + 10378 + urn:oma:lwm2m:x:10378 + 1.0 + 1.0 + Multiple + Optional + + + Application Client ID + RW + Single + Mandatory + String + + + + + + EAS ID + RW + Multiple + Mandatory + String + + + + + + EAS Endpoint + RW + Multiple + Mandatory + String + + + + + + Type + RW + Multiple + Optional + Integer + 1..2 + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/11.xml b/application/src/main/data/lwm2m-registry/11.xml new file mode 100644 index 0000000000..438b2c3df2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/11.xml @@ -0,0 +1,408 @@ + + + + + LWM2M APN Connection Profile + + 11 + urn:oma:lwm2m:oma:11:1.1 + 1.1 + 1.1 + Multiple + Optional + + Profile name + RW + Single + Mandatory + String + + + + + APN + RW + Single + Optional + String + + + + + Auto select APN by device + RW + Single + Optional + Boolean + + + + + Enable status + RW + Single + Optional + Boolean + + + + + Authentication Type + RW + Single + Mandatory + Integer + + + + + User Name + RW + Single + Optional + String + + + + + Secret + RW + Single + Optional + String + + + + + Reconnect Schedule + RW + Single + Optional + String + + + + + Validity (MCC, MNC) + RW + Multiple + Optional + String + + + + + Connection establishment time (1) + R + Multiple + Optional + Time + + + + + Connection establishment result (1) + R + Multiple + Optional + Integer + + + + + + Connection establishment reject cause (1) + R + Multiple + Optional + Integer + 0..111 + + + + Connection end time (1) + R + Multiple + Optional + Time + + + + + TotalBytesSent + R + Single + Optional + Integer + + + + + TotalBytesReceived + R + Single + Optional + Integer + + + + + IP address (2) + RW + Multiple + Optional + String + + + + + Prefix length(2) + RW + Multiple + Optional + String + + + + + Subnet mask (2) + RW + Multiple + Optional + String + + + + + Gateway (2) + RW + Multiple + Optional + String + + + + + Primary DNS address (2) + RW + Multiple + Optional + String + + + + + Secondary DNS address (2) + RW + Multiple + Optional + String + + + + + QCI (3) + R + Single + Optional + Integer + 1..9 + + + + Vendor specific extensions + R + Single + Optional + Objlnk + + + + + TotalPacketsSent + R + Single + Optional + Integer + + + + + PDN Type + RW + Single + Optional + Integer + + + + + + APN Rate Control + R + Single + Optional + Integer + + + + + + Serving PLMN Rate control + RW + Single + Optional + Unsigned Integer + + + + + Uplink Time Unit + RW + Single + Optional + Unsigned Integer + 0..4 + + + + APN Rate Control for Exception Data + R + Single + Optional + Integer + + + + + + APN Exception Data Uplink Time Unit + RW + Single + Optional + Unsigned Integer + 0..4 + + + + Supported RAT Types + RW + Multiple + Optional + Unsigned Integer + + + + + RDS Application ID + RW + Multiple + Optional + String + + + + + RDS Destination Port + RW + Multiple + Optional + Integer + 0..15 + + + + RDS Source Port + RW + Multiple + Optional + Integer + 0..15 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/12.xml b/application/src/main/data/lwm2m-registry/12.xml new file mode 100644 index 0000000000..d4aad43dca --- /dev/null +++ b/application/src/main/data/lwm2m-registry/12.xml @@ -0,0 +1,551 @@ + + + + + + + WLAN connectivity + + 12 + urn:oma:lwm2m:oma:12:1.1 + 1.0 + 1.1 + Multiple + Optional + + Interface name + RW + Single + Mandatory + String + + + + + Enable + RW + Single + Mandatory + Boolean + + + + + Radio Enabled + RW + Single + Optional + Integer + + + + + Status + R + Single + Mandatory + Integer + + + + + BSSID + R + Single + Mandatory + String + 12 + + + + SSID + RW + Single + Mandatory + String + 1..32 + + + + Broadcast SSID + RW + Single + Optional + Boolean + + + + + Beacon Enabled + RW + Single + Optional + Boolean + + + + + Mode + RW + Single + Mandatory + Integer + + + + + Channel + RW + Single + Mandatory + Integer + 0..255 + + + + Auto Channel + RW + Single + Optional + Boolean + + + + + Supported Channels + RW + Multiple + Optional + Integer + + + + + Channels In Use + RW + Multiple + Optional + Integer + + + + + Regulatory Domain + RW + Single + Optional + String + 3 + + + + Standard + RW + Single + Mandatory + Integer + + + + + Authentication Mode + RW + Single + Mandatory + Integer + + + + + Encryption Mode + RW + Single + Optional + Integer + + + + + WPA Pre Shared Key + W + Single + Optional + String + 64 + + + + WPA Key Phrase + W + Single + Optional + String + 1..64 + + + + WEP Encryption Type + RW + Single + Optional + Integer + + + + + WEP Key Index + RW + Single + Optional + Integer + 1..4 + + + + WEP Key Phrase + W + Single + Optional + String + 1..64 + + + + WEP Key 1 + W + Single + Optional + String + 10,26 + + + + WEP Key 2 + W + Single + Optional + String + 10,26 + + + + WEP Key 3 + W + Single + Optional + String + 10,26 + + + + WEP Key 4 + W + Single + Optional + String + 10,26 + + + + RADIUS Server + RW + Single + Optional + String + 1..256 + + + + RADIUS Server Port + RW + Single + Optional + Integer + + + + + RADIUS Secret + W + Single + Optional + String + 1..256 + + + + WMM Supported + R + Single + Optional + Boolean + + + + + WMM Enabled + RW + Single + Optional + Boolean + + + + + MAC Control Enabled + RW + Single + Optional + Boolean + + + + + MAC Address List + RW + Multiple + Optional + String + 12 + + + + Total Bytes Sent + R + Single + Optional + Integer + + + + + Total Bytes Received + R + Single + Optional + Integer + + + + + Total Packets Sent + R + Single + Optional + Integer + + + + + Total Packets Received + R + Single + Optional + Integer + + + + + Transmit Errors + R + Single + Optional + Integer + + + + + Receive Errors + R + Single + Optional + Integer + + + + + Unicast Packets Sent + R + Single + Optional + Integer + + + + + Unicast Packets Received + R + Single + Optional + Integer + + + + + Multicast Packets Sent + R + Single + Optional + Integer + + + + + Multicast Packets Received + R + Single + Optional + Integer + + + + + Broadcast Packets Sent + R + Single + Optional + Integer + + + + + Broadcast Packets Received + R + Single + Optional + Integer + + + + + Discard Packets Sent + R + Single + Optional + Integer + + + + + Discard Packets Received + R + Single + Optional + Integer + + + + + Unknown Packets Received + R + Single + Optional + Integer + + + + + Vendor specific extensions + R + Single + Optional + Objlnk + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/13.xml b/application/src/main/data/lwm2m-registry/13.xml new file mode 100644 index 0000000000..9b30ecd225 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/13.xml @@ -0,0 +1,209 @@ + + + + + LWM2M Bearer Selection + + 13 + urn:oma:lwm2m:oma:13:1.1 + 1.1 + 1.1 + Single + Optional + + Preferred Communications Bearer + RW + Multiple + Optional + Integer + 0..100 + + + + Acceptable RSSI (GSM) + RW + Single + Optional + Integer + -110..-48 + + + + Acceptable RSCP (UMTS) + RW + Single + Optional + Integer + -120..-25 + + + + Acceptable RSRP (LTE) + RW + Single + Optional + Integer + -140..-44 + + + + Acceptable RSSI (1xEV-DO) + RW + Single + Optional + Integer + + + + + Cell lock list + RW + Single + Optional + String + + + + + Operator list + RW + Single + Optional + String + + + + + Operator list mode + RW + Single + Optional + Boolean + + + + + List of available PLMNs + R + Single + Optional + String + + + + + Vendor specific extensions + R + Single + Optional + Objlnk + + + + + Acceptable RSRP (NB-IoT) + RW + Single + Optional + Integer + -158..-44 + + + + Higher Priority PLMN Search Timer + RW + Single + Optional + Integer + + + + + Attach without PDN connection + RW + Single + Optional + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/14.xml b/application/src/main/data/lwm2m-registry/14.xml new file mode 100644 index 0000000000..a1d7f7239f --- /dev/null +++ b/application/src/main/data/lwm2m-registry/14.xml @@ -0,0 +1,139 @@ + + + + + + + LWM2M Software Component + + 14 + urn:oma:lwm2m:oma:14 + 1.0 + 1.0 + Multiple + Optional + + + Component Identity + R + Single + Optional + String + 0..255 bytes + + + + + Component Pack + R + Single + Optional + Opaque + + + + + + Component Version + R + Single + Optional + String + 0..255 bytes + + + + + Activate + E + Single + Optional + + + + + + + Deactivate + E + Single + Optional + + + + + + + Activation State + R + Single + Optional + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/15.xml b/application/src/main/data/lwm2m-registry/15.xml new file mode 100644 index 0000000000..f4363e3f33 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/15.xml @@ -0,0 +1,175 @@ + + + + + + + DevCapMgmt + + 15 + urn:oma:lwm2m:oma:15:2.0 + 1.0 + 2.0 + Multiple + Optional + + Property + R + Single + Mandatory + String + + + + + Group + R + Single + Mandatory + Integer + 0..15 + + + + Description + R + Single + Optional + String + + + + + Attached + R + Single + Optional + Boolean + + + + + Enabled + R + Single + Mandatory + Boolean + + + + + opEnable + E + Single + Mandatory + + + + + + opDisable + E + Single + Mandatory + + + + + + NotifyEn + RW + Single + Optional + Boolean + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/16.xml b/application/src/main/data/lwm2m-registry/16.xml new file mode 100644 index 0000000000..f8f2dc40df --- /dev/null +++ b/application/src/main/data/lwm2m-registry/16.xml @@ -0,0 +1,127 @@ + + + + + + + Portfolio + + 16 + urn:oma:lwm2m:oma:161.0 + 1.0Multiple + Optional + + Identity + RW + Multiple + Mandatory + String + + + + + GetAuthData + E + Single + Optional + + + + + + AuthData + R + Multiple + Optional + Opaque + + + + + AuthStatus + R + Single + Optional + Integer + 0..2 + + + + + + diff --git a/application/src/main/data/lwm2m-registry/18830.xml b/application/src/main/data/lwm2m-registry/18830.xml new file mode 100644 index 0000000000..87e0747d5c --- /dev/null +++ b/application/src/main/data/lwm2m-registry/18830.xml @@ -0,0 +1,173 @@ + + + + MQTT Broker + + 18830 + urn:oma:lwm2m:x:18830 + 1.1 + 1.0 + Multiple + Optional + + + URI + RW + Single + Mandatory + String + + + + + + Client Identifier + RW + Single + Mandatory + String + + + + + + Clean Session + RW + Single + Mandatory + Boolean + + + + + + Keep Alive + RW + Single + Mandatory + Unsigned Integer + 0..65535 + s + + + + User Name + RW + Single + Optional + String + + + + + + Password + RW + Single + Optional + Opaque + 0..65535 + + + + + Security Mode + RW + Single + Mandatory + Integer + 0..4 + + + + + Public Key or Identity + RW + Single + Optional + Opaque + + + + + + MQTT Broker Public Key + RW + Single + Optional + Opaque + + + + + + Secret Key + W + Single + Optional + Opaque + + + + + + Certificate Usage + RW + Single + Optional + Integer + 0..3 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/18831.xml b/application/src/main/data/lwm2m-registry/18831.xml new file mode 100644 index 0000000000..68dc873ed0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/18831.xml @@ -0,0 +1,120 @@ + + + + MQTT Publication + This LwM2M Object is used to configure data reporting over MQTT. + 18831 + urn:oma:lwm2m:x:18831 + 1.1 + 1.0 + Multiple + Optional + + + Source + RW + Single + Mandatory + Corelnk + + + , or ; ). If this Resource is empty, the published data are implementation dependent.]]> + + + Broker + RW + Single + Mandatory + Objlnk + + + + + + Topic + RW + Single + Mandatory + String + + + + + + QoS + RW + Single + Mandatory + Unsigned Integer + 0..2 + + + + + Retain + RW + Single + Mandatory + Boolean + + + + + + Active + RW + Single + Optional + Boolean + + + + + + Encoding + RW + Single + Optional + Unsigned Integer + 0..65535 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/19.xml b/application/src/main/data/lwm2m-registry/19.xml new file mode 100644 index 0000000000..c4f5cbe6ab --- /dev/null +++ b/application/src/main/data/lwm2m-registry/19.xml @@ -0,0 +1,144 @@ + + + + + BinaryAppDataContainer + + 19 + urn:oma:lwm2m:oma:19 + 1.0 + 1.0 + Multiple + Optional + + Data + RW + Multiple + Mandatory + Opaque + + + + + Data Priority + RW + Single + Optional + Integer + 1 bytes + + + + Data Creation Time + RW + Single + Optional + Time + + + + + Data Description + RW + Single + Optional + String + 32 bytes + + + + Data Format + RW + Single + Optional + String + 32 bytes + + + + App ID + RW + Single + Optional + Integer + 2 bytes + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2.xml b/application/src/main/data/lwm2m-registry/2.xml new file mode 100644 index 0000000000..4ea5805b36 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2.xml @@ -0,0 +1,123 @@ + + + + + + + LwM2M Access Control + + 2 + urn:oma:lwm2m:oma:2:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Object ID + R + Single + Mandatory + Integer + 1..65534 + + + + + Object Instance ID + R + Single + Mandatory + Integer + 0..65535 + + + + + ACL + RW + Multiple + Optional + Integer + 0..31 + + + + + Access Control Owner + RW + Single + Mandatory + Integer + 0..65535 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/20.xml b/application/src/main/data/lwm2m-registry/20.xml new file mode 100644 index 0000000000..68aa96048c --- /dev/null +++ b/application/src/main/data/lwm2m-registry/20.xml @@ -0,0 +1,142 @@ + + + + + + + + Event Log + + 20 + urn:oma:lwm2m:oma:20:2.0 + 1.0 + 2.0 + Multiple + Optional + + LogClass + RW + Single + Optional + Integer + 255 + + + + LogStart + E + Single + Optional + + + + + + LogStop + E + Single + Optional + + + + + + LogStatus + R + Single + Optional + Integer + 8-Bits + + + + LogData + R + Single + Mandatory + Opaque + + + + + LogDataFormat + RW + Single + Optional + Integer + 255 + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2048.xml b/application/src/main/data/lwm2m-registry/2048.xml new file mode 100644 index 0000000000..0bc99cffd1 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2048.xml @@ -0,0 +1,90 @@ + + + + + + + CmdhPolicy + + 2048 + urn:oma:lwm2m:ext:20481.0 + 1.0Multiple + Optional + + Name + RW + Single + Mandatory + String + + + + + DefaultRule + RW + Single + Mandatory + Objlnk + + + + + LimiRules + RW + Multiple + Mandatory + Objlnk + + + + + NetworkAccessECRules + RW + Multiple + Mandatory + Objlnk + + + + + BufferRules + RW + Multiple + Mandatory + Objlnk + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2049.xml b/application/src/main/data/lwm2m-registry/2049.xml new file mode 100644 index 0000000000..7509b22160 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2049.xml @@ -0,0 +1,59 @@ + + + + + + + ActiveCmdhPolicy + + 2049 + urn:oma:lwm2m:ext:20491.0 + 1.0Single + Optional + + ActiveLink + RW + Single + Mandatory + Objlnk + + + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2050.xml b/application/src/main/data/lwm2m-registry/2050.xml new file mode 100644 index 0000000000..da27a90de0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2050.xml @@ -0,0 +1,64 @@ + + + + + + + CmdhDefaults + + 2050 + urn:oma:lwm2m:ext:20501.0 + 1.0Multiple + Optional + + DefaultEcRules + RW + Multiple + Mandatory + Objlnk + + + + + + DefaultEcParamRules + RW + Multiple + Mandatory + Objlnk + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2051.xml b/application/src/main/data/lwm2m-registry/2051.xml new file mode 100644 index 0000000000..1f4ecda5d1 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2051.xml @@ -0,0 +1,99 @@ + + + + + + + CmdhDefEcValues + + 2051 + urn:oma:lwm2m:ext:20511.0 + 1.0Multiple + Optional + + Order + RW + Single + Mandatory + Integer + + + + + DefEcValue + RW + Single + Mandatory + String + + + + + RequestOrigin + RW + Multiple + Mandatory + String + + + + + RequestContext + RW + Single + Optional + String + + + + + RequestContextNotification + RW + Single + Optional + Boolean + + + + + RequestCharacteristics + RW + Single + Optional + String + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2052.xml b/application/src/main/data/lwm2m-registry/2052.xml new file mode 100644 index 0000000000..abaae1b54e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2052.xml @@ -0,0 +1,111 @@ + + + + + + + CmdhEcDefParamValues + + 2052 + urn:oma:lwm2m:ext:20521.0 + 1.0Multiple + Optional + + ApplicableEventCategory + RW + Multiple + Mandatory + Integer + + + + + DefaultRequestExpTime + RW + Single + Mandatory + Integer + + ms + + + + + + + + + DefaultResultExpTime + RW + Single + Mandatory + Integer + + ms + + + + DefaultOpExecTime + RW + Single + Mandatory + Integer + + ms + + + DefaultRespPersistence + RW + Single + Mandatory + Integer + + ms + + + DefaultDelAggregation + RW + Single + Mandatory + Integer + + ms + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2053.xml b/application/src/main/data/lwm2m-registry/2053.xml new file mode 100644 index 0000000000..a765a7894a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2053.xml @@ -0,0 +1,165 @@ + + + + + + + CmdhLimits + + 2053 + urn:oma:lwm2m:ext:20531.0 + 1.0Multiple + Optional + + Order + RW + Single + Mandatory + Integer + + + + + RequestOrigin + RW + Multiple + Mandatory + String + + + + + + + + + + + RequestContext + RW + Single + Optional + String + + + + + + RequestContextNotificatio + RW + Single + Optional + Boolean + + + + + RequestCharacteristics + RW + Single + Optional + String + + + + + LimitsEventCategory + RW + Multiple + Mandatory + Integer + + + + + LimitsRequestExpTime + RW + Multiple + Mandatory + Integer + 2 Instances + ms + + + LimitsResultExpTime + RW + Multiple + Mandatory + Integer + 2 Instances + ms + + + LimitsOptExpTime + RW + Multiple + Mandatory + Integer + 2 Instances + ms + + + LimitsRespPersistence + RW + Multiple + Mandatory + Integer + 2 Instances + ms + + + LimitsDelAggregation + RW + Multiple + Mandatory + String + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2054.xml b/application/src/main/data/lwm2m-registry/2054.xml new file mode 100644 index 0000000000..3935fb7253 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2054.xml @@ -0,0 +1,69 @@ + + + + + + + CmdhNetworkAccessRules + + 2054 + urn:oma:lwm2m:ext:20541.0 + 1.0Multiple + Optional + + ApplicableEventCategories + RW + Multiple + Mandatory + Integer + + + + + NetworkAccessRule + RW + Multiple + Optional + Objlnk + + + + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2055.xml b/application/src/main/data/lwm2m-registry/2055.xml new file mode 100644 index 0000000000..cbd0dc5796 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2055.xml @@ -0,0 +1,100 @@ + + + + + + + CmdhNwAccessRule + + 2055 + urn:oma:lwm2m:ext:20551.0 + 1.0Multiple + Optional + + TargetNetwork + RW + Multiple + Mandatory + String + + + + + SpreadingWaitTime + RW + Single + Mandatory + Integer + + ms + + + MinReqVolume + RW + Single + Mandatory + Integer + + B + + + BackOffParameters + RW + Single + Mandatory + Objlnk + + + + + OtherConditions + RW + Single + Mandatory + String + + + + + AllowedSchedule + RW + Multiple + Mandatory + String + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2056.xml b/application/src/main/data/lwm2m-registry/2056.xml new file mode 100644 index 0000000000..ddd50e269a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2056.xml @@ -0,0 +1,77 @@ + + + + + + + CmdhBuffer + + 2056 + urn:oma:lwm2m:ext:20561.0 + 1.0Multiple + Optional + + ApplicableEventCategory + RW + Multiple + Mandatory + Integer + + + + + MaxBufferSize + RW + Single + Mandatory + Integer + + B + + + StoragePriority + RW + Single + Mandatory + Integer + 1..10 + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/2057.xml b/application/src/main/data/lwm2m-registry/2057.xml new file mode 100644 index 0000000000..68d4bcd135 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/2057.xml @@ -0,0 +1,92 @@ + + + + + + + CmdhBackOffParametersSet + + 2057 + urn:oma:lwm2m:ext:2057 + 1.0 + 1.0 + Multiple + Optional + + NetworkAction + RW + Single + Optional + Integer + 1..5 + + + + InitialBackoffTime + RW + Single + Mandatory + Integer + + ms + + + AdditionalBackoffTime + RW + Single + Mandatory + Integer + + ms + + + MaximumBackoffTime + RW + Single + Mandatory + Integer + + ms + + + OptionalRandomBackoffTime + RW + Multiple + Optional + Integer + + ms + + + + + diff --git a/application/src/main/data/lwm2m-registry/21.xml b/application/src/main/data/lwm2m-registry/21.xml new file mode 100644 index 0000000000..5685648bad --- /dev/null +++ b/application/src/main/data/lwm2m-registry/21.xml @@ -0,0 +1,132 @@ + + + + + + + LWM2M OSCORE + + 21 + urn:oma:lwm2m:oma:21:2.0 + 1.1 + 2.0 + Multiple + Optional + + OSCORE Master Secret + + Single + Mandatory + Opaque + + + + + OSCORE Sender ID + + Single + Mandatory + Opaque + + + + + OSCORE Recipient ID + + Single + Mandatory + Opaque + + + + + OSCORE AEAD Algorithm + + Single + Optional + Integer + + + + + OSCORE HMAC Algorithm + + Single + Optional + Integer + + + + + OSCORE Master Salt + + Single + Optional + Opaque + + + + + OSCORE ID Context + + Single + Optional + Opaque + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/22.xml b/application/src/main/data/lwm2m-registry/22.xml new file mode 100644 index 0000000000..02fed409ae --- /dev/null +++ b/application/src/main/data/lwm2m-registry/22.xml @@ -0,0 +1,157 @@ + + + + + + + Virtual Observe Notify + + 22 + urn:oma:lwm2m:oma:22:1.1 + 1.1 + 1.1 + Multiple + Optional + + + ObserveLinks + RW + Multiple + Mandatory + Corelnk + + + + + + Report + R + Single + Mandatory + String + + + + + + ResourceFilter + RW + Single + Optional + Boolean + + + + + + ReportLinks + RW + Multiple + Optional + Corelnk + + + + + + ObserveRelation + RW + Single + Optional + Integer + + + + + + Virtual Observe Report Format + RW + Single + Optional + Integer + + + + + + Virtual Observe Report + R + Single + Optional + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/23.xml b/application/src/main/data/lwm2m-registry/23.xml new file mode 100644 index 0000000000..55db80cc77 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/23.xml @@ -0,0 +1,100 @@ + + + + + + + LwM2M COSE + + 23 + urn:oma:lwm2m:oma:23 + 1.2 + 1.0 + Multiple + Optional + + KID + + Single + Mandatory + String + + + + + AEAD Algorithm + + Single + Mandatory + Integer + + + + + Key + + Single + Mandatory + String + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/24.xml b/application/src/main/data/lwm2m-registry/24.xml new file mode 100644 index 0000000000..7dd6942646 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/24.xml @@ -0,0 +1,163 @@ + + + + + + MQTT Server + + 24 + urn:oma:lwm2m:oma:24 + 1.2 + 1.0 + Multiple + Optional + + + Will Retain + RW + Single + Optional + Boolean + + + + + + Will Topic + RW + Single + Optional + String + + + + + + Will Message + RW + Single + Optional + String + + + + + + Clean Session + RW + Single + Optional + Boolean + + + + + + Will QoS + RW + Single + Optional + Unsigned Integer + 0..3 + + + + + Keep Alive + RW + Single + Optional + Unsigned Integer + 0..65535 + + + + + Client Identifier + RW + Single + Mandatory + String + + + + + + User Name + RW + Single + Optional + String + + + + + + Password + RW + Single + Optional + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/25.xml b/application/src/main/data/lwm2m-registry/25.xml new file mode 100644 index 0000000000..5ab62b3c36 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/25.xml @@ -0,0 +1,104 @@ + + + + + + LwM2M Gateway + + 25 + urn:oma:lwm2m:oma:25:2.0 + 1.1 + 2.0 + Multiple + Optional + + + Device ID + R + Single + Mandatory + String + + + + + + Prefix + R + Single + Mandatory + String + + + + + + IoT Device Objects + R + Single + Mandatory + Corelnk + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/26.xml b/application/src/main/data/lwm2m-registry/26.xml new file mode 100644 index 0000000000..0f77aad973 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/26.xml @@ -0,0 +1,93 @@ + + + + + + LwM2M Gateway Routing + + 26 + urn:oma:lwm2m:oma:26 + 1.2 + 1.0 + Multiple + Optional + + + LwM2M Object ID + R + Single + Mandatory + Unsigned Integer + + + + + + Mapping Info + R + Single + Mandatory + Corelnk + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/27.xml b/application/src/main/data/lwm2m-registry/27.xml new file mode 100644 index 0000000000..9f30947997 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/27.xml @@ -0,0 +1,322 @@ + + + + + + 5GNR Connectivity + + 27 + urn:oma:lwm2m:oma:27 + 1.2 + 1.0 + Multiple + Optional + + + Connectivity Option + R + Single + Mandatory + Integer + + + + + + NR Band Support available + R + Multiple + Optional + Integer + + + + + + NR Band attached + R + Multiple + Optional + Integer + + + + + + S-NSSAI + R + Multiple + Optional + Integer + + + + + + DNN Name + R + Single + Optional + String + + + + + + PDU Session Id + R + Single + Optional + Integer + 1...15 + + + + + SSC Mode + R + Single + Optional + Integer + 1...3 + + + + + PDU Session Type + R + Single + Optional + Integer + + + + + + 5QI + R + Single + Optional + Integer + + + + + + SDAP Enablement + R + Single + Optional + Integer + + + + + + QFI + R + Single + Optional + Integer + 1...63 + + + + + Session AMBR + R + Single + Optional + Integer + 1...25 + + + + + APN-AMBR + R + Single + Optional + Integer + + dB + + + + NAS Reflective QOS + R + Single + Optional + Boolean + + + + + + Access Stratum Reflective QoS + R + Single + Optional + Boolean + + + + + + P-CSCF Address Index + R + Single + Optional + Integer + + + + + + PDU session Authentication + R + Single + Optional + Integer + + + + + + PLMN ID + R + Single + Optional + String + + + + + + LADN Support + R + Single + Optional + Boolean + + + + + + Integrity Protection on DRB + R + Single + Optional + Integer + + + + + + Access type Preference + R + Single + Optional + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/28.xml b/application/src/main/data/lwm2m-registry/28.xml new file mode 100644 index 0000000000..8edd51bcc5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/28.xml @@ -0,0 +1,150 @@ + + + + + + + Device RF Capabilities + + 28 + urn:oma:lwm2m:oma:28 + 1.1 + 1.0 + Single + Optional + + + Supported LTE Band Information + R + Single + Optional + Integer + + + + + + Supported EGPRS Band Information + R + Single + Optional + Integer + + + + + + Supported TD-SCDMA Band Information + R + Single + Optional + Integer + + + + + + Supported WCDMA Band Information + R + Single + Optional + Integer + + + + + + Supported CDMA-2000 Band Information + R + Single + Optional + Integer + + + + + + Supported WiMAX Band Information + R + Single + Optional + Integer + + + + + + Supported NB-IoT Band Information + R + Single + Optional + Integer + + + + + + Supported 5G Band Information + R + Single + Optional + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3.xml b/application/src/main/data/lwm2m-registry/3.xml new file mode 100644 index 0000000000..cb360acd10 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3.xml @@ -0,0 +1,331 @@ + + + + + + + Device + + 3 + urn:oma:lwm2m:oma:3:1.2 + 1.1 + 1.2 + Single + Mandatory + + + Manufacturer + R + Single + Optional + String + + + + + + Model Number + R + Single + Optional + String + + + + + + Serial Number + R + Single + Optional + String + + + + + + Firmware Version + R + Single + Optional + String + + + + + + Reboot + E + Single + Mandatory + + + + + + + Factory Reset + E + Single + Optional + + + + + + + Available Power Sources + R + Multiple + Optional + Integer + 0..7 + + + + + Power Source Voltage + R + Multiple + Optional + Integer + + + + + + Power Source Current + R + Multiple + Optional + Integer + + + + + + Battery Level + R + Single + Optional + Integer + 0..100 + /100 + + + + Memory Free + R + Single + Optional + Integer + + + + + + Error Code + R + Multiple + Mandatory + Integer + 0..32 + + + + + Reset Error Code + E + Single + Optional + + + + + + + Current Time + RW + Single + Optional + Time + + + + + + UTC Offset + RW + Single + Optional + String + + + + + + Timezone + RW + Single + Optional + String + + + + + + Supported Binding and Modes + R + Single + Mandatory + String + + + + + Device Type + R + Single + Optional + String + + + + + Hardware Version + R + Single + Optional + String + + + + + Software Version + R + Single + Optional + String + + + + + Battery Status + R + Single + Optional + Integer + 0..6 + + + + Memory Total + R + Single + Optional + Integer + + + + + ExtDevInfo + R + Multiple + Optional + Objlnk + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3200.xml b/application/src/main/data/lwm2m-registry/3200.xml new file mode 100644 index 0000000000..6a6310b5bb --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3200.xml @@ -0,0 +1,148 @@ + + + + + + + Digital Input + Generic digital input for non-specific sensors + 3200 + urn:oma:lwm2m:ext:3200:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Digital Input State + R + Single + Mandatory + Boolean + + + The current state of a digital input. + + + Digital Input Counter + R + Single + Optional + Integer + + + The cumulative value of active state detected. + + + Digital Input Polarity + RW + Single + Optional + Boolean + + + The polarity of the digital input as a Boolean (False = Normal, True = Reversed). + + + Digital Input Debounce + RW + Single + Optional + Integer + + ms + The debounce period in ms. + + + Digital Input Edge Selection + RW + Single + Optional + Integer + 1..3 + + The edge selection as an integer (1 = Falling edge, 2 = Rising edge, 3 = Both Rising and Falling edge). + + + Digital Input Counter Reset + E + Single + Optional + + + + Reset the Counter value. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Sensor Type + R + Single + Optional + String + + + The type of the sensor (for instance PIR type). + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3201.xml b/application/src/main/data/lwm2m-registry/3201.xml new file mode 100644 index 0000000000..b950077387 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3201.xml @@ -0,0 +1,98 @@ + + + + + + + Digital Output + Generic digital output for non-specific actuators + 3201 + urn:oma:lwm2m:ext:3201:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Digital Output State + RW + Single + Mandatory + Boolean + + + The current state of a digital output. + + + Digital Output Polarity + RW + Single + Optional + Boolean + + + The polarity of the digital output as a Boolean (False = Normal, True = Reversed). + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3202.xml b/application/src/main/data/lwm2m-registry/3202.xml new file mode 100644 index 0000000000..7814f6ccf9 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3202.xml @@ -0,0 +1,168 @@ + + + + + + + Analog Input + Generic analog input for non-specific sensors + 3202 + urn:oma:lwm2m:ext:3202:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Analog Input Current Value + R + Single + Mandatory + Float + + + The current value of the analog input. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Sensor Type + R + Single + Optional + String + + + The type of the sensor (for instance PIR type). + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3203.xml b/application/src/main/data/lwm2m-registry/3203.xml new file mode 100644 index 0000000000..0316e920a5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3203.xml @@ -0,0 +1,108 @@ + + + + + + + Analog Output + This IPSO object is a generic object that can be used with any kind of analog output interface. + 3203 + urn:oma:lwm2m:ext:3203:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Analog Output Current Value + RW + Single + Mandatory + Float + 0..1 + + The current value of the analog output. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3300.xml b/application/src/main/data/lwm2m-registry/3300.xml new file mode 100644 index 0000000000..f7a5b8a3e2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3300.xml @@ -0,0 +1,178 @@ + + + + + + + Generic Sensor + This IPSO object allows the description of a generic sensor. It is based on the description of a value and a unit according to the SenML specification. Thus, any type of value defined within this specification can be reported using this object. This object may be used as a generic object if a dedicated one does not exist. + 3300 + urn:oma:lwm2m:ext:3300:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Sensor Type + R + Single + Optional + String + + + The type of the sensor (for instance PIR type). + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3301.xml b/application/src/main/data/lwm2m-registry/3301.xml new file mode 100644 index 0000000000..6604464f20 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3301.xml @@ -0,0 +1,168 @@ + + + + + + + Illuminance + Illuminance sensor, example units = lx + 3301 + urn:oma:lwm2m:ext:3301:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3302.xml b/application/src/main/data/lwm2m-registry/3302.xml new file mode 100644 index 0000000000..fe9e886408 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3302.xml @@ -0,0 +1,158 @@ + + + + + + + Presence + Presence sensor with digital sensing, optional delay parameters + 3302 + urn:oma:lwm2m:ext:3302:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Digital Input State + R + Single + Mandatory + Boolean + + + The current state of a digital input. + + + Digital Input Counter + R + Single + Optional + Integer + + + The cumulative value of active state detected. + + + Digital Input Counter Reset + E + Single + Optional + + + + Reset the Counter value. + + + Sensor Type + R + Single + Optional + String + + + The type of the sensor (for instance PIR type). + + + Busy to Clear delay + RW + Single + Optional + Integer + + ms + Delay from the detection state to the clear state in ms. + + + Clear to Busy delay + RW + Single + Optional + Integer + + ms + Delay from the clear state to the busy state in ms. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3303.xml b/application/src/main/data/lwm2m-registry/3303.xml new file mode 100644 index 0000000000..2db5da74c8 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3303.xml @@ -0,0 +1,168 @@ + + + + + + + Temperature + This IPSO object should be used with a temperature sensor to report a temperature measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the temperature sensor. An example measurement unit is degrees Celsius. + 3303 + urn:oma:lwm2m:ext:3303:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3304.xml b/application/src/main/data/lwm2m-registry/3304.xml new file mode 100644 index 0000000000..7331c5f83a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3304.xml @@ -0,0 +1,168 @@ + + + + + + + Humidity + This IPSO object should be used with a humidity sensor to report a humidity measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the humidity sensor. An example measurement unit is relative humidity as a percentage. + 3304 + urn:oma:lwm2m:ext:3304:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3305.xml b/application/src/main/data/lwm2m-registry/3305.xml new file mode 100644 index 0000000000..f927a44a59 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3305.xml @@ -0,0 +1,278 @@ + + + + + + + Power Measurement + This IPSO object should be used over a power measurement sensor to report a remote power measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range for both active and reactive power. It also provides resources for cumulative energy, calibration, and the power factor. + 3305 + urn:oma:lwm2m:ext:3305:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Instantaneous active power + R + Single + Mandatory + Float + + W + The current active power. + + + Min Measured active power + R + Single + Optional + Float + + W + The minimum active power measured by the sensor since it is ON. + + + Max Measured active power + R + Single + Optional + Float + + W + The maximum active power measured by the sensor since it is ON. + + + Min Range active power + R + Single + Optional + Float + + W + The minimum active power that can be measured by the sensor. + + + Max Range active power + R + Single + Optional + Float + + W + The maximum active power that can be measured by the sensor. + + + Cumulative active power + R + Single + Optional + Float + + Wh + The cumulative active power since the last cumulative energy reset or device start. + + + Active Power Calibration + W + Single + Optional + Float + + W + Request an active power calibration by writing the value of a calibrated load. + + + Instantaneous reactive power + R + Single + Optional + Float + + var + The current reactive power. + + + Min Measured reactive power + R + Single + Optional + Float + + var + The minimum reactive power measured by the sensor since it is ON. + + + Max Measured reactive power + R + Single + Optional + Float + + var + The maximum reactive power measured by the sensor since it is ON. + + + Min Range reactive power + R + Single + Optional + Float + + var + The minimum active power that can be measured by the sensor. + + + Max Range reactive power + R + Single + Optional + Float + + var + The maximum reactive power that can be measured by the sensor. + + + Cumulative reactive power + R + Single + Optional + Float + + varh + The cumulative reactive power since the last cumulative energy reset or device start. + + + Reactive Power Calibration + W + Single + Optional + Float + + var + Request a reactive power calibration by writing the value of a calibrated load. + + + Power factor + R + Single + Optional + Float + + + If applicable, the power factor of the current consumption. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Reset Cumulative energy + E + Single + Optional + + + + Reset both cumulative active/reactive power. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3306.xml b/application/src/main/data/lwm2m-registry/3306.xml new file mode 100644 index 0000000000..748bc0f005 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3306.xml @@ -0,0 +1,118 @@ + + + + + + + Actuation + This IPSO object is dedicated to remote actuation such as ON/OFF action or dimming. A multi-state output can also be described as a string. This is useful to send pilot wire orders for instance. It also provides a resource to reflect the time that the device has been switched on. + 3306 + urn:oma:lwm2m:ext:3306:1.1 + 1.0 + 1.1 + Multiple + Optional + + + On/Off + RW + Single + Mandatory + Boolean + + + On/off control. Boolean value where True is On and False is Off. + + + Dimmer + RW + Single + Optional + Integer + 0..100 + /100 + This resource represents a dimmer setting, which has an Integer value between 0 and 100 as a percentage. + + + On time + RW + Single + Optional + Integer + + s + The time in seconds that the device has been on. Writing a value of 0 resets the counter. + + + Multi-state Output + RW + Single + Optional + String + + + A string describing a state for multiple level output such as Pilot Wire. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3308.xml b/application/src/main/data/lwm2m-registry/3308.xml new file mode 100644 index 0000000000..f1d5c18f12 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3308.xml @@ -0,0 +1,108 @@ + + + + + + + Set Point + This IPSO object should be used to set a desired value to a controller, such as a thermostat. A special resource is added to set the colour of an object. + 3308 + urn:oma:lwm2m:ext:3308:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Set Point Value + RW + Single + Mandatory + Float + + + The setpoint value. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Colour + RW + Single + Optional + String + + + A string representing a value in some color space. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3310.xml b/application/src/main/data/lwm2m-registry/3310.xml new file mode 100644 index 0000000000..6b4e04d6b6 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3310.xml @@ -0,0 +1,138 @@ + + + + + + + Load Control + This Object is used for demand-response load control and other load control in automation application (not limited to power). + 3310 + urn:oma:lwm2m:ext:3310:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Event Identifier + RW + Single + Mandatory + String + + + The event identifier as a string. + + + Start Time + RW + Single + Mandatory + Time + + + Time when the event started. + + + Duration In Min + RW + Single + Mandatory + Integer + + min + The duration of the event in minutes. + + + Criticality Level + RW + Single + Optional + Integer + 0..3 + + The criticality of the event. The device receiving the event will react in an appropriate fashion for the device. + + + Avg Load AdjPct + RW + Single + Optional + Integer + 0..100 + /100 + Defines the maximum energy usage of the receiving device, as a percentage of the device's normal maximum energy usage. + + + Duty Cycle + RW + Single + Optional + Integer + 0..100 + /100 + Defines the duty cycle for the load control event, i.e, what percentage of time the receiving device is allowed to be on. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3311.xml b/application/src/main/data/lwm2m-registry/3311.xml new file mode 100644 index 0000000000..4c98be2522 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3311.xml @@ -0,0 +1,127 @@ + + + + + + Light Control + This Object is used to control a light source, such as a LED or other light. It allows a light to be turned on or off and its dimmer setting to be control as a % between 0 and 100. An optional colour setting enables a string to be used to indicate the desired colour. + 3311 + urn:oma:lwm2m:ext:3311 + 1.0 + 1.0 + Multiple + Optional + + + On/Off + RW + Single + Mandatory + Boolean + + + On/off control. Boolean value where True is On and False is Off. + + + Dimmer + RW + Single + Optional + Integer + 0..100 + /100 + This resource represents a dimmer setting, which has an Integer value between 0 and 100 as a percentage. + + + On time + RW + Single + Optional + Integer + + s + The time in seconds that the device has been on. Writing a value of 0 resets the counter. + + + Cumulative active power + R + Single + Optional + Float + + Wh + The cumulative active power since the last cumulative energy reset or device start. + + + Power factor + R + Single + Optional + Float + + + If applicable, the power factor of the current consumption. + + + Colour + RW + Single + Optional + String + + + A string representing a value in some color space. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3312.xml b/application/src/main/data/lwm2m-registry/3312.xml new file mode 100644 index 0000000000..17bd0312db --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3312.xml @@ -0,0 +1,127 @@ + + + + + + Power Control + This Object is used to control a power source, such as a Smart Plug. It allows a power relay to be turned on or off and its dimmer setting to be control as a % between 0 and 100. + 3312 + urn:oma:lwm2m:ext:3312:1.1 + 1.0 + 1.1 + Multiple + Optional + + + On/Off + RW + Single + Mandatory + Boolean + + + On/off control. Boolean value where True is On and False is Off. + + + Dimmer + RW + Single + Optional + Integer + 0..100 + /100 + This resource represents a dimmer setting, which has an Integer value between 0 and 100 as a percentage. + + + On time + RW + Single + Optional + Integer + + s + The time in seconds that the device has been on. Writing a value of 0 resets the counter. + + + Cumulative active power + R + Single + Optional + Float + + Wh + The cumulative active power since the last cumulative energy reset or device start. + + + Power factor + R + Single + Optional + Float + + + If applicable, the power factor of the current consumption. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3313.xml b/application/src/main/data/lwm2m-registry/3313.xml new file mode 100644 index 0000000000..43d0d63b88 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3313.xml @@ -0,0 +1,157 @@ + + + + + + Accelerometer + This IPSO object can be used to represent a 1-3 axis accelerometer. + 3313 + urn:oma:lwm2m:ext:3313:1.1 + 1.0 + 1.1 + Multiple + Optional + + + X Value + R + Single + Mandatory + Float + + + The measured value along the X axis. + + + Y Value + R + Single + Optional + Float + + + The measured value along the Y axis. + + + Z Value + R + Single + Optional + Float + + + The measured value along the Z axis. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3314.xml b/application/src/main/data/lwm2m-registry/3314.xml new file mode 100644 index 0000000000..96ebc5a537 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3314.xml @@ -0,0 +1,147 @@ + + + + + + Magnetometer + This IPSO object can be used to represent a 1-3 axis magnetometer with optional compass direction. + 3314 + urn:oma:lwm2m:ext:3314:1.1 + 1.0 + 1.1 + Multiple + Optional + + + X Value + R + Single + Mandatory + Float + + + The measured value along the X axis. + + + Y Value + R + Single + Optional + Float + + + The measured value along the Y axis. + + + Z Value + R + Single + Optional + Float + + + The measured value along the Z axis. + + + Compass Direction + R + Single + Optional + Float + 0..360 + deg + The measured compass direction. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3315.xml b/application/src/main/data/lwm2m-registry/3315.xml new file mode 100644 index 0000000000..d54a09edd8 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3315.xml @@ -0,0 +1,168 @@ + + + + + + + Barometer + This IPSO object should be used with an air pressure sensor to report a barometer measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the barometer sensor. An example measurement unit is pascals. + 3315 + urn:oma:lwm2m:ext:3315:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3316.xml b/application/src/main/data/lwm2m-registry/3316.xml new file mode 100644 index 0000000000..16a20a219a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3316.xml @@ -0,0 +1,179 @@ + + + + + + + Voltage + This IPSO object should be used with voltmeter sensor to report measured voltage between two points. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is volts. + + 3316 + urn:oma:lwm2m:ext:3316:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3317.xml b/application/src/main/data/lwm2m-registry/3317.xml new file mode 100644 index 0000000000..9d41da70de --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3317.xml @@ -0,0 +1,179 @@ + + + + + + + Current + This IPSO object should be used with an ammeter to report measured electric current in amperes. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is ampere. + + 3317 + urn:oma:lwm2m:ext:3317:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3318.xml b/application/src/main/data/lwm2m-registry/3318.xml new file mode 100644 index 0000000000..957b593c89 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3318.xml @@ -0,0 +1,179 @@ + + + + + + + Frequency + This IPSO object should be used to report frequency measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is hertz. + + 3318 + urn:oma:lwm2m:ext:3318:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3319.xml b/application/src/main/data/lwm2m-registry/3319.xml new file mode 100644 index 0000000000..e3a13ea3ef --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3319.xml @@ -0,0 +1,179 @@ + + + + + + + Depth + This IPSO object should be used to report depth measurements. It can, for example, be used to describe a generic rain gauge that measures the accumulated rainfall in millimetres (mm). + + 3319 + urn:oma:lwm2m:ext:3319:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3320.xml b/application/src/main/data/lwm2m-registry/3320.xml new file mode 100644 index 0000000000..9ec16fb671 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3320.xml @@ -0,0 +1,179 @@ + + + + + + + Percentage + This IPSO object should can be used to report measurements relative to a 0-100% scale. For example it could be used to measure the level of a liquid in a vessel or container in units of %. + + 3320 + urn:oma:lwm2m:ext:3320:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3321.xml b/application/src/main/data/lwm2m-registry/3321.xml new file mode 100644 index 0000000000..e4a1f80bf1 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3321.xml @@ -0,0 +1,179 @@ + + + + + + + Altitude + This IPSO object should be used with an altitude sensor to report altitude above sea level in meters. Note that Altitude can be calculated from the measured pressure given the local sea level pressure. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is meters. + + 3321 + urn:oma:lwm2m:ext:3321:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3322.xml b/application/src/main/data/lwm2m-registry/3322.xml new file mode 100644 index 0000000000..838ed44995 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3322.xml @@ -0,0 +1,179 @@ + + + + + + + Load + This IPSO object should be used with a load sensor (as in a scale) to report the applied weight or force. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is kilograms. + + 3322 + urn:oma:lwm2m:ext:3322:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3323.xml b/application/src/main/data/lwm2m-registry/3323.xml new file mode 100644 index 0000000000..e65c11c123 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3323.xml @@ -0,0 +1,179 @@ + + + + + + + Pressure + This IPSO object should be used to report pressure measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is pascals. + + 3323 + urn:oma:lwm2m:ext:3323:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3324.xml b/application/src/main/data/lwm2m-registry/3324.xml new file mode 100644 index 0000000000..b80d427b91 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3324.xml @@ -0,0 +1,179 @@ + + + + + + + Loudness + This IPSO object should be used to report loudness or noise level measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is decibels. + + 3324 + urn:oma:lwm2m:ext:3324:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3325.xml b/application/src/main/data/lwm2m-registry/3325.xml new file mode 100644 index 0000000000..c0577d64cd --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3325.xml @@ -0,0 +1,179 @@ + + + + + + + Concentration + This IPSO object should be used to the particle concentration measurement of a medium. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is parts per million. + + 3325 + urn:oma:lwm2m:ext:3325:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3326.xml b/application/src/main/data/lwm2m-registry/3326.xml new file mode 100644 index 0000000000..e247637bcf --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3326.xml @@ -0,0 +1,179 @@ + + + + + + + Acidity + This IPSO object should be used to report an acidity measurement of a liquid. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is pH. + + 3326 + urn:oma:lwm2m:ext:3326:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3327.xml b/application/src/main/data/lwm2m-registry/3327.xml new file mode 100644 index 0000000000..9cc689459f --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3327.xml @@ -0,0 +1,179 @@ + + + + + + + Conductivity + This IPSO object should be used to report a measurement of the electric conductivity of a medium or sample. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Siemens. + + 3327 + urn:oma:lwm2m:ext:3327:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3328.xml b/application/src/main/data/lwm2m-registry/3328.xml new file mode 100644 index 0000000000..752ebe0c53 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3328.xml @@ -0,0 +1,179 @@ + + + + + + + Power + This IPSO object should be used to report power measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Watts. This object may be used for either real power or apparent power measurements. + + 3328 + urn:oma:lwm2m:ext:3328:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3329.xml b/application/src/main/data/lwm2m-registry/3329.xml new file mode 100644 index 0000000000..fe221a1564 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3329.xml @@ -0,0 +1,179 @@ + + + + + + + Power Factor + This IPSO object should be used to report a measurement or calculation of the power factor of a reactive electrical load. Power Factor is normally the ratio of non-reactive power to total power. This object also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. + + 3329 + urn:oma:lwm2m:ext:3329:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3330.xml b/application/src/main/data/lwm2m-registry/3330.xml new file mode 100644 index 0000000000..baec2dab14 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3330.xml @@ -0,0 +1,179 @@ + + + + + + + Distance + This IPSO object should be used to report a distance measurement. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Meters. + + 3330 + urn:oma:lwm2m:ext:3330:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3331.xml b/application/src/main/data/lwm2m-registry/3331.xml new file mode 100644 index 0000000000..1094d5bf31 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3331.xml @@ -0,0 +1,129 @@ + + + + + + + Energy + This IPSO object should be used to report energy consumption (Cumulative Power) of an electrical load. An example measurement unit is Watt Hours. + + 3331 + urn:oma:lwm2m:ext:3331:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Reset Cumulative energy + E + Single + Optional + + + + Reset both cumulative active/reactive power. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3332.xml b/application/src/main/data/lwm2m-registry/3332.xml new file mode 100644 index 0000000000..d4026e9558 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3332.xml @@ -0,0 +1,139 @@ + + + + + + + Direction + This IPSO object is used to report the direction indicated by a compass, wind vane, or other directional indicator. The units of measure is plane angle degrees. + + 3332 + urn:oma:lwm2m:ext:3332:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Compass Direction + R + Single + Mandatory + Float + 0..360 + deg + The measured compass direction. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3333.xml b/application/src/main/data/lwm2m-registry/3333.xml new file mode 100644 index 0000000000..1fc7117482 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3333.xml @@ -0,0 +1,98 @@ + + + + + + Time + This IPSO object is used to report the current time in seconds since January 1, 1970 UTC. There is also a fractional time counter that has a range of less than one second. + + 3333 + urn:oma:lwm2m:ext:3333:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Current Time + RW + Single + Mandatory + Time + + + Unix Time. A signed integer representing the number of seconds since Jan 1st, 1970 in the UTC time zone. + + + Fractional Time + RW + Single + Optional + Float + 0..1 + s + Fractional part of the time when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3334.xml b/application/src/main/data/lwm2m-registry/3334.xml new file mode 100644 index 0000000000..4ff3e6c6a6 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3334.xml @@ -0,0 +1,229 @@ + + + + + + + Gyrometer + This IPSO Object is used to report the current reading of a gyrometer sensor in 3 axes. It provides tracking of the minimum and maximum angular rate in all 3 axes. An example unit of measure is radians per second. + + 3334 + urn:oma:lwm2m:ext:3334:1.1 + 1.0 + 1.1 + Multiple + Optional + + + X Value + R + Single + Mandatory + Float + + + The measured value along the X axis. + + + Y Value + R + Single + Optional + Float + + + The measured value along the Y axis. + + + Z Value + R + Single + Optional + Float + + + The measured value along the Z axis. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min X Value + R + Single + Optional + Float + + + The minimum measured value along the X axis. + + + Max X Value + R + Single + Optional + Float + + + The maximum measured value along the X axis. + + + Min Y Value + R + Single + Optional + Float + + + The minimum measured value along the Y axis. + + + Max Y Value + R + Single + Optional + Float + + + The maximum measured value along the Y axis. + + + Min Z Value + R + Single + Optional + Float + + + The minimum measured value along the Z axis. + + + Max Z Value + R + Single + Optional + Float + + + The maximum measured value along the Z axis. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3335.xml b/application/src/main/data/lwm2m-registry/3335.xml new file mode 100644 index 0000000000..9f608653f5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3335.xml @@ -0,0 +1,119 @@ + + + + + + + Colour + This IPSO object should be used to report the measured value of a colour sensor in some colour space described by the units resource. + + 3335 + urn:oma:lwm2m:ext:3335:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Colour + RW + Single + Mandatory + String + + + A string representing a value in some color space. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3336.xml b/application/src/main/data/lwm2m-registry/3336.xml new file mode 100644 index 0000000000..68fea3b90e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3336.xml @@ -0,0 +1,149 @@ + + + + + + + Location + This IPSO object represents GPS coordinates. This object is compatible with the LwM2M management object for location, but uses reusable resources. + + 3336 + urn:oma:lwm2m:ext:3336:2.0 + 1.0 + 2.0 + Multiple + Optional + + + Numeric Latitude + R + Single + Mandatory + Float + + lat + The decimal notation of latitude, e.g. -43.5723 (World Geodetic System 1984). + + + Numeric Longitude + R + Single + Mandatory + Float + + lon + The decimal notation of longitude, e.g. 153.21760 (World Geodetic System 1984). + + + Numeric Uncertainty + R + Single + Optional + Float + + m + The accuracy of the position in meters. + + + Compass Direction + R + Single + Optional + Float + 0..360 + deg + The measured compass direction. + + + Velocity + R + Single + Optional + Opaque + + + The velocity of the device as defined in 3GPP 23.032 GAD specification. This set of values may not be available if the device is static. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3337.xml b/application/src/main/data/lwm2m-registry/3337.xml new file mode 100644 index 0000000000..fa4eefbe81 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3337.xml @@ -0,0 +1,159 @@ + + + + + + + Positioner + This IPSO object should be used with a generic position actuator with range from 0 to 100%. This object optionally allows setting the transition time for an operation that changes the position of the actuator, and for reading the remaining time of the currently active transition. + + 3337 + urn:oma:lwm2m:ext:3337:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Current Position + RW + Single + Mandatory + Float + 0..100 + /100 + Current position or desired position of a positioner actuator. + + + Transition Time + RW + Single + Optional + Float + + s + The time expected to move the actuator to the new position. + + + Remaining Time + R + Single + Optional + Float + + s + The time remaining in an operation. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Min Limit + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Limit + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3338.xml b/application/src/main/data/lwm2m-registry/3338.xml new file mode 100644 index 0000000000..fd1fba3332 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3338.xml @@ -0,0 +1,119 @@ + + + + + + + Buzzer + This IPSO object should be used to actuate an audible alarm such as a buzzer, beeper, or vibration alarm. There is a dimmer control for setting the relative level of the alarm, and an optional duration control to limit the length of time the alarm sounds when turned on. Each time "true" is written to the On/Off resource, the alarm will sound again for the configured duration. If no duration is programmed or the setting is "false", writing a "true" to the On/Off resource will result in the alarm sounding continuously until a "false" is written to the On/Off resource. + + 3338 + urn:oma:lwm2m:ext:3338:1.1 + 1.0 + 1.1 + Multiple + Optional + + + On/Off + RW + Single + Mandatory + Boolean + + + On/off control. Boolean value where True is On and False is Off. + + + Level + RW + Single + Optional + Float + 0..100 + /100 + Used to represent a level control such as audio volume. + + + Delay Duration + RW + Single + Optional + Float + + s + The duration of the time delay. + + + Minimum Off-time + RW + Single + Mandatory + Float + + s + The duration of the rearm delay (i.e. the delay from the end of one cycle until the beginning of the next, the inhibit time). + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3339.xml b/application/src/main/data/lwm2m-registry/3339.xml new file mode 100644 index 0000000000..194685474e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3339.xml @@ -0,0 +1,98 @@ + + + + + + + Audio Clip + This IPSO object should be used for a speaker that plays a pre-recorded audio clip or an audio output that is sent elsewhere. For example, an elevator which announces the floor of the building. A resource is provided to store the clip, a dimmer resource controls the relative sound level of the playback, and a duration resource limits the maximum playback time. After the duration time is reached, any remaining samples in the clip are ignored, and the clip player will be ready to play another clip. + 3339 + urn:oma:lwm2m:ext:3339 + 1.0 + 1.0 + Multiple + Optional + + + Clip + RW + Single + Mandatory + Opaque + + + Audio clip that is playable (e.g., a short audio recording indicating the floor in an elevator). + + + Trigger + E + Single + Optional + + + + Trigger initiating actuation. + + + Level + RW + Single + Optional + Float + 0..100 + /100 + Used to represent a level control such as audio volume. + + + Duration + RW + Single + Optional + Float + + s + The duration of the sound once trigger. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3340.xml b/application/src/main/data/lwm2m-registry/3340.xml new file mode 100644 index 0000000000..35de944f3a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3340.xml @@ -0,0 +1,159 @@ + + + + + + + Timer + This IPSO object is used to time events and actions, using patterns common to industrial timers. A write to the trigger resource or On/Off input state change starts the timing operation, and the timer remaining time shows zero when the operation is complete. The patterns supported are One-Shot (mode 1), On-Time or Interval (mode 2), Time delay on pick-up or TDPU (mode 3), and Time Delay on Drop-Out or TDDO (mode 4). Mode 0 disables the timer, so the output follows the input with no delay. A counter is provided to count occurrences of the timer output changing from 0 to 1. Writing a value of zero resets the counter. The Digital Input State resource reports the state of the timer output. + + 3340 + urn:oma:lwm2m:ext:3340 + 1.0 + 1.0 + Multiple + Optional + + + Delay Duration + RW + Single + Mandatory + Float + + s + The duration of the time delay. + + + Remaining Time + R + Single + Optional + Float + + s + The time remaining in an operation. + + + Minimum Off-time + RW + Single + Optional + Float + + s + The duration of the rearm delay (i.e. the delay from the end of one cycle until the beginning of the next, the inhibit time). + + + Trigger + E + Single + Optional + + + + Trigger initiating actuation. + + + On/Off + RW + Single + Optional + Boolean + + + On/off control. Boolean value where True is On and False is Off. + + + Digital Input Counter + R + Single + Optional + Integer + + + The cumulative value of active state detected. + + + Cumulative Time + RW + Single + Optional + Float + + s + The total time in seconds that the timer input is true. Writing a 0 resets the time. + + + Digital State + R + Single + Optional + Boolean + + + The current state of the timer output. + + + Counter + RW + Single + Optional + Integer + + + Counts the number of times the timer output transitions from 0 to 1. + + + Timer Mode + RW + Single + Optional + Integer + 0..4 + + Type of timer pattern used by the timer. 1: One-shot, 2: On-Time or Interval, 3: Time delay on pick-up, 4: Time Delay on Drop-Out, 0: disables the timer. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3341.xml b/application/src/main/data/lwm2m-registry/3341.xml new file mode 100644 index 0000000000..38e8fb8d9d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3341.xml @@ -0,0 +1,139 @@ + + + + + + + Addressable Text Display + This IPSO object is used to send text to a text-only or text mode graphics display. Writing a string of text to the text resource causes it to be displayed at the selected X and Y locations on the display. If X or Y are set to a value greater than the size of the display, the position "wraps around" to the modulus of the setting and the display size. Likewise, if the text string overflows the display size, the text "wraps around" and displays on the next line down or, if the last line has been written, wraps around to the top of the display. Brightness and Contrast controls are provided to allow control of various display types including STN and DSTN type LCD character displays. Writing an empty payload to the Clear Display resource causes the display to be erased. + + 3341 + urn:oma:lwm2m:ext:3341 + 1.0 + 1.0 + Multiple + Optional + + + Text + RW + Single + Mandatory + String + + + A string of text. + + + X Coordinate + RW + Single + Optional + Integer + + + X Coordinate. + + + Y Coordinate + RW + Single + Optional + Integer + + + Y Coordinate. + + + Max X Coordinate + R + Single + Optional + Integer + + + The highest X coordinate the display supports before wrapping to the next line. + + + Max Y Coordinate + R + Single + Optional + Integer + + + The highest Y coordinate the display supports before wrapping to the next line. + + + Clear Display + E + Single + Optional + + + + Command to clear the display. + + + Level + RW + Single + Optional + Float + 0..100 + /100 + Used to represent a level control such as audio volume. + + + Contrast + RW + Single + Optional + Float + 0..100 + /100 + Proportional control, integer value between 0 and 100 as a percentage. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3342.xml b/application/src/main/data/lwm2m-registry/3342.xml new file mode 100644 index 0000000000..cd27717ed4 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3342.xml @@ -0,0 +1,118 @@ + + + + + + + On/Off switch + This IPSO object should be used with an On/Off switch to report the state of the switch. + 3342 + urn:oma:lwm2m:ext:3342:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Digital Input State + R + Single + Mandatory + Boolean + + + The current state of a digital input. + + + Digital Input Counter + R + Single + Optional + Integer + + + The cumulative value of active state detected. + + + On time + RW + Single + Optional + Integer + + s + The time in seconds that the device has been on. Writing a value of 0 resets the counter. + + + Off Time + RW + Single + Optional + Integer + + s + The time in seconds in the off state. Writing a value of 0 resets the counter. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3343.xml b/application/src/main/data/lwm2m-registry/3343.xml new file mode 100644 index 0000000000..3aa109923a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3343.xml @@ -0,0 +1,89 @@ + + + + + + + Dimmer + This IPSO object should be used with a dimmer or level control to report the state of the control. + + 3343 + urn:oma:lwm2m:ext:3343 + 1.0 + 1.0 + Multiple + Optional + + + Level + RW + Single + Mandatory + Float + 0..100 + /100 + Used to represent a level control such as audio volume. + + + On time + RW + Single + Optional + Integer + + s + The time in seconds that the device has been on. Writing a value of 0 resets the counter. + + + Off Time + RW + Single + Optional + Integer + + s + The time in seconds in the off state. Writing a value of 0 resets the counter. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3344.xml b/application/src/main/data/lwm2m-registry/3344.xml new file mode 100644 index 0000000000..2dd8648a19 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3344.xml @@ -0,0 +1,99 @@ + + + + + + + Up/Down Control + This IPSO object is used to report the state of an up/down control element like a pair of push buttons or a rotary encoder. Counters for increase and decrease operations are provided for counting pulses from a quadrature encoder. + + 3344 + urn:oma:lwm2m:ext:3344 + 1.0 + 1.0 + Multiple + Optional + + + Increase Input State + R + Single + Mandatory + Boolean + + + Indicates an increase control action. + + + Decrease Input State + R + Single + Mandatory + Boolean + + + Indicates a decrease control action. + + + Up Counter + RW + Single + Optional + Integer + + + Counts the number of times the increase control has been operated. Writing a 0 resets the counter. + + + Down Counter + RW + Single + Optional + Integer + + + Counts the times the decrease control has been operated. Writing a 0 resets the counter. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3345.xml b/application/src/main/data/lwm2m-registry/3345.xml new file mode 100644 index 0000000000..bb234638a9 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3345.xml @@ -0,0 +1,109 @@ + + + + + + + Multiple Axis Joystick + This IPSO object can be used to report the position of a shuttle or joystick control. A digital input is provided to report the state of an associated push button. + + 3345 + urn:oma:lwm2m:ext:3345 + 1.0 + 1.0 + Multiple + Optional + + + Digital Input State + R + Single + Optional + Boolean + + + The current state of a digital input. + + + Digital Input Counter + R + Single + Optional + Integer + + + The cumulative value of active state detected. + + + X Value + R + Single + Optional + Float + + + The measured value along the X axis. + + + Y Value + R + Single + Optional + Float + + + The measured value along the Y axis. + + + Z Value + R + Single + Optional + Float + + + The measured value along the Z axis. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3346.xml b/application/src/main/data/lwm2m-registry/3346.xml new file mode 100644 index 0000000000..d49322f32a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3346.xml @@ -0,0 +1,179 @@ + + + + + + + Rate + This object type should be used to report a rate measurement, for example the speed of a vehicle, or the rotational speed of a drive shaft. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is meters per second (m/s). + + 3346 + urn:oma:lwm2m:ext:3346:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Sensor Value + R + Single + Mandatory + Float + + + Last or Current Measured Value from the Sensor. + + + Sensor Units + R + Single + Optional + String + + + Measurement Units Definition. + + + Min Measured Value + R + Single + Optional + Float + + + The minimum value measured by the sensor since power ON or reset. + + + Max Measured Value + R + Single + Optional + Float + + + The maximum value measured by the sensor since power ON or reset. + + + Min Range Value + R + Single + Optional + Float + + + The minimum value that can be measured by the sensor. + + + Max Range Value + R + Single + Optional + Float + + + The maximum value that can be measured by the sensor. + + + Reset Min and Max Measured Values + E + Single + Optional + + + + Reset the Min and Max Measured Values to Current Value. + + + Current Calibration + RW + Single + Optional + Float + + + Read or Write the current calibration coefficient. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3347.xml b/application/src/main/data/lwm2m-registry/3347.xml new file mode 100644 index 0000000000..136e3445b9 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3347.xml @@ -0,0 +1,99 @@ + + + + + + + Push button + This IPSO object is used to report the state of a momentary action push button control and to count the number of times the control has been operated since the last observation. + + 3347 + urn:oma:lwm2m:ext:3347:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Digital Input State + R + Single + Mandatory + Boolean + + + The current state of a digital input. + + + Digital Input Counter + R + Single + Optional + Integer + + + The cumulative value of active state detected. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3348.xml b/application/src/main/data/lwm2m-registry/3348.xml new file mode 100644 index 0000000000..9309b4b3dd --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3348.xml @@ -0,0 +1,89 @@ + + + + + + + Multi-state Selector + This IPSO object is used to represent the state of a Multi-state selector switch with a number of fixed positions. + + 3348 + urn:oma:lwm2m:ext:3348:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Multi-state Input + R + Single + Mandatory + Integer + + + The current state of a Multi-state input or selector. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3349.xml b/application/src/main/data/lwm2m-registry/3349.xml new file mode 100644 index 0000000000..28029e7a6a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3349.xml @@ -0,0 +1,108 @@ + + + + + + + Bitmap + Summarize several digital inputs to one value by mapping each bit to a digital input. + 3349 + urn:oma:lwm2m:ext:3349:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Bitmap Input + R + Single + Mandatory + Integer + + + Integer in which each of the bits are associated with specific digital input value. Represented as a binary signed integer in network byte order, and in two's complement representation. Using values in range 0-127 is recommended to avoid ambiguities with byte order and negative values. + + + Bitmap Input Reset + E + Single + Optional + + + + Reset the Bitmap Input value. + + + Element Description + RW + Multiple + Optional + String + + + The description of each bit as a string. First instance describes the least significant bit, second instance the second least significant bit. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3350.xml b/application/src/main/data/lwm2m-registry/3350.xml new file mode 100644 index 0000000000..f4f8477fdc --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3350.xml @@ -0,0 +1,128 @@ + + + + + + + Stopwatch + An ascending timer that counts how long time has passed since the timer was started after reset. + 3350 + urn:oma:lwm2m:ext:3350:1.1 + 1.0 + 1.1 + Multiple + Optional + + + Cumulative Time + RW + Single + Mandatory + Float + + s + The total time in seconds that the timer input is true. Writing a 0 resets the time. + + + On/Off + RW + Single + Optional + Boolean + + + On/off control. Boolean value where True is On and False is Off. + + + Digital Input Counter + R + Single + Optional + Integer + + + The cumulative value of active state detected. + + + Application Type + RW + Single + Optional + String + + + The application type of the sensor or actuator as a string depending on the use case. + + + Timestamp + R + Single + Optional + Time + + + The timestamp of when the measurement was performed. + + + Fractional Timestamp + R + Single + Optional + Float + 0..1 + s + Fractional part of the timestamp when sub-second precision is used (e.g., 0.23 for 230 ms). + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. 0: UNCHECKED No quality checks were done because they do not exist or can not be applied. 1: REJECTED WITH CERTAINTY The measured value is invalid. 2: REJECTED WITH PROBABILITY The measured value is likely invalid. 3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. 4: ACCEPTED The measured value is OK. 5-15: Reserved for future extensions. 16-23: Vendor specific measurement quality. + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3351.xml b/application/src/main/data/lwm2m-registry/3351.xml new file mode 100644 index 0000000000..9219a765df --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3351.xml @@ -0,0 +1,131 @@ + + + powerupLog + + 3351 + urn:oma:lwm2m:ext:3351 + 1.0 + 1.0 + Single + Optional + + deviceName + R + Single + Mandatory + String + + + + + toolVersion + R + Single + Mandatory + String + + + + + IMEI + R + Single + Mandatory + String + + + + + IMSI + R + Single + Mandatory + String + + + + + MSISDN + R + Single + Mandatory + String + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3352.xml b/application/src/main/data/lwm2m-registry/3352.xml new file mode 100644 index 0000000000..0e519c4951 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3352.xml @@ -0,0 +1,124 @@ + + + plmnSearchEvent + + 3352 + urn:oma:lwm2m:ext:3352 + 1.0 + 1.0 + Multiple + Optional + + timeScanStart + R + Single + Mandatory + Integer + + + + + plmnID + R + Single + Mandatory + Integer + + + + + BandIndicator + R + Single + Mandatory + Integer + + + + + dlEarfcn + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3353.xml b/application/src/main/data/lwm2m-registry/3353.xml new file mode 100644 index 0000000000..1881a3b3bb --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3353.xml @@ -0,0 +1,123 @@ + + + scellID + + 3353 + urn:oma:lwm2m:ext:3353 + 1.0 + 1.0 + Single + Optional + + plmnID + R + Single + Mandatory + Integer + + + + + BandIndicator + R + Single + Mandatory + Integer + + + + + TrackingAreaCode + R + Single + Mandatory + Integer + + + + + CellID + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3354.xml b/application/src/main/data/lwm2m-registry/3354.xml new file mode 100644 index 0000000000..702be4cabc --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3354.xml @@ -0,0 +1,134 @@ + + + cellReselectionEvent + + 3354 + urn:oma:lwm2m:ext:3354 + 1.0 + 1.0 + Single + Optional + + timeReselectionStart + R + Single + Mandatory + Integer + + + + + dlEarfcn + R + Single + Mandatory + Integer + + + + + CellID + R + Single + Mandatory + Integer + + + + + failureType + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3355.xml b/application/src/main/data/lwm2m-registry/3355.xml new file mode 100644 index 0000000000..fb56230fdf --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3355.xml @@ -0,0 +1,156 @@ + + + handoverEvent + + 3355 + urn:oma:lwm2m:ext:3355 + 1.0 + 1.0 + Single + Optional + + timeHandoverStart + R + Single + Mandatory + Integer + + + + + dlEarfcn + R + Single + Mandatory + Integer + + + + + CellID + R + Single + Mandatory + Integer + + + + + handoverResult + R + Single + Mandatory + Integer + + + + + + TargetEarfcn + R + Single + Mandatory + Integer + + + + + TargetPhysicalCellID + R + Single + Mandatory + Integer + + + + + targetCellRsrp + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3356.xml b/application/src/main/data/lwm2m-registry/3356.xml new file mode 100644 index 0000000000..95c7fc7835 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3356.xml @@ -0,0 +1,120 @@ + + + radioLinkFailureEvent + + 3356 + urn:oma:lwm2m:ext:3356 + 1.0 + 1.0 + Single + Optional + + timeRLF + R + Single + Mandatory + Integer + + + + + rlfCause + R + Single + Mandatory + Integer + + + + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3357.xml b/application/src/main/data/lwm2m-registry/3357.xml new file mode 100644 index 0000000000..935b7c4ba7 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3357.xml @@ -0,0 +1,131 @@ + + + rrcStateChangeEvent + + 3357 + urn:oma:lwm2m:ext:3357 + 1.0 + 1.0 + Single + Optional + + rrcState + R + Single + Mandatory + Integer + + + + + rrcStateChangeCause + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3358.xml b/application/src/main/data/lwm2m-registry/3358.xml new file mode 100644 index 0000000000..2784d6a990 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3358.xml @@ -0,0 +1,106 @@ + + + rrcTimerExpiryEvent + + 3358 + urn:oma:lwm2m:ext:3358 + 1.0 + 1.0 + Single + Optional + + RrcTimerExpiryEvent + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3359.xml b/application/src/main/data/lwm2m-registry/3359.xml new file mode 100644 index 0000000000..91cb845e7a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3359.xml @@ -0,0 +1,105 @@ + + + cellBlacklistEvent + + 3359 + urn:oma:lwm2m:ext:3359 + 1.0 + 1.0 + Single + Optional + + dlEarfcn + R + Single + Mandatory + Integer + + + + + CellID + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3360.xml b/application/src/main/data/lwm2m-registry/3360.xml new file mode 100644 index 0000000000..12b2302854 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3360.xml @@ -0,0 +1,128 @@ + + + esmContextInfo + + 3360 + urn:oma:lwm2m:ext:3360 + 1.0 + 1.0 + Single + Optional + + contextType + R + Single + Mandatory + Integer + + + + + bearerState + R + Single + Mandatory + Integer + + + + + radioBearerId + R + Single + Mandatory + Integer + + + + + qci + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3361.xml b/application/src/main/data/lwm2m-registry/3361.xml new file mode 100644 index 0000000000..3d354bffac --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3361.xml @@ -0,0 +1,130 @@ + + + emmStateValue + + 3361 + urn:oma:lwm2m:ext:3361 + 1.0 + 1.0 + Single + Optional + + EmmState + R + Single + Mandatory + Integer + + + + + emmSubstate + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3362.xml b/application/src/main/data/lwm2m-registry/3362.xml new file mode 100644 index 0000000000..3cb73eb79a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3362.xml @@ -0,0 +1,97 @@ + + + nasEmmTimerExpiryEvent + + 3362 + urn:oma:lwm2m:ext:3362 + 1.0 + 1.0 + Single + Optional + + NasEmmTimerExpiryEvent + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3363.xml b/application/src/main/data/lwm2m-registry/3363.xml new file mode 100644 index 0000000000..3b44b91f26 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3363.xml @@ -0,0 +1,100 @@ + + + nasEsmExpiryEvent + + 3363 + urn:oma:lwm2m:ext:3363 + 1.0 + 1.0 + Single + Optional + + NasEsmExpiryEvent + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3364.xml b/application/src/main/data/lwm2m-registry/3364.xml new file mode 100644 index 0000000000..0a042d12d2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3364.xml @@ -0,0 +1,97 @@ + + + emmFailureCauseEvent + + 3364 + urn:oma:lwm2m:ext:3364 + 1.0 + 1.0 + Single + Optional + + EMMCause + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3365.xml b/application/src/main/data/lwm2m-registry/3365.xml new file mode 100644 index 0000000000..83dbf0c807 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3365.xml @@ -0,0 +1,123 @@ + + + rachLatency_delay + + 3365 + urn:oma:lwm2m:ext:3365 + 1.0 + 1.0 + Single + Optional + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + subFrameNumber + R + Single + Mandatory + Integer + + + + + rachLatencyVal + R + Single + Mandatory + Integer + + + + + delay + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3366.xml b/application/src/main/data/lwm2m-registry/3366.xml new file mode 100644 index 0000000000..5498af2a3d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3366.xml @@ -0,0 +1,176 @@ + + + macRachAttemptEvent + + 3366 + urn:oma:lwm2m:ext:3366 + 1.0 + 1.0 + Single + Optional + + rachAttemptCounter + R + Single + Mandatory + Integer + + + + + MacRachAttemptEventType + R + Single + Mandatory + Integer + + + + + contentionBased + R + Single + Mandatory + Boolean + + + + + rachMessage + R + Single + Mandatory + Integer + + + + + preambleIndex + R + Single + Mandatory + Integer + + + + + preamblePowerOffset + R + Single + Mandatory + Integer + + + + + backoffTime + R + Single + Mandatory + Integer + + + + + msg2Result + R + Single + Mandatory + Boolean + + + + + timingAdjustmentValue + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3367.xml b/application/src/main/data/lwm2m-registry/3367.xml new file mode 100644 index 0000000000..1f35cf4cc5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3367.xml @@ -0,0 +1,138 @@ + + + macRachAttemptReasonEvent + + 3367 + urn:oma:lwm2m:ext:3367 + 1.0 + 1.0 + Single + Optional + + MacRachAttemptReasonType + R + Single + Mandatory + Integer + + + + + ueID + R + Single + Mandatory + Integer + + + + + contentionBased + R + Single + Mandatory + Boolean + + + + + preamble + R + Single + Mandatory + Integer + + + + + preambleGroupChosen + R + Single + Mandatory + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3368.xml b/application/src/main/data/lwm2m-registry/3368.xml new file mode 100644 index 0000000000..40c17bfd37 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3368.xml @@ -0,0 +1,100 @@ + + + macTimerStatusEvent + + 3368 + urn:oma:lwm2m:ext:3368 + 1.0 + 1.0 + Single + Optional + + macTimerName + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3369.xml b/application/src/main/data/lwm2m-registry/3369.xml new file mode 100644 index 0000000000..b93bb86644 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3369.xml @@ -0,0 +1,105 @@ + + + macTimingAdvanceEvent + + 3369 + urn:oma:lwm2m:ext:3369 + 1.0 + 1.0 + Single + Optional + + timerValue + R + Single + Mandatory + Integer + + + + + timingAdvance + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3370.xml b/application/src/main/data/lwm2m-registry/3370.xml new file mode 100644 index 0000000000..667ab0a281 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3370.xml @@ -0,0 +1,141 @@ + + + ServingCellMeasurement + + 3370 + urn:oma:lwm2m:ext:3370 + 1.0 + 1.0 + Single + Optional + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + subFrameNumber + R + Single + Mandatory + Integer + + + + + pci + R + Single + Mandatory + Integer + + + + + rsrp + R + Single + Mandatory + Integer + + + + + rsrq + R + Single + Mandatory + Integer + + + + + dlEarfcn + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3371.xml b/application/src/main/data/lwm2m-registry/3371.xml new file mode 100644 index 0000000000..fbc0860870 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3371.xml @@ -0,0 +1,141 @@ + + + NeighborCellMeasurements + + 3371 + urn:oma:lwm2m:ext:3371 + 1.0 + 1.0 + Multiple + Optional + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + subFrameNumber + R + Single + Mandatory + Integer + + + + + pci + R + Single + Mandatory + Integer + + + + + rsrp + R + Single + Mandatory + Integer + + + + + rsrq + R + Single + Mandatory + Integer + + + + + dlEarfcn + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3372.xml b/application/src/main/data/lwm2m-registry/3372.xml new file mode 100644 index 0000000000..49d585a973 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3372.xml @@ -0,0 +1,115 @@ + + + TimingAdvance + + 3372 + urn:oma:lwm2m:ext:3372 + 1.0 + 1.0 + Single + Optional + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + subFrameNumber + R + Single + Mandatory + Integer + + + + + timingAdvance + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3373.xml b/application/src/main/data/lwm2m-registry/3373.xml new file mode 100644 index 0000000000..fb2af328b3 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3373.xml @@ -0,0 +1,115 @@ + + + txPowerHeadroomEvent + + 3373 + urn:oma:lwm2m:ext:3373 + 1.0 + 1.0 + Single + Optional + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + subFrameNumber + R + Single + Mandatory + Integer + + + + + headroom-value + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3374.xml b/application/src/main/data/lwm2m-registry/3374.xml new file mode 100644 index 0000000000..be7ecdc34e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3374.xml @@ -0,0 +1,132 @@ + + + radioLinkMonitoring + + 3374 + urn:oma:lwm2m:ext:3374 + 1.0 + 1.0 + Single + Optional + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + subFrameNumber + R + Single + Mandatory + Integer + + + + + outOfSyncCount + R + Single + Mandatory + Integer + + + + + inSyncCount + R + Single + Mandatory + Integer + + + + + t310Timer + R + Single + Mandatory + Boolean + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3375.xml b/application/src/main/data/lwm2m-registry/3375.xml new file mode 100644 index 0000000000..75fb2a5a42 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3375.xml @@ -0,0 +1,150 @@ + + + PagingDRX + + 3375 + urn:oma:lwm2m:ext:3375 + 1.0 + 1.0 + Single + Optional + + dlEarfcn + R + Single + Mandatory + Integer + + + + + pci + R + Single + Mandatory + Integer + + + + + pagingCycle + R + Single + Mandatory + Integer + + + + + DrxNb + R + Single + Mandatory + Integer + + + + + ueID + R + Single + Mandatory + Integer + + + + + drxSysFrameNumOffset + R + Single + Mandatory + Integer + + + + + drxSubFrameNumOffset + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3376.xml b/application/src/main/data/lwm2m-registry/3376.xml new file mode 100644 index 0000000000..542f816da0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3376.xml @@ -0,0 +1,97 @@ + + + txPowerBackOffEvent + + 3376 + urn:oma:lwm2m:ext:3376 + 1.0 + 1.0 + Single + Optional + + TxPowerBackoff + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3377.xml b/application/src/main/data/lwm2m-registry/3377.xml new file mode 100644 index 0000000000..515eb36439 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3377.xml @@ -0,0 +1,168 @@ + + + Message3Report + + 3377 + urn:oma:lwm2m:ext:3377 + 1.0 + 1.0 + Single + Optional + + tpc + R + Single + Mandatory + Integer + + + + + resourceIndicatorValue + R + Single + Mandatory + Integer + + + + + cqi + R + Single + Mandatory + Integer + + + + + uplinkDelay + R + Single + Mandatory + Boolean + + + + + hoppingEnabled + R + Single + Mandatory + Boolean + + + + + numRb + R + Single + Mandatory + Integer + + + + + transportBlockSizeIndex + R + Single + Mandatory + Integer + + + + + ModulationType + R + Single + Mandatory + Integer + + + + + redundancyVersionIndex + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3378.xml b/application/src/main/data/lwm2m-registry/3378.xml new file mode 100644 index 0000000000..970d245a90 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3378.xml @@ -0,0 +1,115 @@ + + + PbchDecodingResults + + 3378 + urn:oma:lwm2m:ext:3378 + 1.0 + 1.0 + Single + Optional + + servingCellID + R + Single + Mandatory + Integer + + + + + crcResult + R + Single + Mandatory + Boolean + + + + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3379.xml b/application/src/main/data/lwm2m-registry/3379.xml new file mode 100644 index 0000000000..87137da530 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3379.xml @@ -0,0 +1,123 @@ + + + pucchPowerControl + + 3379 + urn:oma:lwm2m:ext:3379 + 1.0 + 1.0 + Single + Optional + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + subFrameNumber + R + Single + Mandatory + Integer + + + + + pucchTxPowerValue + R + Single + Mandatory + Integer + + + + + dlPathLoss + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3380.xml b/application/src/main/data/lwm2m-registry/3380.xml new file mode 100644 index 0000000000..8290651569 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3380.xml @@ -0,0 +1,204 @@ + + + PrachReport + + 3380 + urn:oma:lwm2m:ext:3380:2.0 + 1.0 + 2.0 + Single + Optional + + sysFrameNumber + R + Single + Mandatory + Integer + + + + + subFrameNumber + R + Single + Mandatory + Integer + + + + + rachTxPower + R + Single + Mandatory + Integer + + + + + zadOffSeqNum + R + Single + Mandatory + Integer + + + + + prachConfig + R + Single + Mandatory + Integer + + + + + preambleFormat + R + Single + Mandatory + Integer + + + + + maxTransmissionMsg3 + R + Single + Mandatory + Integer + + + + + raResponseWindowSize + R + Single + Mandatory + Integer + + + + + RachRequestResult + R + Single + Mandatory + Boolean + + + + + ce_mode + R + Single + Mandatory + Integer + + + + + ce_level + R + Single + Mandatory + Integer + + + + + num_prach_repetition + R + Single + Mandatory + Integer + + + + + prach_repetition_seq + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3381.xml b/application/src/main/data/lwm2m-registry/3381.xml new file mode 100644 index 0000000000..db2e4d52e8 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3381.xml @@ -0,0 +1,110 @@ + + + VolteCallEvent + + 3381 + urn:oma:lwm2m:ext:3381 + 1.0 + 1.0 + Single + Optional + + callStatus + R + Single + Mandatory + Integer + + + + + callType + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3382.xml b/application/src/main/data/lwm2m-registry/3382.xml new file mode 100644 index 0000000000..8f066837c8 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3382.xml @@ -0,0 +1,108 @@ + + + SipRegistrationEvent + + 3382 + urn:oma:lwm2m:ext:3382 + 1.0 + 1.0 + Single + Optional + + registrationType + R + Single + Mandatory + Integer + + + + + registrationResult + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3383.xml b/application/src/main/data/lwm2m-registry/3383.xml new file mode 100644 index 0000000000..663ac45faa --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3383.xml @@ -0,0 +1,99 @@ + + + sipPublishEvent + + 3383 + urn:oma:lwm2m:ext:3383 + 1.0 + 1.0 + Single + Optional + + publishResult + R + Single + Mandatory + Integer + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3384.xml b/application/src/main/data/lwm2m-registry/3384.xml new file mode 100644 index 0000000000..a18c6b910b --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3384.xml @@ -0,0 +1,112 @@ + + + sipSubscriptionEvent + + 3384 + urn:oma:lwm2m:ext:3384 + 1.0 + 1.0 + Single + Optional + + eventType + R + Single + Mandatory + Integer + + + + + subscriptionResult + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3385.xml b/application/src/main/data/lwm2m-registry/3385.xml new file mode 100644 index 0000000000..cc0a99182a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3385.xml @@ -0,0 +1,110 @@ + + + volteCallStateChangeEvent + + 3385 + urn:oma:lwm2m:ext:3385 + 1.0 + 1.0 + Single + Optional + + callStatus + R + Single + Mandatory + Integer + + + + + VolteCallStateChangeCause + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3386.xml b/application/src/main/data/lwm2m-registry/3386.xml new file mode 100644 index 0000000000..43937efadb --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3386.xml @@ -0,0 +1,105 @@ + + + VoLTErtpPacketLoss + 1]]> + 3386 + urn:oma:lwm2m:ext:3386 + 1.0 + 1.0 + Single + Optional + + ssrc + R + Single + Mandatory + Integer + + + + + packetsLost + R + Single + Mandatory + Integer + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3387.xml b/application/src/main/data/lwm2m-registry/3387.xml new file mode 100644 index 0000000000..c50ecb47bc --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3387.xml @@ -0,0 +1,224 @@ + + + + + + + oA Basic Control + + 3387 + urn:oma:lwm2m:ext:3387 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Control Function Status + R + Single + Mandatory + Integer + 0: disabled + 1: normal + 2: remote + 3: local + 255: non_responsive + + + + + Ghost Status + R + Single + Mandatory + Boolean + + + + + + Control Object Mode + RW + Single + Mandatory + Integer + 1: normal + 2: remote + 3: local + + + + + Ghost Configuration + RW + Single + Optional + Boolean + 0..65535 + + + + + Supersede Heartbeat Time + RW + Single + Mandatory + Integer + + s + + + + Controlled Application Group ID + RW + Single + Mandatory + Integer + 0..65535 + + + + + Push-Button Event Configuration + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Presence Sensor Event Configuration + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Executing Object + RW + Single + Mandatory + Corelnk + + + + + + Supersede Heartbeat + W + Single + Optional + Unsigned Integer + 0..65535 + s + + + + Debug Mode Enabled + RW + Single + Optional + Boolean + + + + + + Inject Test Event + RW + Single + Optional + Unsigned Integer + 0..65535 + + + + + Execute Inject + E + Single + Optional + + + + + + + Object Enabled + RW + Single + Optional + Boolean + + + + + + Active-Controller-List + R + Multiple + Optional + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3388.xml b/application/src/main/data/lwm2m-registry/3388.xml new file mode 100644 index 0000000000..c1b5e54206 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3388.xml @@ -0,0 +1,178 @@ + + + + + + + oA Device + + 3388 + urn:oma:lwm2m:ext:3388 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Error Status + R + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + OEM ID + R + Single + Optional + String + 0..64 bytes + + + + + OEM String + R + Single + Optional + String + 0..64 bytes + + + + + BMS ID + RW + Single + Optional + Unsigned Integer + 0..65535 + + + + + CPU Temperature + R + Single + Mandatory + Integer + -128..127 + C + + + + Executing Objects + R + Multiple + Mandatory + Corelnk + + + + + + Total Energy Usage + R + Single + Mandatory + Unsigned Integer + 0..18446744073709551615 + Ws + + + + Actual Power Usage + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + W + + + + Accuracy Class + R + Single + Optional + String + 0..64 bytes + + + + + Mounting Location + RW + Single + Mandatory + String + 1..64 bytes + + + + + System Failure Time + RW + Single + Optional + Unsigned Integer + 0..65535 + ms + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3389.xml b/application/src/main/data/lwm2m-registry/3389.xml new file mode 100644 index 0000000000..7e3d0c7cdb --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3389.xml @@ -0,0 +1,108 @@ + + + + + + + oA Group + + 3389 + urn:oma:lwm2m:ext:3389 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Security Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + IP Addresses + RW + Multiple + Mandatory + Opaque + + + + + + Members + RW + Multiple + Mandatory + Corelnk + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3390.xml b/application/src/main/data/lwm2m-registry/3390.xml new file mode 100644 index 0000000000..0e56d0a19a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3390.xml @@ -0,0 +1,298 @@ + + + + + + + oA Logical Colour Light-Point Actuator + + 3390 + urn:oma:lwm2m:ext:3390 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Target Colour X + R + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Target Colour Y + R + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Executing Object + RW + Single + Mandatory + Corelnk + + + + + + Priority + RW + Single + Mandatory + Unsigned Integer + 0..5 + + + + + Colour Changing Time + RW + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Colour Transition Time + RW + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Hue Step Size + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Saturation Step Size + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Status Resend Time + RW + Single + Mandatory + Unsigned Integer + 1..600 + s + + + + Status Report Structure ID + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Scene Cache + RW + Multiple + Optional + Opaque + + + + + + Set Colour + W + Single + Mandatory + Opaque + + + + + + Relative Change Saturation + W + Single + Mandatory + Boolean + + + ////118 0` \ndecreases saturation.\n- `POST coap://////118 1` \nincreases saturation.]]> + + + Relative Change Hue + W + Single + Mandatory + Boolean + + + ////118 0` \nincreases hue.\n- `POST coap://////118 1` \ndecreases hue.]]> + + + Stop Transition + E + Single + Mandatory + + + + + + + Step Saturation + W + Single + Mandatory + Opaque + + + + + + Step Hue + W + Single + Mandatory + Opaque + + + + + + Recall Scene + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Debug Mode Enabled + RW + Single + Optional + Boolean + + + + + + Inject Test Event + RW + Single + Optional + Unsigned Integer + 0..65535 + + + + + Execute Inject + E + Single + Optional + + + + + + + Object Enabled + RW + Single + Optional + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3391.xml b/application/src/main/data/lwm2m-registry/3391.xml new file mode 100644 index 0000000000..0b4ce12cd0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3391.xml @@ -0,0 +1,258 @@ + + + + + + + oA Logical Colour Temperature Light-Point Actuator + + 3391 + urn:oma:lwm2m:ext:3391 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Target Colour Temperature + R + Single + Mandatory + Unsigned Integer + 0..65535 + K + + + + Executing Object + RW + Single + Mandatory + Corelnk + + + + + + Priority + RW + Single + Mandatory + Unsigned Integer + 0..5 + + + + + Colour Temperature Changing Time + RW + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Colour Temperature Transition Time + RW + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Colour Temperature Step Size + RW + Single + Mandatory + Unsigned Integer + 0..65535 + K + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Status Resend Time + RW + Single + Mandatory + Unsigned Integer + 1..600 + s + + + + Status Report Structure ID + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Scene Cache + RW + Multiple + Optional + Opaque + + + + + + Set Colour Temperature + W + Single + Mandatory + Opaque + + + + + + Relative Change Colour Temperature + W + Single + Mandatory + Boolean + + + ////118 0` \nreduces the colour temperature.\n- `POST coap://////118 1` \nincreases the colour temperature.]]> + + + Stop Transition + E + Single + Mandatory + + + + + + + Step Colour Temperature + W + Single + Mandatory + Opaque + + + + + + Recall Scene + W + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Debug Mode Enabled + RW + Single + Optional + Boolean + + + + + + Inject Test Event + W + Single + Optional + Unsigned Integer + 0..65535 + + + + + Execute Test Injection + E + Single + Optional + + + + + + + Object Enabled + RW + Single + Optional + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3392.xml b/application/src/main/data/lwm2m-registry/3392.xml new file mode 100644 index 0000000000..07b1b154e4 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3392.xml @@ -0,0 +1,198 @@ + + + + + + + oA Logical Illuminance Sensor + + 3392 + urn:oma:lwm2m:ext:3392 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Sensor Value + R + Single + Mandatory + Unsigned Integer + 0..65535 + lx + + + + Executing Object + RW + Single + Mandatory + Corelnk + + + + + + Less Than + RW + Single + Optional + Unsigned Integer + 0..65535 + lx + + + + Greater Than + RW + Single + Optional + Unsigned Integer + 0..65535 + lx + + + + Step + RW + Single + Optional + Unsigned Integer + 0..65535 + lx + + + + Minimum Update Interval + RW + Single + Mandatory + Unsigned Integer + 0..65535 + s + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Status Resend Time + RW + Single + Mandatory + Unsigned Integer + 1..600 + s + + + + Status Report Structure ID + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Debug Mode Enabled + RW + Single + Optional + Boolean + + + + + + Inject Test Event + W + Single + Optional + Unsigned Integer + 0..65535 + + + + + Object Enabled + RW + Single + Optional + Boolean + + + + + + Object Enabled + E + Single + Optional + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3393.xml b/application/src/main/data/lwm2m-registry/3393.xml new file mode 100644 index 0000000000..e3c883ac70 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3393.xml @@ -0,0 +1,268 @@ + + + + + + + oA Logical Light-Point Actuator + + 3393 + urn:oma:lwm2m:ext:3393 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Target OnOff + R + Single + Mandatory + Boolean + + + + + + Target Intensity + R + Single + Mandatory + Float + 0.0..1.0 + + + + + Executing Object + RW + Single + Mandatory + Corelnk + + + + + + Priority + RW + Single + Mandatory + Unsigned Integer + 0..5 + + + + + Dimming Time + RW + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Transition Time + RW + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Step Size + RW + Single + Mandatory + Float + 0.000001..1.0 + + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Status Resend Time + RW + Single + Mandatory + Unsigned Integer + 1..600 + s + + + + Status Report Structure ID + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Scene Cache + RW + Multiple + Optional + Opaque + + + + + + Switch + W + Single + Mandatory + Opaque + + + ////117 {0:false,2:2}` \nor\n`POST coap://////117 {1:0,2:2}` \nsets the light point to Off and takes 200ms to set the intensity to '0'\n- `POST coap://////117 {0:true,2:2}` \nsets the light point to On and takes 200ms to set the intensity to the intensity that was active before the lightpoint was switched off.\n- `POST coap://////117 {1:1,2:2}` \nsets the light point to On and takes 200ms to set the intensity to '1'\n\t\t\t\n**Note:** When the optional argument time is not given, or if its value is empty the default configuration value is used.\nA request on this Resource will immediately impact the value of 'On/Off Status' and a continuous update of 'Remaining Transition Time' and 'Current Intensity' until the Switch operation is cloncluded.]]> + + + Dim + W + Single + Mandatory + Boolean + + + ////118 0` \ndims the light points down.\n- `POST coap://////118 1` \ndims the light point up.\n\t\t\t\t\nDimming is also possible during off. This effects the intensity that 'On' requests without requested intensity will execute.]]> + + + Stop Transition + E + Single + Mandatory + + + + + + + Step + W + Single + Mandatory + Opaque + + + + + + Recall Scene + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Debug Mode Enabled + RW + Single + Optional + Boolean + + + + + + Inject Test Event + W + Single + Optional + Unsigned Integer + 0..65535 + + + + + Object Enabled + E + Single + Optional + + + + + + + Object Enabled + RW + Single + Optional + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3394.xml b/application/src/main/data/lwm2m-registry/3394.xml new file mode 100644 index 0000000000..767100e145 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3394.xml @@ -0,0 +1,177 @@ + + + + + + oA Logical Presence Sensor + + 3394 + urn:oma:lwm2m:ext:3394 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Digital Input State + R + Single + Mandatory + Boolean + + + + + + Executing Object + RW + Single + Mandatory + Corelnk + + + + + + Busy to Clear delay + RW + Single + Optional + Integer + + ms + + + + Clear to Busy delay + RW + Single + Optional + Integer + + ms + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Status Resend Time + RW + Single + Mandatory + Unsigned Integer + 1..600 + s + + + + Status Report Structure ID + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Debug Mode Enabled + RW + Single + Optional + Boolean + + + + + + Inject Test Event + W + Single + Optional + Boolean + + + + + + Object Enabled + E + Single + Optional + + + + + + + Object Enabled + RW + Single + Optional + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3395.xml b/application/src/main/data/lwm2m-registry/3395.xml new file mode 100644 index 0000000000..29b4ce6b67 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3395.xml @@ -0,0 +1,182 @@ + + + + + + + oA Logical Push-Button Sensor + + 3395 + urn:oma:lwm2m:ext:3395 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Push-Button Event Value + R + Single + Mandatory + Unsigned Integer + 0: RELEASE + 1: CLICK + 2: HOLD + 3: DOUBLE-CLICK + 255: STUCK + + + + + Executing Object + RW + Single + Mandatory + Corelnk + + + + + + Single Click Time + RW + Single + Mandatory + Unsigned Integer + 100..60000 + ms + + + + Hold Repeat Time + RW + Single + Optional + Unsigned Integer + 300..60000 + ms + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Status Resend Time + RW + Single + Mandatory + Unsigned Integer + 1..600 + s + + + + Status Report Structure ID + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Debug Mode Enabled + RW + Single + Optional + Boolean + + + + + + Inject Test Event + W + Single + Optional + Integer + 0..65535 + + + + + Object Enabled + E + Single + Optional + + + + + + + Object Enabled + RW + Single + Optional + Boolean + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3396.xml b/application/src/main/data/lwm2m-registry/3396.xml new file mode 100644 index 0000000000..c3183f8e29 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3396.xml @@ -0,0 +1,270 @@ + + + + + + + oA Physical Colour Light-Point Actuator + + 3396 + urn:oma:lwm2m:ext:3396 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Error Status + R + Single + Mandatory + Opaque + + + + + + Mounting Location + RW + Single + Mandatory + String + 1..64 Bytes + B + + + + On/Off + RW + Single + Mandatory + Boolean + + + + + + Current Intensity + R + Single + Mandatory + Float + 0.0..1.0 + + + + + Remaining Transition Time + R + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Current Colour Y + R + Single + Mandatory + Unsigned Integer + 0..10000 + K + + + + Current Colour X + R + Single + Mandatory + Unsigned Integer + 0..10000 + K + + + + Remaining Colour Transition Time + R + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Total Energy Usage + R + Single + Mandatory + Unsigned Integer + 0..18446744073709551615 + Ws + + + + Actual Power Usage + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + W + + + + Accuracy Class + R + Single + Optional + String + 0..64 bytes + + + + + Operating Hours + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + h + + + + Adjusted Operating Hours + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + + + + + Physical Minimum Intensity + R + Single + Optional + Float + 0.000001..1.0 + + + + + Minimum Intensity + RW + Single + Mandatory + Float + 0.000001..1.0 + + + + + Maximum Intensity + RW + Single + Mandatory + Float + 0.000001..1.0 + + + + + Power On Behaviour + RW + Single + Optional + Unsigned Integer + 0: CONFIGURED_ON + 1: FULL_ON + 2: RECALL + + + + + Power On Intensity + RW + Single + Optional + Float + 0.000001..1.0 + + + + + Stored Intensity + R + Single + Optional + Float + 0.000001..1.0 + + + + + System Failure Intensity + RW + Single + Optional + Float + 0.000001..1.0 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3397.xml b/application/src/main/data/lwm2m-registry/3397.xml new file mode 100644 index 0000000000..b8a3bed8d0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3397.xml @@ -0,0 +1,302 @@ + + + + + + + oA Physical Colour Temperature Light-Point Actuator + + 3397 + urn:oma:lwm2m:ext:3397 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Error Status + R + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Mounting Location + RW + Single + Mandatory + String + 1..64 bytes + + + + + On/Off + RW + Single + Mandatory + Boolean + + + + + + Current Intensity + R + Single + Mandatory + Float + 0.0..1.0 + + + + + Remaining Transition Time + R + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + + + Current Colour Temperature + R + Single + Mandatory + Unsigned Integer + 0..65535 + K + + + + Remaining Colour Temperature Transition Time + R + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Total Energy Usage + R + Single + Mandatory + Unsigned Integer + 0..18446744073709551615 + Ws + + + + Actual Power Usage + R + Single + Mandatory + Integer + 0..4294967295 + W + + + + Accuracy Class + R + Single + Optional + String + 0..64 bytes + + + + + Operating Hours + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + h + + + + Adjusted Operating Hours + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + + + + + Physical Minimum Intensity + R + Single + Optional + Float + 0.000001..1.0 + + + + + Minimum Intensity + RW + Single + Mandatory + Float + 0.000001..1.0 + + + + + Maximum Intensity + RW + Single + Mandatory + Float + 0.000001..1.0 + + + + + Physical Minimum Colour Temperature + R + Single + Optional + Unsigned Integer + 0..65535 + K + + + + Physical Maximum Colour Temperature + R + Single + Optional + Unsigned Integer + 0..65535 + K + + + + Minimum Colour Temperature + R + Single + Optional + Unsigned Integer + 0..65535 + K + + + + Maximum Colour Temperature + R + Single + Optional + Unsigned Integer + 0..65535 + K + + + + Power On Behaviour + RW + Single + Optional + Unsigned Integer + 0: CONFIGURED_ON + 1: FULL_ON + 2: RECALL + + + + + Power On Intensity + RW + Single + Optional + Float + 0.000001..1.0 + + + + + Stored Intensity + R + Single + Optional + Float + 0.000001..1.0 + + + + + System Failure Intensity + RW + Single + Optional + Float + 0.000001..1.0 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3398.xml b/application/src/main/data/lwm2m-registry/3398.xml new file mode 100644 index 0000000000..de3e24113d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3398.xml @@ -0,0 +1,107 @@ + + + + + + oA Physical Illuminance Sensor + + 3398 + urn:oma:lwm2m:ext:3398 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Min Range Value + R + Single + Optional + Unsigned Integer + 0..65535 + lx + + + + Max Range Value + R + Single + Optional + Unsigned Integer + 0..65535 + lx + + + + Error Status + R + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Mounting Location + RW + Single + Mandatory + String + 1..64 bytes + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3399.xml b/application/src/main/data/lwm2m-registry/3399.xml new file mode 100644 index 0000000000..8c29c4af82 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3399.xml @@ -0,0 +1,238 @@ + + + + + oA Physical Light-Point Actuator + + 3399 + urn:oma:lwm2m:ext:3399 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Error Status + R + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Mounting Location + RW + Single + Mandatory + String + 1..64 bytes + + + + + On/Off + RW + Single + Mandatory + Boolean + + + + + + Current Intensity + R + Single + Mandatory + Float + 0.0..1.0 + + + + + Remaining Transition Time + R + Single + Mandatory + Unsigned Integer + 0..65535 + ms + + + + Total Energy Usage + R + Single + Mandatory + Unsigned Integer + 0..18446744073709551615 + Ws + + + + Actual Power Usage + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + W + + + + Accuracy Class + R + Single + Optional + String + 0..64 bytes + + + + + Operating Hours + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + h + + + + Adjusted Operating Hours + R + Single + Mandatory + Unsigned Integer + 0..4294967295 + + + + + Physical Minimum Intensity + R + Single + Optional + Float + 0.000001..1.0 + + + + + Minimum Intensity + RW + Single + Mandatory + Float + 0.000001..1.0 + + + + + Maximum Intensity + RW + Single + Mandatory + Float + 0.000001..1.0 + + + + + Power On Behaviour + RW + Single + Optional + Unsigned Integer + 0: CONFIGURED_ON + 1: FULL_ON + 2: RECALL + + + + + Power On Intensity + RW + Single + Optional + Float + 0.000001..1.0 + + + + + Stored Intensity + R + Single + Optional + Float + 0.000001..1.0 + + + + + System Failure Intensity + RW + Single + Optional + Float + 0.000001..1.0 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3400.xml b/application/src/main/data/lwm2m-registry/3400.xml new file mode 100644 index 0000000000..aea142daba --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3400.xml @@ -0,0 +1,88 @@ + + + + + + + oA Physical Presence Sensor + + 3400 + urn:oma:lwm2m:ext:3400 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Error Status + R + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Mounting Location + RW + Single + Mandatory + String + 1..64 bytes + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3401.xml b/application/src/main/data/lwm2m-registry/3401.xml new file mode 100644 index 0000000000..1b088f1737 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3401.xml @@ -0,0 +1,120 @@ + + + + + + + oA Physical Push-Button Sensor + + 3401 + urn:oma:lwm2m:ext:3401 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Push-Button Status Value + R + Single + Mandatory + Unsigned Integer + 0: RELEASED + 1: PRESSED + 2: FAULT + + + + + Error Status + R + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Mounting Location + RW + Single + Mandatory + String + 1..64 bytes + + + + + Digital Input Polarity + RW + Single + Mandatory + Boolean + + + + + + Digital Input Debounce + RW + Single + Mandatory + Integer + + ms + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3402.xml b/application/src/main/data/lwm2m-registry/3402.xml new file mode 100644 index 0000000000..5cf405a66a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3402.xml @@ -0,0 +1,88 @@ + + + + + + + oA Receiving Object + + 3402 + urn:oma:lwm2m:ext:3402 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Executing Object + RW + Single + Mandatory + Corelnk + + + + + + Status Report + W + Single + Mandatory + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3403.xml b/application/src/main/data/lwm2m-registry/3403.xml new file mode 100644 index 0000000000..f3690e5df5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3403.xml @@ -0,0 +1,118 @@ + + + + + + + oA Reporting Object + + 3403 + urn:oma:lwm2m:ext:3403 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Reporting Object Instances + RW + Multiple + Mandatory + Corelnk + + + + + + Target Resource + RW + Single + Mandatory + Corelnk + + + + + + Status Resend Time + RW + Single + Mandatory + Unsigned Integer + 1..600 + s + + + + Status Report Structure ID + RW + Single + Mandatory + Unsigned Integer + 1..600 + s + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + s + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3404.xml b/application/src/main/data/lwm2m-registry/3404.xml new file mode 100644 index 0000000000..24250ab608 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3404.xml @@ -0,0 +1,118 @@ + + + + + + + oA Scene + + 3404 + urn:oma:lwm2m:ext:3404 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Scene ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Application Group ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Changeable by User API + RW + Single + Mandatory + Boolean + + + + + + Transition Time + RW + Single + Mandatory + Unsigned Integer + 0..60000 + ms + + + + Scene Configuration + RW + Multiple + Mandatory + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3405.xml b/application/src/main/data/lwm2m-registry/3405.xml new file mode 100644 index 0000000000..f6939917ae --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3405.xml @@ -0,0 +1,98 @@ + + + + + + + oA OGC-Security + + 3405 + urn:oma:lwm2m:ext:3405 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + OGC Security ID + RW + Single + Mandatory + Unsigned Integer + 0..65535 + + + + + Accepted Senders + RW + Multiple + Mandatory + Opaque + + + + + + Secret Group Key + W + Single + Mandatory + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3406.xml b/application/src/main/data/lwm2m-registry/3406.xml new file mode 100644 index 0000000000..ccc7601eeb --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3406.xml @@ -0,0 +1,88 @@ + + + + + + + oA Status Report Structure + + 3406 + urn:oma:lwm2m:ext:3406 + 1.1 + 1.0 + Multiple + Optional + + + ObjectVersion + R + Single + Optional + String + + + + + + Documentary Description + RW + Single + Optional + String + 0..256 bytes + + + + + Status Report Structure ID + RW + Single + Mandatory + Unsigned Integer + 0..255 + + + + + Keys + RW + Multiple + Mandatory + String + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3407.xml b/application/src/main/data/lwm2m-registry/3407.xml new file mode 100644 index 0000000000..7f29324566 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3407.xml @@ -0,0 +1,98 @@ + + + + + + + Smoke Alarm + + 3407 + urn:oma:lwm2m:ext:3407 + 1.1 + 1.0 + Multiple + Optional + + + Battery Percentage + R + Single + Optional + Float + 0.00..100.00 + + + + + RSSI + R + Single + Optional + Float + + dBW + + + + Smoke Sensor State + R + Single + Mandatory + Boolean + + + + + + Detected CO2 percentage + R + Single + Optional + Float + 0.00..100.00 + /100 + + + + Alarm loudness + R + Single + Optional + Float + + dB + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3408.xml b/application/src/main/data/lwm2m-registry/3408.xml new file mode 100644 index 0000000000..4d5ff67eef --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3408.xml @@ -0,0 +1,79 @@ + + + + Manhole Cover + + 3408 + urn:oma:lwm2m:ext:3408 + 1.1 + 1.0 + Multiple + Optional + + + Safety Angle Threshold + R + Single + Mandatory + Integer + 0..180 + rad + + + + Manhole Cover Tilt + R + Single + Mandatory + Integer + 0..180 + rad + + + + Cover Open Status + R + Single + Mandatory + Boolean + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/3410.xml b/application/src/main/data/lwm2m-registry/3410.xml new file mode 100644 index 0000000000..63449e590b --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3410.xml @@ -0,0 +1,148 @@ + + + + + + + Device Extension + The uCIFI device extension is an extension to the standard Lightweight M2M device (object ID 3) using the resource called "ExtDevInfo" (resource ID 22). + 3410 + urn:oma:lwm2m:ext:3410 + 1.0 + 1.0 + Single + Optional + + + GTIN model number + R + Single + Optional + String + + + Standard global trade-in international number for the control device. + + + Manufacturer identifier + R + Single + Mandatory + String + + + Unique identifier of the manufacturer of the control device, equivalent to IEEE's OUI (Organizational Unique Identifier). This value should be a Hexadecimal value. This value may be used by an online uCIFI product catalog server, for software modules to retrieve the data model of a device using this attribute associated with the model number on the "Device" (Id=3) object. + + + User-given name + RW + Single + Optional + String + + + User-readable name of the device set by the user. + + + Asset identifier + RW + Single + Optional + String + + + Identifier of the asset (e.g. meter, luminaire, container) that is controlled by the device. + + + Installation date + RW + Single + Optional + Time + + + Installation date of the device. + + + Software update + R + Single + Optional + Boolean + + + Set to True while software within the device is being updated. + + + Maintenance + RW + Single + Optional + Boolean + + + Set to True when the device is in maintenance mode. + + + Configuration reset + E + Single + Optional + + + + Reset the configuration parameters (and only the configuration parameters) of the device. It does not clear any counter (e.g. kWh counter or operating hour counter). + + + Device operating hours + R + Single + Optional + Integer + + h + Cumulated number of hours during which the device has been powered on. + + + Additional firmware information + R + Single + Optional + String + + + Additional information about peripheral firmware versions. The format is left to the vendor. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3411.xml b/application/src/main/data/lwm2m-registry/3411.xml new file mode 100644 index 0000000000..6339b847bd --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3411.xml @@ -0,0 +1,168 @@ + + + + + + + Battery + The uCIFI battery object provides attributes to monitor battery level and activity. + 3411 + urn:oma:lwm2m:ext:3411 + 1.0 + 1.0 + Multiple + Optional + + + Battery level + R + Single + Mandatory + Integer + + /100 + Level of charge of the battery in % of total possible charge. + + + Battery capacity + R + Single + Optional + Float + + Ah + Nominal capacity of the battery in Ampere hour. + + + Battery voltage + R + Single + Optional + Float + + V + Level of charge of the battery in Volts. + + + Type of battery + RW + Single + Optional + String + + + Describes the type of battery (e.g. Li-Ion rechargeable). + + + Low battery threshold + RW + Single + Optional + Integer + + /100 + Threshold below which an event is generated by the device. + + + Battery level too low + R + Single + Optional + Boolean + + + Set to True if battery level is below or equal the low battery threshold. Set to False otherwise. + + + Battery shutdown + RW + Single + Optional + Boolean + + + Indicates that the device has shut down due to battery discharge. Can be reset by central application. + + + Number of cycles + R + Single + Optional + Integer + + + Number of times the battery has discharged and recharged. + + + Supply loss + R + Single + Optional + Boolean + + + Applies for battery devices that are also connected to mains supply. Set to True when mains power is lost. Set to False when mains power is back. + + + Supply loss counter + R + Single + Optional + Integer + + + Number of supply losses since last reset. + + + Supply loss counter reset + E + Single + Optional + + + + Reset the supply loss counter. + + + Supply loss reason + R + Single + Optional + String + + + Reason identified by the device why the device has lost mains supply (e.g. lightning if the device measured a high voltage, accident if the device identified a move with an accelerometer). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3412.xml b/application/src/main/data/lwm2m-registry/3412.xml new file mode 100644 index 0000000000..c3675639da --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3412.xml @@ -0,0 +1,288 @@ + + + + + + + LPWAN Communication + The uCIFI communication object provides attributes related to the communication on the LPWAN network, including multicast grouping. + 3412 + urn:oma:lwm2m:ext:3412 + 1.0 + 1.0 + Multiple + Optional + + + Type of network + R + Single + Optional + String + + + Type of LPWAN communication network (e.g. LoRaWAN, NB-IoT, wireless mesh, power line). + + + IPv4 address + RW + Multiple + Optional + String + + + Device’s IPv4 address. + + + IPv6 address + RW + Multiple + Optional + String + + + Device’s IPv6 address. + + + Network address + RW + Multiple + Optional + String + + + Address of the device on the LPWAN network. + + + Secondary network address + RW + Multiple + Optional + String + + + Secondary address used to communicate with the device on the LPWAN network. + + + MAC address + RW + Single + Mandatory + String + + + IEEE MAC address of the device. + + + Peer address + R + Multiple + Optional + String + + + Address of a peer (e.g. a router, a mesh node, a gateway). + + + Multicast group address + RW + Multiple + Optional + String + + + Group address from which the device should accept incoming messages and/or commands. + + + Multicast group key + RW + Multiple + Optional + String + + + Security key (e.g. AES128) to be shared with other members to be part of a multicast group. + + + Data rate + RW + Single + Optional + Integer + + B/s + Data rate of the communication used on the LPWAN network. + + + Transmit power + R + Single + Optional + Float + + dBm + Transmit power (also called TxPower) used by the device on the LPWAN network in decibel per milliwatt. + + + Frequency + RW + Single + Optional + Float + + Hz + Frequency of the wireless communication used on the LPWAN network. + + + Session time + RW + Single + Optional + Time + + + Starting time of the multicast session. The device shall not accept incoming messages before this time or after this time + session duration. + + + Session duration + R + Single + Optional + Time + + s + Duration of the multicast session. The device shall accept incoming messages only during this session duration time, starting at "Session time". + + + Mesh node + RW + Single + Optional + Boolean + + + Set to True if the device is a mesh node that should repeat incoming messages on a mesh network. + + + Maximum repeat time + RW + Single + Optional + Integer + + + Maximum number of times a message should be repeated within a mesh network. + + + Number of repeats + R + Single + Optional + Integer + + + Number of mesh nodes between the device and the destination device (e.g. another device or a router) including the destination node, on a mesh network. + + + Signal to noise ratio + R + Single + Optional + Float + + dB + Ratio of signal power to the noise power. + + + Communication failure + R + Single + Optional + Boolean + + + Set to True when the device can't communicate properly. + + + Received Signal Strength Indication + R + Single + Optional + Float + + dBm + Signal strength of the communication network measured by the device (a.k.a. RSSI or signal level). + + + IMSI + R + Single + Optional + String + + + Device’s International Mobile Subscriber Identity. + + + IMEI + R + Single + Optional + String + + + Device’s International Mobile Equipment Identity. + + + Current Communication Operator + R + Single + Optional + String + + + Device’s current communication operator. Communication operators could be private operators. Thus this resource is free text format and does not use Mobile Network Code or equivalent. + + + Integrated Circuit Card Identifier + R + Single + Optional + String + + + Unique identifier used to identify a communication SIM card. The ICCID is defined by the ITU-T recommendation E.118 as the Primary Account Number, composed of 19 or 20 characters containing the ISO Industry Identifier, country code, issuer identity, account ID, and other data which allows the network operator to identify the card. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3413.xml b/application/src/main/data/lwm2m-registry/3413.xml new file mode 100644 index 0000000000..e699cb67dd --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3413.xml @@ -0,0 +1,108 @@ + + + + + + + uCIFI Generic Actuator + The uCIFI generic actuator may be used for any actuator but not to replace Outdoor Lamp Controllers nor for an Irrigation Valves which have a specific device type in the uCIFI data model. + 3413 + urn:oma:lwm2m:ext:3413 + 1.0 + 1.0 + Multiple + Optional + + + Default dimming level + RW + Single + Optional + Integer + 0..100 + /100 + Default dimming level that the generic actuator applies when the device is powered ON. + + + Dimming level + R + Single + Optional + Integer + 0..100 + /100 + Actual dimming level (0 for OFF and 100% for ON) measured on the actuator. + + + Command + RW + Single + Optional + Integer + 0..100 + /100 + Command (e.g. manual override, scheduler) sent to the actuator. + + + Command in action + R + Single + Optional + Integer + 0..100 + /100 + For devices connected on slow LPWAN networks, the command in action (this resource) may differ from a command that was sent (resource ID: 3). The command in action is the actual value of the command in action in the actuator. + + + Scheduler ID + RW + Multiple + Optional + Integer + + + The identifier of the schedulers that are assigned to the Command of this actuator. + + + Invalid scheduler + R + Single + Optional + Boolean + + + Set to True when one of the schedulers can’t be executed or is not supported by the actuator. Otherwise set to False. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3414.xml b/application/src/main/data/lwm2m-registry/3414.xml new file mode 100644 index 0000000000..b3f7ad4567 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3414.xml @@ -0,0 +1,108 @@ + + + + + + + uCIFI data bridge + The uCIFI data bridge object may be used to transport data from a 3rd party device, operating a proprietary network or protocol, over a LwM2M compliant network. + 3414 + urn:oma:lwm2m:ext:3414 + 1.0 + 1.0 + Multiple + Optional + + + Payload + RW + Single + Mandatory + String + + + Content of the message that is to be transported. + + + Hash + RW + Single + Optional + String + + + Hash to check the consistency of the data payload. Hash mechanism and calculation is vendor-specific. + + + Cumulated daily data volume up + R + Single + Optional + Integer + + B + Cumulated volume of data received by the device since beginning of the day. This information could be used for data invoicing. + + + Cumulated daily data volume down + R + Single + Optional + Integer + + B + Cumulated volume of data sent by the device since beginning of the day. This information could be used for data invoicing. + + + Cumulated daily data volume total + R + Single + Optional + Integer + + B + Cumulated volume of data sent and received by/from the device since beginning of the day. This information could be used for data invoicing. + + + Communication error + R + Single + Optional + Boolean + + + Set to True if the device detects a difference in a received payload and the hash. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3415.xml b/application/src/main/data/lwm2m-registry/3415.xml new file mode 100644 index 0000000000..5a76ca93a3 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3415.xml @@ -0,0 +1,98 @@ + + + + + + + Time synchronization + The uCIFI time synchronization object enables a device to sync-up its internal clock with a remote NTP server. + 3415 + urn:oma:lwm2m:ext:3415 + 1.0 + 1.0 + Single + Optional + + + NTP server address + RW + Single + Mandatory + String + + + Hostname or IP address of the Network Time Protocol server. + + + Backup NTP server address + RW + Single + Optional + String + + + Hostname or IP address of a backup NTP server to be used in case the main NTP server does not respond. + + + NTP period + RW + Single + Optional + String + + + Number of hours before which the device tries to reach the NTP server for time synchronization. + + + Last time sync + R + Single + Optional + Integer + + h + Last time at which a successful time synchronization occurred. + + + Time sync error + R + Single + Optional + Boolean + + + Set to True in case the latest time synchronization operation failed. Set to False in case the last operation succeeded. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3416.xml b/application/src/main/data/lwm2m-registry/3416.xml new file mode 100644 index 0000000000..bf9f23b6ac --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3416.xml @@ -0,0 +1,518 @@ + + + + + + + Outdoor lamp controller + The uCIFI outdoor lamp controller object provides attributes to control, command and monitor outdoor luminaires in streets, in tunnels, on roads and for illumination of park and gardens. + 3416 + urn:oma:lwm2m:ext:3416 + 1.0 + 1.0 + Multiple + Optional + + + Command + RW + Single + Mandatory + Integer + 0..100 + /100 + Command (e.g. manual override, scheduler) sent to the outdoor lamp controller. + + + Command in action + R + Single + Optional + Integer + 0..100 + /100 + For outdoor lighting applications, the command in action (this resource) may differ from a command that was sent (resource ID: 1), due to LPWAN network constraints and/or light adjustments within the lamp’s control gear (e.g. virtual power settings). The command in action is the actual value of the command in action in the outdoor lamp controller. + + + Dimming level + R + Single + Mandatory + Integer + 0..100 + /100 + Dimming level (0 for OFF and 100% for ON) measured on the outdoor lamp controller. + + + Default dimming level + RW + Single + Optional + Integer + 0..100 + /100 + The default dimming level that the outdoor lamp controller applies when the device is powered ON. + + + Lamp failure + R + Single + Optional + Boolean + + + Set to True if the outdoor lamp controller detects that the lamp is not producing light while it is expected to (e.g. the lamp is broken). + + + Lamp failure reason + R + Single + Optional + Integer + + + Description of the reason why the lamp failed (e.g. low power on a LED engine, no consumption detected while relay closed). + + + Control gear failure + R + Single + Optional + Boolean + + + Set to True in case the control gear has a failure. Outdoor lamp controllers may read the control gear failure from a DALI bus or by analyzing a 0-10 volts interface to the control gear. + + + Control gear failure reason + R + Single + Optional + Integer + + + Description of the reason why the control gear failed. You may refer to the DiiA list of possible control gear failures. + + + Relay failure + R + Single + Optional + Boolean + + + Set to True if the outdoor lamp controller detects that its relay is not operating as it is expected to. + + + Day burner + R + Single + Optional + Boolean + + + Set to True in case the lamp is ON while it should be OFF (e.g. day burner). + + + Cycling failure + R + Single + Optional + Boolean + + + Set to True if the outdoor lamp controller detects that the lamp is switching ON and OFF too often. + + + Control gear communication failure + R + Single + Optional + Boolean + + + Set to True in case the control gear (e.g. LED driver) does not answer on the DALI bus. + + + Scheduler ID + RW + Multiple + Optional + Integer + + + Identifier(s) of the scheduler(s) that are assigned to the Command of this outdoor lamp controller. + + + Invalid scheduler + R + Single + Optional + Boolean + + + Set to True when one of the schedulers can’t be executed or is not supported by the outdoor lamp controller. Otherwise set to False. + + + Lamp operating hours + R + Single + Optional + Integer + + h + Cumulated number of hours during which the lamp has been ON with a strictly positive dimming level. + + + Lamp operating hours reset + E + Single + Optional + + + + Reset of the lamp operating hours counter. + + + Lamp ON timestamp + R + Single + Optional + Time + + + Last date and time at which the lamp switched ON, i.e. from no light to light (e.g. power off to power on and/or dim level = 0 to dim level > 0). + + + Lamp switch counter + R + Single + Optional + Integer + + + Number of times the lamp was switched from ON to OFF since the last lamp switch counter reset. + + + Lamp switch counter reset + E + Single + Optional + + + + Reset the lamp switch counter. + + + Control gear start counter + R + Single + Optional + Integer + + + Number of times the control gear was switched from ON to OFF. + + + Control gear temperature + R + Single + Optional + Float + + Cel + Temperature measured by the control gear and transmitted to the device through DALI, Zhaga D4i or equivalent. + + + Control gear thermal derating + R + Single + Optional + Boolean + + + Set to True if the control gear has derated the light source due to high temperature. + + + Control gear thermal derating counter + R + Single + Optional + Integer + + + Number of time the control gear has derated the light source due to a high temperature, since last counter reset. + + + Control gear thermal derating counter reset + E + Single + Optional + + + + Reset of the control gear thermal derating counter. + + + Control gear thermal shutdown + R + Single + Optional + Boolean + + + Set to True if the control gear has shut the light source down due to high temperature. + + + Control gear thermal shutdown counter + R + Single + Optional + Integer + + + Number of times the control gear has shutdown the light source since last counter reset. + + + Control gear thermal derating counter reset + E + Single + Optional + + + + Reset of the control gear shutdown counter. + + + Output port + RW + Single + Optional + Integer + + + Address or reference of the output port (e.g. DALI port address or 1-10 volt output) in case of multiple control gears. + + + Standby mode + RW + Single + Optional + Boolean + + + Set to True if the outdoor lamp controller should keep its relay closed (control gear is powered ON) when command and/or dimming level is equal to 0. Set to False if the outdoor lamp controller should open its relay (control gear is not powered ON) when command and/or dimming level is equal to 0. + + + Constant light output + RW + Single + Optional + Boolean + + + Set to True to activate Constant Light Output dimming correction on the outdoor lamp controller. Set to False to deactivate Constant Light Output. + + + Cleaning factor enabled + RW + Single + Optional + Boolean + + + Light output of a luminaire may depend on the lamp cleaning factor. Cleaning factor may be used as a light output compensation. Set to True to activate lamp cleaning correction on the outdoor lamp controller. Set to False to deactivate the lamp cleaning correction. + + + Cleaning period + RW + Single + Optional + Integer + + + Number of days after which cleaning factor is back to 100%. + + + Initial lamp cleaning factor + RW + Single + Optional + Integer + 0..100 + /100 + Initial lamp cleaning correction factor to multiply to the command when the luminaire is cleaned, at the lamp cleaning date. + + + Lamp cleaning date + RW + Single + Optional + Time + + + Date at which the luminaire was last (or will be next) cleaned and the lamp cleaning factor should be set to the initial lamp cleaning factor. + + + Control type + RW + Single + Optional + Integer + 0..13 + + Type of control system with whioch the outdoor lamp controller switches, dims and monitors the lamp. The possible control types are: 0: No dimming control, 1 : DALI part 201 - Device Type 0, 2 : DALI part 202 - Device Type 1, 3 : DALI part 203 - Device Type 2, 4 : DALI part 204 - Device Type 3, 5 : DALI part 205 - Device Type 4, 6 : DALI part 206 - Device Type 5, 7 : DALI part 207 - Device Type 6, 8 : DALI part 208 - Device Type 7, 9 : DALI part 209 - Device Type 8, 10 : 0-10V, 11 : PWM, 12 : PWM_N, 13 : Other + + + Nominal Lamp wattage + RW + Single + Optional + Integer + + W + Active power of the light source at 100% dimming level. + + + Minimum dimming level + RW + Single + Optional + Integer + + /100 + Minimum dimming level under which the lamp will most probably not operate. + + + Minimum lamp wattage + RW + Single + Optional + Integer + + W + Expected active power of the light source at its minimum dimming level. This value may be used to detect failure at low dimming level. + + + Light color temperature command + RW + Single + Optional + String + + K + Latest light color temperature command sent to the lamp actuator. + + + Actual light color temperature + R + Single + Optional + String + + K + The actual light color temperature of the light source. + + + Virtual power output + RW + Single + Optional + Integer + 0..100 + /100 + Percentage of nominal power at which the light source should be set when the Command is set to 100%. + + + Voltage at max dim level + RW + Single + Optional + Float + + V + Voltage level on the control port that corresponds to maximum dimming level. This applies only if Control Type = 0-10V. + + + Voltage at min dim level + RW + Single + Optional + Float + + V + Voltage level on the control port that corresponds to minimum dimming level. This applies only if Control Type = 0-10V. + + + Light source voltage + R + Single + Optional + Float + + V + Voltage (usually DC voltage) to the light source or generic load, measured at the output of the control gear. + + + Light source current + R + Single + Optional + Float + + A + Current (usually DC current) delivered by the control gear to the light source or generic load, measured at the output of the control gear. + + + Light source active power + R + Single + Optional + Float + + W + Active power of the light source or generic load, measured at the output of the control gear. + + + Light source active energy + R + Single + Optional + Float + + kWh + Cumulated active energy consumption of the light source or generic load, measured at the output of the control gear. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3417.xml b/application/src/main/data/lwm2m-registry/3417.xml new file mode 100644 index 0000000000..d22a318d84 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3417.xml @@ -0,0 +1,188 @@ + + + + + + + Luminaire asset + The uCIFI luminaire asset is an object that enables outdoor lighting control software to configure outdoor lamp controllers. It also enables outdoor lamp controllers to send Zhaga D4i or DALI attributes read from the control gears, to centrally managed outdoor lighting control software or asset management systems. + 3417 + urn:oma:lwm2m:ext:3417 + 1.0 + 1.0 + Multiple + Optional + + + Asset GTIN + R + Single + Mandatory + String + + + Global trade-in international number used in the Luminaire Asset controlled by the device. + + + Year of manufacture + RW + Single + Optional + Integer + + + Year of manufacture of the luminaire. + + + Week of manufacture + RW + Single + Optional + Integer + + + Week of manufacture of the luminaire. + + + Nominal light output + RW + Single + Optional + Integer + + lm + Nominal light output of the luminaire. + + + Light distribution type + RW + Single + Optional + Integer + + + Enumeration of possible light distribution type, using the Zhaga D4i enumeration. Please refer to ZD4i standard for more details. + + + Luminaire color + RW + Single + Optional + String + + + Painting color of the luminaire. + + + Nominal input power + R + Single + Optional + Float + + W + Nominal input power of the luminaire. + + + Power at minimum dim level + R + Single + Optional + Float + + W + Power at minimum dim level for the luminaire. + + + Nominal max AC mains voltage + R + Single + Optional + Integer + + V + Nominal max AC mains voltage for the luminaire to operate. + + + Nominal min AC mains voltage + R + Single + Optional + Integer + + V + Nominal min AC mains voltage for the luminaire to operate. + + + CRI + R + Single + Optional + Integer + 0..100 + + Color rendering index (0 to 100) of the luminaire. + + + CCT value + R + Single + Optional + Integer + + K + Color temperature of the luminaire. + + + Luminaire identification + R + Single + Optional + String + + + Luminaire identification as per DiiA/D4i specification part 251 (MB1 extension): 60 ascii character string. + + + Luminaire identification number + R + Single + Optional + String + + + Luminaire identification number as per DiiA/D4i specification part 251 (MB1 extension): 20 digit number. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3418.xml b/application/src/main/data/lwm2m-registry/3418.xml new file mode 100644 index 0000000000..6ff07dfa94 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3418.xml @@ -0,0 +1,348 @@ + + + + + + + Electrical monitor + The uCIFI electrical monitor object provides attributes related to the analysis of electrical consumption in an outdoor luminaire or in a streetlight cabinet. It also identifies electrical anomalies. + 3418 + urn:oma:lwm2m:ext:3418 + 1.0 + 1.0 + Multiple + Optional + + + Supply voltage + R + Single + Optional + Float + + V + Electrical voltage supplied to the device. + + + Supply current + R + Single + Optional + Float + + A + Electrical current supplied to the device. + + + Frequency + R + Single + Optional + Float + + Hz + Frequency of the supply current to the device. + + + Active power + R + Single + Optional + Float + + W + Active power consumed by the device and its electrical load. + + + Power factor + R + Single + Optional + Float + -1..1 + + Power factor is equal to active power divided by apparent power. The value is between -1 and +1. + + + Cumulated active energy + R + Single + Optional + Float + + kWh + Cumulated number of kWh measured by the device and its load since last energy counter reset. + + + Energy reset + E + Single + Optional + + + + Reset both cumulated active and reactive energy counter. + + + Low power factor threshold + RW + Single + Optional + Float + + + Threshold below which the device should trigger a low power factor event. + + + Low power factor + R + Single + Optional + Boolean + + + Set to True if the power factor is below threshold. This is an absolute value threshold. + + + Low power threshold + RW + Single + Optional + Float + + W + Threshold below which the device should trigger a low power event. + + + Low power threshold at low dim level + RW + Single + Optional + Float + + W + Threshold below which the device should trigger a low power event. This is an addition to the low power threshold to allow a separated threshold when dim level is low. + + + Low power + R + Single + Optional + Boolean + + + Set to True if the power is below threshold. Vendor may consider the Low power threshold at low dim level to set this resource to True, taking into account the lamp dim level. + + + High power threshold + RW + Single + Optional + Float + + W + Threshold above which the device should trigger a high power event. + + + High power threshold at low dim level + RW + Single + Optional + Float + + W + Threshold above which the device should trigger a high power event. This is an addition to the high power threshold to allow a separated threshold when dim level is low. + + + High power + R + Single + Optional + Boolean + + + Set to True if the power is above threshold. Vendor may consider the High power threshold at low dim level to set this resource to True, taking into account the lamp dim level. + + + Low current threshold + RW + Single + Optional + Float + + A + Threshold below which the device should trigger a low current event. + + + Low current + R + Single + Optional + Boolean + + + Set to True if the current is below threshold. + + + High current threshold + RW + Single + Optional + Float + + A + Threshold above which the device should trigger a high current event. + + + High current + R + Single + Optional + Boolean + + + Set to True if the current is above threshold. + + + Low voltage threshold + RW + Single + Optional + Float + + V + Threshold below which the device should trigger a low voltage event. + + + Low voltage + R + Single + Optional + Boolean + + + Set to True if the voltage is below threshold. + + + High voltage threshold + RW + Single + Optional + Float + ON;OFF + V + Threshold above which the device should trigger a high voltage event. + + + High voltage + R + Single + Optional + Boolean + + + Set to True if the voltage is above threshold. + + + Critical inrush threshold + RW + Single + Optional + Float + + A + Threshold above which the device should trigger a critical inrush event. + + + Critical inrush current + R + Single + Optional + Boolean + + + Set to True if the inrush current is above threshold. + + + Minimum inrush Current + R + Single + Optional + Float + + A + Minimum inrush current since last configuration. + + + Maximum inrush Current + R + Single + Optional + Float + + A + Maximum inrush current since last configuration. + + + Latest inrush Current + R + Single + Optional + Float + + A + Latest inrush current measured since last time the relay switched ON. + + + Reactive power + R + Single + Optional + Float + + var + Instantaneous reactive power measured by the device and its electrical load. + + + Reactive energy + R + Single + Optional + Float + + varh + Cumulative reactive power measured by the device and its electrical load since last energy counter reset. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3419.xml b/application/src/main/data/lwm2m-registry/3419.xml new file mode 100644 index 0000000000..88b66119a7 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3419.xml @@ -0,0 +1,78 @@ + + + + + + + Photocell + A uCIFI photocell object is used for lighting control, particularly to identify when light should be switched ON/OFF. + 3419 + urn:oma:lwm2m:ext:3419 + 1.0 + 1.0 + Multiple + Optional + + + ON lux level + RW + Single + Optional + Float + + lx + Lux level below which the photocell switches its relay ON or sends a switch ON message on the network. + + + OFF lux level + RW + Single + Optional + Float + + lx + Lux level above which the photocell switches its relay OFF or sends a switch OFF message on the network. + + + Photocell status + R + Single + Optional + Boolean + + + Set to True if lux level is below ON lux level. Set to False if lux level is above OFF lux. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3420.xml b/application/src/main/data/lwm2m-registry/3420.xml new file mode 100644 index 0000000000..835f4ec8a5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3420.xml @@ -0,0 +1,58 @@ + + + + + + + LED color light + The uCIFI LED color light enables to control light colors of a LED luminaire. + 3420 + urn:oma:lwm2m:ext:3420 + 1.0 + 1.0 + Multiple + Optional + + + RGB value + RW + Single + Mandatory + String + + + Text string according to the RBG hexadecimal format with # (e.g. #FF0000 for 100% red). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3421.xml b/application/src/main/data/lwm2m-registry/3421.xml new file mode 100644 index 0000000000..dadf8d8f47 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3421.xml @@ -0,0 +1,618 @@ + + + + + + + Single-phase electrical meter + The uCIFI single-phase electrical meter measures the electrical consumption of loads on one electrical line, such as electrical cabinets in city infrastructures, street lighting networks, homes and buildings. + 3421 + urn:oma:lwm2m:ext:3421 + 1.0 + 1.0 + Multiple + Optional + + + Voltage + R + Single + Mandatory + Float + + V + Instantaneous voltage measured between line and neutral. + + + Low voltage threshold + R + Single + Optional + Float + + V + Set to True when voltage is below low voltage threshold. + + + Low voltage + R + Single + Optional + Boolean + + + Set to True when voltage is below low voltage threshold. + + + High voltage threshold + R + Single + Optional + Float + + V + Threshold above which the high voltage resource is set to True. + + + High voltage + R + Single + Optional + Boolean + + + Set to True when voltage is above high voltage threshold. + + + Current + R + Single + Mandatory + Float + + A + Instantaneous current measured. + + + Low current threshold + R + Single + Optional + Float + + A + Threshold below which the low current resource is set to True. + + + Low current + R + Single + Optional + Boolean + + + Set to True when current is below low current threshold. + + + High current threshold + R + Single + Optional + Float + + V + Threshold above which the high current resource is set to True. + + + High current + R + Single + Optional + Boolean + + + Set to True when current is above high current threshold. + + + Frequency + R + Single + Optional + Float + + Hz + Instantaneous frequency measured. + + + Angle of I-U + R + Single + Optional + Float + + deg + Instantaneous phase angle measured. + + + Instantaneous Power Factor + R + Single + Mandatory + Float + + + Instantaneous power factor overall. + + + Low power factor threshold + R + Single + Optional + Float + + + Threshold below which the low power factor resource is set to True. + + + Low power factor + R + Single + Optional + Boolean + + + Set to True when power factor is below low power factor threshold. + + + Active power+ (QI+QIV) + R + Single + Mandatory + Float + + W + Active power import + + + Active power- (QII+QIII) + R + Single + Optional + Float + + W + Active power export. + + + Reactive power+ (QI+QII) + R + Single + Optional + Float + + var + Reactive power import. + + + Reactive power- (QIII+QIV) + R + Single + Optional + Float + + var + Reactive power export + + + Instantaneous Apparent Power import (+VA) + R + Single + Optional + Float + + VA + Instantaneous apparent power import. + + + Instantaneous Apparent Power export (-VA) + R + Single + Optional + Float + + VA + Instantaneous apparent power export. + + + Instantaneous Active Power (|+A|+|-A|) + R + Single + Optional + Float + + W + Instantaneous active power. + + + Instantaneous Net Active Power (|+A|-|-A|) + R + Single + Optional + Float + + W + Instantaneous net active power. + + + Measurement period of Instantaneous value + R + Single + Optional + Float + + s + Measurement period of instantaneous value. + + + Active energy import (+A) Un + R + Single + Mandatory + Float + + Wh + Active energy import (unified rate). + + + Active energy export (-A) Un + R + Single + Optional + Float + + Wh + Active energy export (unified rate). + + + Active energy (|+A|+|-A|) Combined total + R + Single + Optional + Float + + Wh + Active energy (|+A|+|-A|) Combined total. + + + Active energy (|+A|-|-A|) Combined total + R + Single + Optional + Float + + Wh + Active energy (|+A|-|-A|) Combined total. + + + Reactive energy import (+R) Un + R + Single + Optional + Float + + varh + Reactive energy import (unified rate) + + + Reactive energy export (-R) Un + R + Single + Optional + Float + + varh + Reactive energy export (unified rate). + + + Reactive energy QI (+Ri) Un + R + Single + Optional + Float + + varh + Reactive energy QI (+Ri) (unified rate). + + + Reactive energy QII (+Rc) Un + R + Single + Optional + Float + + varh + Reactive energy QII (+Rc) (unified rate). + + + Reactive energy QIII (-Ri) Un + R + Single + Optional + Float + + varh + Reactive energy QIII (-Ri) (unified rate). + + + Reactive energy QIV (-Rc) Un + R + Single + Optional + Float + + varh + Reactive energy QIV (-Rc) (unified rate). + + + Apparent energy import Un + R + Single + Optional + Float + + VAh + Apparent energy import (unified rate). + + + Apparent energy export Un + R + Single + Optional + Float + + VAh + Apparent energy export (unified rate). + + + Number of power failures + R + Single + Optional + Float + + + Number of power failures. + + + Number of long power failures + R + Single + Optional + Float + + + Number of long power failures. + + + Time threshold for long power failure + RW + Single + Optional + Float + + s + Time threshold for long power failure. + + + Duration of last long power failure + R + Single + Optional + Float + + s + Duration of last long power failure. + + + Threshold for voltage sag + RW + Single + Optional + Float + + V + Threshold for voltage sag. + + + Time threshold for voltage sag + RW + Single + Optional + Float + + s + Time threshold for voltage sag. + + + Number of voltage sags + R + Single + Optional + Float + + + Number of voltage sags. + + + Duration of last voltage sag + R + Single + Optional + Float + + s + Duration of last voltage sag. + + + Magnitude of last voltage sag + R + Single + Optional + Float + + V + Magnitude of last voltage sag. + + + Threshold for voltage swell + RW + Single + Optional + Float + + V + Threshold for voltage sag. + + + Time threshold for voltage swell + RW + Single + Optional + Float + + s + Time threshold for voltage sag. + + + Number of voltage swells + R + Single + Optional + Float + + + Number of voltage sags. + + + Duration of last voltage swell + R + Single + Optional + Float + + s + Duration of last voltage sag. + + + Magnitude of last voltage swell + R + Single + Optional + Float + + V + Magnitude of last voltage swell. + + + Threshold for missing voltage (voltage cut) + RW + Single + Optional + Float + + V + Threshold for missing voltage (voltage cut). + + + Time threshold for voltage cut + RW + Single + Optional + Float + + s + Time threshold for voltage cut. + + + Voltage cut + R + Single + Optional + Boolean + + + Set to True if a voltage cut for a time above the time threshold and for a voltage below the voltage threshold is detected. + + + CT Numerator Parameter + RW + Single + Optional + Float + + + Transformer ratio - current (numerator). + + + CT Denominator Parameter + RW + Single + Optional + Float + + + Transformer ratio - voltage (denominator). + + + VT Numerator Parameter + RW + Single + Optional + Float + + + Transformer ratio - current (numerator). + + + VT Denominator Parameter + RW + Single + Optional + Float + + + Transformer ratio - voltage (denominator). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3423.xml b/application/src/main/data/lwm2m-registry/3423.xml new file mode 100644 index 0000000000..6e0aaf3b21 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3423.xml @@ -0,0 +1,158 @@ + + + + + + + Gas meter + The uCIFI gas meter measures the volume of gas that was distributed through the gas meter, in pulse count and/or in m3. It also detects anomalies in the gas meter. + 3423 + urn:oma:lwm2m:ext:3423 + 1.0 + 1.0 + Multiple + Optional + + + Cumulated gas volume + R + Single + Mandatory + Float + + m3 + Number of cubic meters of gas distributed through the meter since last reset. + + + Cumulated gas meter value reset + E + Single + Optional + + + + Reset the cumulated meter value. + + + Type of meter + RW + Single + Optional + String + + + Type of gas meter. + + + Cumulated pulse value + R + Single + Optional + Integer + + + Cumulated number of pulses detected on the gas meter. + + + Cumulated pulse value reset + E + Single + Optional + + + + Reset the cumulated pulse value. + + + Pulse ratio + RW + Single + Optional + Integer + + + Ratio to calculate gas volume from pulse value. + + + Minimum flow rate + R + Single + Optional + Float + + m3/s + Minimum flow rate since last metering value. + + + Maximum flow rate + R + Single + Optional + Float + + m3/s + Maximum flow rate since last metering value. + + + Leak suspected + R + Single + Optional + Boolean + + + Set to True if gas leak is suspected. + + + Leak detected + R + Single + Optional + Boolean + + + Set to True if gas leak is detected. + + + High temperature + R + Single + Optional + Boolean + + + Set to True if high temperature is detected around the gas meter. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3424.xml b/application/src/main/data/lwm2m-registry/3424.xml new file mode 100644 index 0000000000..01df43cbaf --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3424.xml @@ -0,0 +1,178 @@ + + + + + + + Water meter + The uCIFI water meter measures water volume that was distributed through a water meter, in pulse count as well as in m3. It also detects anomalies in the water meter. + 3424 + urn:oma:lwm2m:ext:3424 + 1.0 + 1.0 + Multiple + Optional + + + Cumulated water volume + R + Single + Mandatory + Float + + m3 + Number of cubic meters of water distributed through the meter since last reset. + + + Cumulated water meter value reset + E + Single + Optional + + + + Reset the cumulated meter value. + + + Type of meter + RW + Single + Optional + String + + + Type of water meter. + + + Cumulated pulse value + R + Single + Optional + Integer + + + Cumulated number of pulses detected on the meter. + + + Cumulated pulse value reset + E + Single + Optional + + + + Reset the cumulated pulse value. + + + Pulse ratio + RW + Single + Optional + Integer + + + Ratio to calculate water volume from pulse value. + + + Minimum flow rate + R + Single + Optional + Float + + m3/s + Minimum flow rate since last metering value. + + + Maximum flow rate + R + Single + Optional + Float + + m3/s + Maximum flow rate since last metering value. + + + Leak suspected + R + Single + Optional + Boolean + + + Set to True if water leak is suspected. + + + Leak detected + R + Single + Optional + Boolean + + + Set to True if leak is detected. + + + Back flow detected + R + Single + Optional + Boolean + + + Set to True if water back flow is detected. + + + Blocked meter + R + Single + Optional + Boolean + + + Set to True if water meter is blocked. + + + Fraud detected + R + Single + Optional + Boolean + + + Set to True if fraud is detected. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3425.xml b/application/src/main/data/lwm2m-registry/3425.xml new file mode 100644 index 0000000000..dd94f14dfd --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3425.xml @@ -0,0 +1,108 @@ + + + + + + + Irrigation valve + The uCIFI irrigation valve provides a way to control and monitor an irrigation valve. + 3425 + urn:oma:lwm2m:ext:3425 + 1.0 + 1.0 + Multiple + Optional + + + Default status + RW + Single + Optional + Integer + 0..100 + /100 + Default status (level of opening of the valve from 0 to 100%) that is applied when the device is powered ON. + + + Status + R + Single + Optional + Integer + 0..100 + /100 + Actual level of opening of the valve (from 0 to 100%). + + + Command + RW + Single + Optional + Integer + 0..100 + /100 + Command (e.g. manual override, scheduler) sent to the irrigation valve. + + + Command in action + R + Single + Optional + Integer + 0..100 + /100 + For devices connected on slow LPWAN networks, the command in action (this resource) may differ from a command that was sent (resource ID: 3). The command in action is the actual value of the command in action on the irrigation valve. + + + Scheduler ID + RW + Multiple + Optional + Integer + + + Identifiers of the schedulers that are assigned to the Command of this irrigation valve. + + + Invalid scheduler + R + Single + Optional + Boolean + + + Set to True when one of the schedulers can’t be executed or is not supported by this irrigation valve. Otherwise set to False. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3426.xml b/application/src/main/data/lwm2m-registry/3426.xml new file mode 100644 index 0000000000..7f33c1bc1a --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3426.xml @@ -0,0 +1,188 @@ + + + + + + + Water quality sensor + The uCIFI water quality sensor measures the quality of the water in the drinkable water distribution network, in water tanks or in lakes and rivers. + 3426 + urn:oma:lwm2m:ext:3426 + 1.0 + 1.0 + Multiple + Optional + + + pH + R + Single + Optional + Float + + + Current or last value of the pH measured by the sensor. + + + Chlorine + R + Single + Optional + Float + + ppm + Current or last value of the chlorine measured by the sensor. + + + Redox or ORP + R + Single + Optional + Float + + V + Current or last value of the oxidation reduction potential measured by the sensor. + + + Total dissolved gas or TDG + R + Single + Optional + Float + + ppm + Current or last value of the dissolved gas measured by the sensor. + + + Dissolved oxygen + R + Single + Optional + Float + + ppm + Current or last value of the dissolved oxygen measured by the sensor. + + + Turbidity + R + Single + Optional + Float + + NTU + Current or last value of the turbidity measured by the sensor using the Nephelometric Turbidity Unit (NTU). + + + Conductivity + R + Single + Optional + Float + + S/m + Current or last value of the conductivity measured by the sensor. + + + Conductance + R + Single + Optional + Float + + S/m + Current or last value of the conductance measured by the sensor. + + + Total suspended solids + R + Single + Optional + Float + + mg/l + Current or last value of the TSS measured by the sensor. + + + Total dissolved solids + R + Single + Optional + Float + + mg/l + Current or last value of the TDS measured by the sensor. + + + Salinity + R + Single + Optional + Float + + ppt + Current or last value of the salinity measured by the sensor. + + + NO3 + R + Single + Optional + Float + + mg/l + Current or last value of NO3 measured by the sensor. + + + NH3 + R + Single + Optional + Float + + mg/l + Current or last value of NH3 measured by the sensor. + + + NH4 + R + Single + Optional + Float + + mg/l + Current or last value of NH4 measured by the sensor. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3427.xml b/application/src/main/data/lwm2m-registry/3427.xml new file mode 100644 index 0000000000..4ffe60c2bc --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3427.xml @@ -0,0 +1,138 @@ + + + + + + + Pressure monitoring sensor + The uCIFI water pressure monitoring sensor measures water pressure and help identify water leaks in water distribution pipelines. + 3427 + urn:oma:lwm2m:ext:3427 + 1.0 + 1.0 + Multiple + Optional + + + Pressure + R + Single + Mandatory + Float + + Pa + Last or current pressure value measured by the sensor. + + + Sampling period + RW + Single + Optional + Integer + + s + Number of seconds between two measurement. + + + Leak detected + R + Single + Optional + Boolean + + + Set to True if a water leak is detected by the sensor. + + + Hammer effect detected + R + Single + Optional + Boolean + + + Set to True if hammer effect is detected in the water pipeline. + + + Minimum measured pressure value + R + Single + Optional + Float + + Pa + Minimum value measured by the sensor since power ON or reset. + + + Maximum measured pressure value + R + Single + Optional + Float + + Pa + Maximum value measured by the sensor since power ON or reset. + + + Minimum range pressure value + R + Single + Optional + Float + + Pa + Minimum value that can be measured by the sensor. + + + Maximum range pressure value + R + Single + Optional + Float + + Pa + Maximum value that can be measured by the sensor. + + + Reset min and max measured pressure values + E + Single + Optional + + + + Set the minimum and maximum measured values to current value. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3428.xml b/application/src/main/data/lwm2m-registry/3428.xml new file mode 100644 index 0000000000..68dab08269 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3428.xml @@ -0,0 +1,268 @@ + + + + + + + Air quality + The uCIFI air quality sensor reports measurement required to calculate Air Quality Index (AIQ. It also provides resources for average calculation as per the IQ index calculation. + 3428 + urn:oma:lwm2m:ext:3428 + 1.0 + 1.0 + Multiple + Optional + + + PM10 + R + Single + Optional + Float + + ug/m3 + Level of PM10 measured by the air quality sensor. + + + PM10 24 hour average + R + Single + Optional + Float + + ug/m3 + Average level of PM10 measured by the sensor during the last 24 hours. + + + PM2.5 + R + Single + Optional + Float + + ug/m3 + Level of PM2.5 measured by the air quality sensor. + + + PM2.5 24 hour average + R + Single + Optional + Float + + ug/m3 + Average level of PM2.5 measured by the sensor during the last 24 hours. + + + PM1 + R + Single + Optional + Float + + ug/m3 + Level of PM1 measured by the air quality sensor. + + + PM1 24 hour average + R + Single + Optional + Float + + ug/m3 + Average level of PM1 measured by the sensor during the last 24 hours. + + + CO + R + Single + Optional + Float + + ppm + Level of carbon monoxide measured by the air quality sensor. + + + CO 8 hour average + R + Single + Optional + Float + + ppm + Average level of carbon monoxide measured by the sensor during the last 8 hours. + + + SO2 + R + Single + Optional + Float + + ppm + Level of sulfur dioxide measured by the air quality sensor. + + + SO2 1 hour average + R + Single + Optional + Float + + ppm + Average level of sulfur dioxide measured by the sensor during the last 1 hour. + + + SO2 24 hour average + R + Single + Optional + Float + + ppm + Average level of sulfur dioxide measured by the sensor during the last 24 hours. + + + O3 + R + Single + Optional + Float + + ppm + Level of ozone measured by the air quality sensor. + + + O3 1 hour average + R + Single + Optional + Float + + ppm + Average level of ozone measured by the sensor during the last 1 hour. + + + O3 8 hour average + R + Single + Optional + Float + + ppm + Average level of ozone measured by the sensor during the last 8 hour. + + + NO2 + R + Single + Optional + Float + + ppm + Level of nitrogen dioxide measured by the air quality sensor. + + + NO2 1 hour average + R + Single + Optional + Float + + ppm + Average level of nitrogen dioxide measured by the sensor during the last 1 hour. + + + CO2 + R + Single + Optional + Float + + ppm + Level of carbon dioxide measured by the air quality sensor. + + + CO2 1 hour average + R + Single + Optional + Float + + ppm + Average level of carbon dioxide measured by the sensor during the last 1 hour. + + + NO + R + Single + Optional + Float + + ppm + Level of nitric oxide measured by the air quality sensor. + + + NO 1 hour average + R + Single + Optional + Float + + ppm + Average level of nitric oxide measured by the sensor during the last 1 hour. + + + H2S + R + Single + Optional + Float + + ppm + Level of hydrogen sulfid measured by the air quality sensor. + + + H2S 1 hour average + R + Single + Optional + Float + + ppm + Average level of hydrogen sulfid measured by the sensor during the last 1 hour. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3429.xml b/application/src/main/data/lwm2m-registry/3429.xml new file mode 100644 index 0000000000..e5f6f46b75 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3429.xml @@ -0,0 +1,108 @@ + + + + + + + Tilt sensor + The uCIFI tilt sensor provides the angle between the object's internal vertical and the perpendicular to the earth. + 3429 + urn:oma:lwm2m:ext:3429 + 1.0 + 1.0 + Multiple + Optional + + + Angle + R + Single + Mandatory + Float + + rad + Angle between the internal vertical line and the perpendicular to earth. + + + Minimum measured Angle + R + Single + Optional + Float + + rad + Minimum angle measured by the tilt sensor since last reset or since power ON if no reset. + + + Maximum measured angle + R + Single + Optional + Float + + rad + Maximum angle measured by the tilt sensor since last reset or since power ON if no reset. + + + Reset min max angles + E + Single + Optional + + + + Set the minimum and maximum measured angles to the current angle value. + + + Out of position threshold + RW + Single + Optional + Float + + rad + The angle above which the device triggers an out of position event. + + + Out of position + R + Single + Optional + Boolean + + + Set to True if the angle is above the out of position threshold. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3430.xml b/application/src/main/data/lwm2m-registry/3430.xml new file mode 100644 index 0000000000..76a14c0656 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3430.xml @@ -0,0 +1,371 @@ + + + + + + + Global Navigation Satellite System + More than a positioning object, the uCIFI global navigation satellite system object provides all the information required to calculate a position/location. + 3430 + urn:oma:lwm2m:ext:3430 + 1.0 + 1.0 + Single + Optional + + + Fix timestamp + R + Single + Mandatory + Time + + s + Timestamp of when the location measurement was performed. + + + Latitude + R + Single + Mandatory + Float + + lat + Decimal notation of latitude, e.g. -43.5723 [World Geodetic System 1984]. This value ranges from [-90, 90]. + + + Longitude + R + Single + Mandatory + Float + + lon + Decimal notation of longitude, e.g. 153.21760 [World Geodetic System 1984]. This value ranges from [-180, 180]. + + + Altitude + R + Single + Optional + Float + + m + Altitude above mean sea level in meters. + + + Speed + R + Single + Optional + Integer + + m/s + Horizontal speed calculated by the device. + + + Heading + R + Single + Optional + Float + + deg + Direction that the device is following + + + Radius + R + Single + Optional + Float + + m + Radius of a circular area corresponding to the location’s uncertainty (GPS data precision). Negative values indicate that the radius is not available. + + + HDOP + R + Single + Optional + Float + + + Horizontal dilution of precision. + + + VDOP + R + Single + Optional + Float + + + Vertical dilution of precision. + + + Estimated horizontal accuracy + R + Single + Optional + Float + + m + Estimated horizontal accuracy. + + + Estimated vertical accuracy + R + Single + Optional + Float + + m + Estimated vertical accuracy. + + + Estimated speed accuracy + R + Single + Optional + Float + + m/s + Estimated speed accuracy. + + + Estimated heading accuracy + R + Single + Optional + Float + + deg + Estimated heading accuracy. + + + Fix type + R + Single + Optional + Integer + + + + + + + Fix dimension + R + Single + Optional + Integer + + + + + + + Used satellites + R + Single + Optional + Integer + + + Number of satellites used for the fix. + + + Visible satellites + R + Single + Optional + Integer + + + Number of satellites viewed. Represent all the satellites seen but some of them cannot be in use (e.g. bad signal). + + + Satellite identifiers + R + Multiple + Optional + String + + + Identifier of the satellite. + + + Satellite identifiers + R + Multiple + Optional + Float + + deg + Elevation of the satellite. + + + Satellite azimuth + R + Multiple + Optional + Float + + deg + Azimuth of the satellite. + + + Almanac + R + Single + Optional + Boolean + + + + + + + Ephemeris + R + Multiple + Optional + Boolean + + + + + + + Signal-to-noise ratio + R + Multiple + Optional + Float + + dB + Strength of the signal for each satellite, also called carrier-to-noise. + + + GNSS + R + Multiple + Optional + Integer + + + + + + + Hardware RTC + R + Single + Optional + Time + + s + Time of the internal clock of the GNSS hardware. + + + Assisted GPS + RW + Single + Optional + Boolean + + + Set to True if the almanac is obtained via a cellular connection. Set to False otherwise. + + + Power command + RW + Single + Optional + Boolean + + + Command to switch the hardware ON or OFF and status of the device. + + + PDOP + R + Single + Optional + Float + + + Dilution of precision (NMEA-0183 GSA). + + + Status + R + Single + Mandatory + String + + + Status A=active or V=Void (NMEA-0183 RMC). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3431.xml b/application/src/main/data/lwm2m-registry/3431.xml new file mode 100644 index 0000000000..8f0ec363d1 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3431.xml @@ -0,0 +1,98 @@ + + + + + + + Parking Sensor + The uCIFI parking sensor provides actual and cumulated occupancy duration as well as forbidden parking detection. + 3431 + urn:oma:lwm2m:ext:3431 + 1.0 + 1.0 + Multiple + Optional + + + Occupancy + R + Single + Mandatory + Boolean + + + Set to True if the parking place is occupied. Set to False if the parking place is free. + + + Duration + R + Single + Optional + Integer + + s + Number of seconds since the parking place is occupied. If not occupied, duration shows the duration of the last occupation. + + + Daily Duration + R + Single + Optional + Integer + + s + Cumulated occupation time since beginning of the day. + + + Forbidden parking detected + R + Single + Optional + Boolean + + + Set to True if the vehicle present on the parking place is not authorized. Set to False if parking place is free or if the vehicle is authorized. + + + Type of Sensor + RW + Single + Optional + String + + + Type of sensor (e.g. PIR, camera). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3432.xml b/application/src/main/data/lwm2m-registry/3432.xml new file mode 100644 index 0000000000..4816248320 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3432.xml @@ -0,0 +1,218 @@ + + + + + + + Traffic Counter + The uCIFI traffic counter provides vehicle counting and traffic analysis data. A traffic counting device may implement multiple instances of this traffic counter object, each of them being in charge of counting different categories of vehicles (e.g. bikes, cars, trucks). + 3432 + urn:oma:lwm2m:ext:3432 + 1.0 + 1.0 + Multiple + Optional + + + Cumulated number + R + Single + Optional + Integer + + + Cumulated number of vehicles counted since last reset. + + + Reset cumulated number + E + Single + Optional + + + + Reset the cumulated number of vehicles. + + + Cumulated number today + R + Single + Mandatory + Integer + + + Cumulated number of vehicles counted today. + + + Measuring period 1 + RW + Single + Optional + Integer + + s + Time period 1 during which the counter shall provide number of vehicles (e.g. 1 hour). + + + Measuring period 2 + RW + Single + Optional + Integer + + s + Time period 2 during which the counter shall provide number of vehicles (e.g. 15 minutes). + + + Measuring period 3 + RW + Single + Optional + Integer + + s + Time period 3 during which the counter shall provide number of vehicles (e.g. 5 minutes). + + + Cumulated number during last period 1 + R + Single + Optional + Integer + + + Cumulated number of vehicles counted during the last period 1 (e.g. 1 hour). + + + Cumulated number during last period 2 + R + Single + Optional + Integer + + + Cumulated number of vehicles counted during the last period 2 (e.g. 15 minutes). + + + Cumulated number during last period 3 + R + Single + Optional + Integer + + + Cumulated number of vehicles counted during the last period 3 (e.g. 5 minutes). + + + Average speed during last period 1 + R + Single + Optional + Integer + + + Average speed measured on the vehicles during the last period 1 (e.g. 1 hour). + + + Average speed during last period 2 + R + Single + Optional + Integer + + + Average speed measured on the vehicles during the last period 2 (e.g. 15 minutes). + + + Average speed during last period 3 + R + Single + Optional + Integer + + + Average speed measured on the vehicles during the last period 3 (e.g. 5 minutes). + + + Average distance during last period 1 + R + Single + Optional + Integer + + + Average distance between two vehicles measured during the last period 1 (e.g. 1 hour). + + + Average distance during last period 2 + R + Single + Optional + Integer + + + Average distance between two vehicles measured during the last period 2 (e.g. 15 minutes). + + + Average distance during last period 3 + R + Single + Optional + Integer + + + Average distance between two vehicles measured during the last period 3 (e.g. 5 minutes). + + + Speed limit threshold + RW + Single + Optional + Integer + + + Speed limit threshold used to calculate the percentage of vehicles above speed limit. + + + Percentage above speed limit + R + Single + Optional + Integer + + + Percentage of vehicles driving above speed limit. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3433.xml b/application/src/main/data/lwm2m-registry/3433.xml new file mode 100644 index 0000000000..018f2af954 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3433.xml @@ -0,0 +1,128 @@ + + + + + + + Noise sensor + The uCIFI noise sensor reports a noise measurement in decibel. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the noise sensor and some specific alarms resulting from noise analysis by the device. + 3433 + urn:oma:lwm2m:ext:3433 + 1.0 + 1.0 + Multiple + Optional + + + Gunshot detected + R + Single + Optional + Boolean + + + Set to True when a gunshot is detected. + + + Abnormal noise detected + R + Single + Optional + Boolean + + + Set to True when an abnormal noise is detected. + + + Sensor Value + R + Single + Mandatory + Float + + + Last or current measured value from the Sensor. + + + Minimum measured value + R + Single + Optional + Float + + dB + Minimum value measured by the sensor since power ON or reset. + + + Maximum measured value + R + Single + Optional + Float + + dB + Maximum value measured by the sensor since power ON or reset. + + + Minimum range value + R + Single + Optional + Float + + dB + Minimum value that can be measured by the sensor. + + + Maximum range value + R + Single + Optional + Float + + dB + Maximum value that can be measured by the sensor. + + + Reset min and max values + E + Single + Optional + + + + Reset the min and max measured values to current value. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3434.xml b/application/src/main/data/lwm2m-registry/3434.xml new file mode 100644 index 0000000000..b06852cbe1 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3434.xml @@ -0,0 +1,128 @@ + + + + + + + People counter + The uCIFI people counter provides people counting information using Bluetooth beacon or any other method. + 3434 + urn:oma:lwm2m:ext:3434 + 1.0 + 1.0 + Multiple + Optional + + + Actual number of persons + R + Single + Mandatory + Integer + + + Number of persons currently identified by the device. + + + Daily number of persons + R + Single + Optional + Integer + + + Cumulated number of persons detected by the device since beginning of the day. + + + Cumulated number of persons + R + Single + Optional + Integer + + + Cumulated number of persons detected by the device since last reset. + + + Reset of cumulated number + E + Single + Optional + + + + Reset the cumulated number of persons. + + + Daily number of passages + R + Single + Optional + Integer + + + Number of passages (same people could be counted multiple times if identified several times) today. + + + Cumulated number of passages + R + Single + Optional + Integer + + + Cumulated number of passages since last reset. + + + Reset of cumulated number of passages + E + Single + Optional + + + + Reset the cumulated number of passages. + + + Type of sensor + RW + Single + Optional + String + + + Type of sensor (e.g. Bluetooth beacon, WIFI detector). + + + + + diff --git a/application/src/main/data/lwm2m-registry/3435.xml b/application/src/main/data/lwm2m-registry/3435.xml new file mode 100644 index 0000000000..1694afc32b --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3435.xml @@ -0,0 +1,178 @@ + + + + + + + Filling level + The uCIFI filling level sensor measures how full and/or how empty a container (e.g. waste, fuel) is and reports it either in percentage or in centimeters. The filling level sensor may be complemented with a temperature sensor to compose a waste filling sensor that can also identify waste container fire. + 3435 + urn:oma:lwm2m:ext:3435 + 1.0 + 1.0 + Multiple + Optional + + + Container height + RW + Single + Optional + Integer + + cm + Height of the container. + + + Actual filling percentage + R + Single + Mandatory + Float + + /100 + Percentage of container filled with content. + + + Actual filling level + R + Single + Optional + Integer + + cm + Height of content in the container. + + + High threshold + RW + Single + Optional + Float + + /100 + Threshold above which the container is considered full. + + + Container full + R + Single + Mandatory + Boolean + + + Set to True if the actual filling percentage is above the high threshold. + + + Low threshold + RW + Single + Optional + Float + + /100 + Threshold below which the container is considered empty. + + + Container empty + R + Single + Mandatory + Boolean + + + Set to True if the actual filling percentage is below the low threshold. + + + Average filling speed + R + Single + Optional + Float + + /100 + Average percentage filled per day. + + + Average filling speed reset + E + Single + Optional + + + + Reset average filling speed. + + + Forecast full date + R + Single + Optional + Time + + + Next date at which the container should reach the high threshold. + + + Forecast empty date + R + Single + Optional + Time + + + Next date at which the container should reach the low threshold. + + + Container out of location + R + Single + Optional + Boolean + + + Set to True if the container is not at the location where it should be. + + + Container out of position + R + Single + Optional + Boolean + + + Set to True if the container is not in correct upright position. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3436.xml b/application/src/main/data/lwm2m-registry/3436.xml new file mode 100644 index 0000000000..a450edf280 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3436.xml @@ -0,0 +1,98 @@ + + + + + + + Edge computing manager + The uCIFI edge computing manager object defines the capability of a device to run scripts on the device itself. + 3436 + urn:oma:lwm2m:ext:3436 + 1.0 + 1.0 + Single + Optional + + + Max number of scripts + R + Single + Optional + Integer + + + Maximum number of scripts supported by the device. + + + Number of free slots for scripts + R + Single + Optional + Integer + + + Number of free slots to store new scripts. + + + Max number of conditions + R + Single + Optional + Integer + + + Maximum number of conditions supported by the device. + + + Number of free slots for conditions + R + Single + Optional + Integer + + + Number of free slots to store new conditions. + + + Edge-computing capabilities + R + Single + Optional + String + + + Vendor-specific resource to share the capabilities of the devices as regards to edge computing. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3437.xml b/application/src/main/data/lwm2m-registry/3437.xml new file mode 100644 index 0000000000..284911326e --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3437.xml @@ -0,0 +1,118 @@ + + + + + + + Edge computing script + The uCIFI edge computing scripts object defines a particular script to be executed by a device under a time or any other condition set by a "Edge Computing Time Condition" or "Edge Computing Generic Condition" object. + 3437 + urn:oma:lwm2m:ext:3437 + 1.0 + 1.0 + Multiple + Optional + + + Name + RW + Single + Optional + String + + + Name of the script. + + + Signature + RW + Single + Optional + String + + + Unique hash or signature associated to the script to be verified by the end-device before execution. The format of the hash or signature is vendor-specific. + + + Version + RW + Single + Optional + String + + + Version of the script, as defined by the vendor. + + + Script + RW + Single + Mandatory + Opaque + + + Vendor-specific script. + + + Script format + RW + Single + Optional + String + + + Script format to enable the device to select the script interpreter in case it supports multiple (e.g. LUA). The format of this resource is free to support vendor-specific formats. + + + Non supported script + R + Single + Optional + Boolean + + + Set to True if the script is not supported or if the device has identified errors in the script. + + + Non authorized script + R + Single + Optional + Boolean + + + Set to True if the hash/signature is not correct. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3438.xml b/application/src/main/data/lwm2m-registry/3438.xml new file mode 100644 index 0000000000..2e2405c161 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3438.xml @@ -0,0 +1,78 @@ + + + + + + + Edge computing time condition + The uCIFI edge computing time condition object defines the day/time (defined as a CRON rule) at which a particular script should be executed by a device. + 3438 + urn:oma:lwm2m:ext:3438 + 1.0 + 1.0 + Multiple + Optional + + + Execution time/day + RW + Single + Mandatory + String + + + Date/time at which the script should be executed, formatted as a CRON rule. + + + Script identifier + RW + Multiple + Mandatory + String + + + Object URN/Resource ID of the script to apply to the times/days defined in the execution time/day resource. + + + Non supported time condition + R + Single + Optional + Boolean + + + Set to True if the device can’t support the condition. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3439.xml b/application/src/main/data/lwm2m-registry/3439.xml new file mode 100644 index 0000000000..b702866ce0 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3439.xml @@ -0,0 +1,78 @@ + + + + + + + Edge computing generic condition + The uCIFI edge computing generic condition object defines a vendor-specific condition (e.g. when a resource or an object is equal to a particular value) at which a particular script should be executed by the device. + 3439 + urn:oma:lwm2m:ext:3439 + 1.0 + 1.0 + Multiple + Optional + + + Vendor condition + RW + Single + Optional + Opaque + + + Condition described in a vendor specific way. + + + Script identifier + RW + Multiple + Mandatory + String + + + Object URN/Resource ID of the script to apply to the time/days defined in the vendor condition resource. + + + Non supported time condition + R + Single + Optional + Boolean + + + Set to True if the device can’t support the condition. + + + + + diff --git a/application/src/main/data/lwm2m-registry/3441.xml b/application/src/main/data/lwm2m-registry/3441.xml new file mode 100644 index 0000000000..bdd5efca6c --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3441.xml @@ -0,0 +1,262 @@ + + + + + LwM2M v1.0 Test Object + + 3441 + urn:oma:lwm2m:ext:3441 + 1.0 + 1.0 + Multiple + Optional + + + Reset values + E + Single + Optional + + + + Reset all resources of this object with their initial value. + + + Randomize values + E + Single + Optional + + + + + + + + + Clear values + E + Single + Optional + + + + + + + + + Exec With Arguments + E + Single + Optional + + + + + + + + + Arguments List + R + Multiple + Optional + String + + + List of Arguments from last execute on "Exec With Arguments"(3) resource. This resource is not affected by the "Randomize values"(1) executable resource. + + + + String Value + RW + Single + Optional + String + + + Initial value must be "initial value". + + + + Integer Value + RW + Single + Optional + Integer + + + Initial value must be "1024". + + + + Float Value + RW + Single + Optional + Float + + + Initial value must be "3.14159". + + + + Boolean Value + RW + Single + Optional + Boolean + + + Initial value must be "true". + + + Opaque Value + RW + Single + Optional + Opaque + + + Initial value must be the bytes sequence "0123456789ABCDEF" (Hexadecimal notation). + + + + Time Value + RW + Single + Optional + Time + + + Initial value must be the time to an 1st, 2000 in the UTC time zone. (Timestamp value : 946684800) + + + ObjLink Value + RW + Single + Optional + Objlnk + + + Initial value must be a link to instance 0 of Device Object 3 (3:0). + + + Multiple String Value + RW + Multiple + Optional + String + + + Initial value must be 1 instance with ID 0 and value "initial value". + + + Multiple Integer Value + RW + Multiple + Optional + Integer + + + Initial value must be 1 instance with ID 0 and value "1024". + + + Multiple Float Value + RW + Multiple + Optional + Float + + + Initial value must be 1 instance with ID 0 and value "3.14159". + + + Multiple Boolean Value + RW + Multiple + Optional + Boolean + + + Initial value must be 1 instance with ID 0 and value "true". + + + Multiple Opaque Value + RW + Multiple + Optional + Opaque + + + Initial value must be 1 instance with ID 0 and value "0123456789ABCDEF"(Hexadecimal notation of the bytes sequence). + + + Multiple Time Value + RW + Multiple + Optional + Time + + + Initial value must be 1 instance with ID 0 and value 1st, 2000 in the UTC time zone (Timestamp value : 946684800). + + + Multiple ObjLink Value + RW + Multiple + Optional + Objlnk + + + Initial value must be 1 instance with ID 0 and value "3:0". + + + + + diff --git a/application/src/main/data/lwm2m-registry/3442.xml b/application/src/main/data/lwm2m-registry/3442.xml new file mode 100644 index 0000000000..b4607cead7 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/3442.xml @@ -0,0 +1,332 @@ + + + + + LwM2M v1.1 Test Object + + 3442 + urn:oma:lwm2m:ext:3442 + 1.1 + 1.0 + Multiple + Optional + + + Reset values + E + Single + Optional + + + + Reset all resources of this object with their initial value. + + + Randomize values + E + Single + Optional + + + + + + + + + Clear values + E + Single + Optional + + + + + + + + + Exec With Arguments + E + Single + Optional + + + + + + + + + Arguments List + R + Multiple + Optional + String + + + List of Arguments from last execute on "Exec With Arguments"(3) resource. This resource is not affected by "Randomize values"(1) executable resource. + + + + Send Data + E + Single + Optional + + + + + + + + + Resources to Send + RW + Multiple + Optional + String + + + List of path to LWM2M node (Object / Object Instance / Resource / Resource Instance) used by "Send Data "(5) resource. This resource is not affected by "Randomize values"(1) executable resource. + + + + String Value + RW + Single + Optional + String + + + Initial value must be "initial value". + + + + Integer Value + RW + Single + Optional + Integer + + + Initial value must be "1024". + + + + Unsigned Integer Value + RW + Single + Optional + Unsigned Integer + + + Initial value must be 2^63 (9223372036854775808). + + + + Float Value + RW + Single + Optional + Float + + + Initial value must be "3.14159". + + + + Boolean Value + RW + Single + Optional + Boolean + + + Initial value must be "true". + + + Opaque Value + RW + Single + Optional + Opaque + + + Initial value must be the bytes sequence "0123456789ABCDEF" (Hexadecimal notation). + + + + Time Value + RW + Single + Optional + Time + + + Initial value must be the time to an 1st, 2000 in the UTC time zone. (Timestamp value : 946684800) + + + ObjLink Value + RW + Single + Optional + Objlnk + + + Initial value must be a link to instance 0 of Device Object 3 (3:0). + + + CoreLnk Value + RW + Single + Optional + Corelnk + + + ".]]> + + + Multiple String Value + RW + Multiple + Optional + String + + + Initial value must be 1 instance with ID 0 and value "initial value". + + + Multiple Integer Value + RW + Multiple + Optional + Integer + + + Initial value must be 1 instance with ID 0 and value "1024". + + + Multiple Unsigned Integer Value + RW + Multiple + Optional + Unsigned Integer + + + Initial value must be 1 instance with ID 0 and value 2^63 (9223372036854775808). + + + + Multiple Float Value + RW + Multiple + Optional + Float + + + Initial value must be 1 instance with ID 0 and value "3.14159". + + + Multiple Boolean Value + RW + Multiple + Optional + Boolean + + + Initial value must be 1 instance with ID 0 and value "true". + + + Multiple Opaque Value + RW + Multiple + Optional + Opaque + + + Initial value must be 1 instance with ID 0 and value "0123456789ABCDEF"(Hexadecimal notation of the bytes sequence). + + + Multiple Time Value + RW + Multiple + Optional + Time + + + Initial value must be 1 instance with ID 0 and value 1st, 2000 in the UTC time zone (Timestamp value : 946684800). + + + Multiple ObjLink Value + RW + Multiple + Optional + Objlnk + + + Initial value must be 1 instance with ID 0 and value "3:0". + + + Multiple CoreLnk Value + RW + Multiple + Optional + Corelnk + + + ".]]> + + + + + diff --git a/application/src/main/data/lwm2m-registry/4.xml b/application/src/main/data/lwm2m-registry/4.xml new file mode 100644 index 0000000000..dc3f100cc4 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/4.xml @@ -0,0 +1,258 @@ + + + + + + + Connectivity Monitoring + + 4 + urn:oma:lwm2m:oma:4:1.3 + 1.1 + 1.3 + Single + Optional + + + Network Bearer + R + Single + Mandatory + Integer + 0..50 + + + + + Available Network Bearer + R + Multiple + Mandatory + Integer + 0..50 + + + + + Radio Signal Strength + R + Single + Mandatory + Integer + + dBm + + + + Link Quality + R + Single + Optional + Integer + + + + + + IP Addresses + R + Multiple + Mandatory + String + + + + + + Router IP Addresses + R + Multiple + Optional + String + + + + + + Link Utilization + R + Single + Optional + Integer + 0..100 + /100 + + + + APN + R + Multiple + Optional + String + + + + + + Cell ID + R + Single + Optional + Integer + + + + + + SMNC + R + Single + Optional + Integer + 0..999 + + + + + SMCC + R + Single + Optional + Integer + 0..999 + + + + SignalSNR + R + Single + Optional + Integer + + dB + + + + LAC + R + Single + Optional + Integer + + + + + + Coverage Enhancement Level + R + Single + Optional + Integer + 0..4 + + + + + + diff --git a/application/src/main/data/lwm2m-registry/5.xml b/application/src/main/data/lwm2m-registry/5.xml new file mode 100644 index 0000000000..02188533b2 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/5.xml @@ -0,0 +1,255 @@ + + + + + + + Firmware Update + + 5 + urn:oma:lwm2m:oma:5:1.1 + 1.1 + 1.1 + Single + Optional + + + Package + W + Single + Mandatory + Opaque + + + + + + Package URI + RW + Single + Mandatory + String + 0..255 + + + + + Update + E + Single + Mandatory + + + + + + + State + R + Single + Mandatory + Integer + 0..3 + + + + + Update Result + R + Single + Mandatory + Integer + 0..11 + + + + + PkgName + R + Single + Optional + String + 0..255 + + + + + PkgVersion + R + Single + Optional + String + 0..255 + + + + + Firmware Update Protocol Support + R + Multiple + Optional + Integer + 0..5 + + + + + Firmware Update Delivery Method + R + Single + Mandatory + Integer + 0..2 + + + + + Cancel + E + Single + Optional + + + + + + + Severity + RW + Single + Optional + Integer + 0..2 + + + + + Last State Change Time + R + Single + Optional + Time + + + + + + Maximum Defer Period + RW + Single + Optional + Unsigned Integer + + s + + + + + + diff --git a/application/src/main/data/lwm2m-registry/500.xml b/application/src/main/data/lwm2m-registry/500.xml new file mode 100644 index 0000000000..df21a5aa80 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/500.xml @@ -0,0 +1,189 @@ + + + + + + + CoAP Config + + + + 500 + urn:oma:lwm2m:oma:500 + 1.0 + 1.0 + Multiple + Optional + + + Network Bearer + RW + Single + Mandatory + Integer + 0..255 + + + + + + + ACK_TIMEOUT + RW + Single + Mandatory + Integer + + s + + + + + + ACK_RANDOM_FACTOR + RW + Single + Mandatory + Float + + + + + + + + MAX_RETRANSMIT + RW + Single + Mandatory + Integer + + + + + + + + NSTART + RW + Single + Mandatory + Integer + + + + + + + + DEFAULT_LEISURE + RW + Single + Optional + Integer + + s + + + + + + PROBING_RATE + RW + Single + Optional + Integer + + B/s + + + + + + DTLS Retransmission Timer + RW + Single + Optional + Integer + + s + + + + + + Max Response Waiting Time + RW + Single + Optional + Integer + + + + + + + + Apply + E + Single + Optional + + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/501.xml b/application/src/main/data/lwm2m-registry/501.xml new file mode 100644 index 0000000000..402cfc0b78 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/501.xml @@ -0,0 +1,163 @@ + + + + + + + LTE-MTC Band Config + + + + 501 + urn:oma:lwm2m:oma:501 + 1.0 + 1.0 + Multiple + Optional + + + EARFCN + RW + Single + Mandatory + Integer + 0..65535 + + + + + + + Current Frequency (Downlink) + R + Single + Mandatory + Float + + MHz + + + + + + Current Frequency (Uplink) + R + Single + Optional + Float + + MHz + + + + + + Prioritized Channels + RW + Multiple + Mandatory + Integer + + + + + + + + Application Type + RW + Single + Optional + String + + + + + + + + Reset Timeout + RW + Single + Mandatory + Float + + s + + + + + + Reset + E + Single + Mandatory + + + + + + + + + Vendor specific extensions + R + Single + Optional + Objlnk + + + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/502.xml b/application/src/main/data/lwm2m-registry/502.xml new file mode 100644 index 0000000000..5b85aa4515 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/502.xml @@ -0,0 +1,214 @@ + + + + + + + CO Detector + + 502 + urn:oma:lwm2m:oma:502 + 1.0 + 1.0 + Multiple + Optional + + + CO Sensor Location Tag + RW + Single + Optional + String + + + + + + CO Detected + R + Single + Mandatory + Boolean + + + + + + Ambient CO Value + RW + Single + Optional + Float + 0..12800 + ppm + + + + CO Value + R + Single + Mandatory + Float + 0..12800 + ppm + + + + Min CO Range Value + R + Single + Optional + Float + 0..12800 + ppm + + + + Max CO Range Value + R + Single + Optional + Float + 0..12800 + ppm + + + + CO Detection Accuracy + R + Single + Optional + Float + 0..12800 + ppm + + + + Minimum Measured CO Value + R + Single + Optional + Float + 0..12800 + ppm + + + + Maximum Measured CO Value + R + Single + Optional + Float + 0..12800 + ppm + + + + Upper CO Threshold + RW + Single + Optional + Float + 0..12800 + ppm + + + + Reset + E + Single + Optional + + + + + + + Alarm loudness + R + Single + Optional + Float + + dB + + + + Latitude + R + Single + Optional + String + + + + + + Longitude + R + Single + Optional + String + + + + + + Altitude + R + Single + Optional + Float + + m + + + + Battery Percentage + R + Single + Optional + Float + 0.00..100.00 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/503.xml b/application/src/main/data/lwm2m-registry/503.xml new file mode 100644 index 0000000000..6c6e627a94 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/503.xml @@ -0,0 +1,434 @@ + + + + + + + Fire Alarm + + 503 + urn:oma:lwm2m:oma:503 + 1.0 + 1.0 + Multiple + Optional + + + Temperature Sensor Location Tag + RW + Single + Optional + String + + + + + + Temperature Unit + RW + Single + Mandatory + Integer + + + + + + Ambient Temperature + RW + Single + Optional + Float + + + + + + Temperature Value + R + Single + Mandatory + Float + + + + + + Minimum Measured Temperature Value + R + Single + Optional + Float + + + + + + Maximum Measured Temperature Value + R + Single + Optional + Float + + + + + + Min Temperature Range Value + RW + Single + Optional + Float + + + + + + Max Temperature Range Value + RW + Single + Optional + Float + + + + + + Lower Temperature Accuracy + RW + Single + Optional + Float + + + + + + Upper Temperature Accuracy + RW + Single + Optional + Float + + + + + + Temperature Threshold + RW + Single + Optional + Float + + + + + + Temperature Sensor Error + R + Single + Optional + Boolean + + + + + + Reset Temperature + E + Single + Optional + + + + + + + Temperature Alarm Loudness + RW + Single + Optional + Float + + dB + + + + Humidity Sensor Location Tag + RW + Single + Optional + String + + + + + + Ambient Relative Humidity + RW + Single + Optional + Float + 0.0..100.0 + %RH + + + + Humidity Value + R + Single + Mandatory + Float + 0.0..100.0 + /100 + + + + Minimum Measured Humidity Value + R + Single + Optional + Float + 0.0..100.0 + /100 + + + + Maximum Measured Humidity Value + R + Single + Optional + Float + 0.0..100.0 + /100 + + + + Humidity Accuracy + RW + Single + Optional + Float + 0.0..100.0 + /100 + + + + Humidity Threshold + RW + Single + Optional + Float + 0.0..100.0 + /100 + + + + Humidity Sensor Error + R + Single + Optional + Boolean + + + + + + Reset Humidity + E + Single + Optional + + + + + + + Humidity Alarm Loudness + RW + Single + Optional + Float + + dB + + + + Smoke Sensor Location Tag + RW + Single + Optional + String + + + + + + CO2 Alarm State + R + Single + Mandatory + Boolean + + + + + + Ambient CO2 Value + R + Single + Optional + Float + + ppm + + + + CO2 Value + R + Single + Mandatory + Float + + ppm + + + + Minimum Measured CO2 Value + R + Single + Optional + Float + + ppm + + + + Maximum Measured CO2 Value + R + Single + Optional + Float + + ppm + + + + CO2 Threshold + RW + Single + Optional + Float + + ppm + + + + Smoke Sensor Error + R + Single + Optional + Boolean + + + + + + Reset Smoke Detection + E + Single + Optional + + + + + + + Smoke Alarm Loudness + R + Single + Optional + Float + + dB + + + + Battery Percentage + R + Single + Optional + Float + 0.00..100.00 + + + + + Latitude + R + Single + Optional + String + + + + + + Longitude + R + Single + Optional + String + + + + + + Altitude + R + Single + Optional + Float + + m + + + + + + diff --git a/application/src/main/data/lwm2m-registry/504.xml b/application/src/main/data/lwm2m-registry/504.xml new file mode 100644 index 0000000000..25c033f59d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/504.xml @@ -0,0 +1,341 @@ + + + + + + + Remote SIM Provisioning + + 504 + urn:oma:lwm2m:oma:504 + 1.0 + 1.0 + Multiple + Optional + + + Current SIM Type + R + Single + Mandatory + Integer + 0..3 + + + + + Supported SIM Type + R + Multiple + Mandatory + Integer + 0..3 + + + + + Service Provider Name + R + Single + Optional + String + + + + + + Download URI/Information + RW + Single + Optional + String + 0..255 + + + + + RSP Update + E + Single + Optional + + + + + + + RSP Update State + R + Single + Optional + Integer + 0..10 + + + + + RSP Update Result + R + Single + Optional + Integer + 0..16 + + + + + Profile Name + R + Single + Optional + String + 0..255 + + + + + Profile Package Version + R + Single + Optional + String + 0..255 + + + + + Free Memory on SIM + R + Single + Optional + Integer + + KiB + + + + Total Memory on SIM + R + Single + Optional + Integer + + KiB + + + + Integrated Circuit Card Identifier (ICCID) + R + Multiple + Mandatory + String + + + + + + eUICC ID + R + Single + Optional + String + + + + + + RSP Type + R + Single + Mandatory + Integer + + + + + + Selected ICCID for RSP operation + RW + Single + Optional + String + + + + + + RSP Consent Reason + R + Single + Optional + String + + + + + + RSP User Consent + W + Single + Optional + Integer + 0..1 + + + + + RSP Confirmation Code + W + Single + Optional + String + + + + + + RSP Data Type + RW + Single + Optional + Integer + 0..17 + + + + + Set RSP Data + W + Single + Optional + Opaque + + + + + + Get RSP Data + R + Single + Optional + Opaque + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/505.xml b/application/src/main/data/lwm2m-registry/505.xml new file mode 100644 index 0000000000..a89c59ca41 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/505.xml @@ -0,0 +1,262 @@ + + + + + + + LwM2M SIM Provisioning + + 505 + urn:oma:lwm2m:oma:505 + 1.0 + 1.0 + Multiple + Optional + + + Current SIM Type + R + Single + Mandatory + Integer + 0..3 + + + + + Supported SIM Type + R + Multiple + Mandatory + Integer + 0..3 + + + + + Service Provider Name + R + Single + Mandatory + String + + + + + + Profile Package + W + Single + Optional + Opaque + + + + + + Profile URI + RW + Single + Optional + String + 0..255 + + + + + Update Profile + E + Single + Optional + + + + + + + Update State + R + Single + Mandatory + Integer + 0..3 + + + + + Update Result + R + Single + Mandatory + Integer + 0..8 + + + + + Profile Name + R + Single + Optional + String + 0..255 + + + + + Profile Package Version + R + Single + Optional + String + 0..255 + + + + + Profile Update Protocol Support + R + Multiple + Optional + Integer + 0..3 + + + + + Profile Update Delivery Method + R + Single + Mandatory + Integer + 0..2 + + + + + Free Memory on SIM + R + Single + Optional + Integer + + KiB + + + + Total Memory on SIM + R + Single + Optional + Integer + + KiB + + + + Integrated Circuit Card Identifier (ICCID) + R + Multiple + Optional + Integer + + + + + + eUICC ID + R + Single + Optional + String + + + + + + Profile Type + R + Single + Optional + String + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/507.xml b/application/src/main/data/lwm2m-registry/507.xml new file mode 100644 index 0000000000..650a0e8904 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/507.xml @@ -0,0 +1,115 @@ + + + + + + nuSIM Profile + This device management object contains the elements of a nuSIM profile package according to nuSIM Technical Specification NTS.01. + 507 + urn:oma:lwm2m:oma:507 + 1.0 + 1.0 + Multiple + Optional + + + encP + RW + Single + Mandatory + String + + + + + mac + RW + Single + Mandatory + String + + + + + eKpubDP + RW + Single + Mandatory + String + + + + + + SigEKpubDP + RW + Single + Mandatory + String + + + + + + KpubDP + RW + Single + Mandatory + String + + + + + + SigKpubDP + RW + Single + Mandatory + String + + + + + + KpubCl + RW + Single + Mandatory + String + + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/508.xml b/application/src/main/data/lwm2m-registry/508.xml new file mode 100644 index 0000000000..7f45059dd5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/508.xml @@ -0,0 +1,115 @@ + + + + + + nuSIM + This device management object represents a nuSIM integrated SIM according to NTS.01 - nuSIM Integrated SIM Specification. + 508 + urn:oma:lwm2m:oma:508 + 1.0 + 1.0 + Single + Optional + + + EID + R + Single + Mandatory + String + + + + + + ICCID + R + Single + Mandatory + String + + + + + + nuSIM Capabilities + R + Single + Mandatory + Opaque + + + + + nuSIM Cert + R + Single + Optional + String + + + + + + nuSIM Profile + RW + Single + Mandatory + Objlnk + + + + + Load Profile + E + Single + Mandatory + + + + + + + Load Profile Result + R + Single + Mandatory + Integer + 0..255 + + + + + + + diff --git a/application/src/main/data/lwm2m-registry/509.xml b/application/src/main/data/lwm2m-registry/509.xml new file mode 100644 index 0000000000..17ff50250f --- /dev/null +++ b/application/src/main/data/lwm2m-registry/509.xml @@ -0,0 +1,138 @@ + + + + + + + Measurement Metadata + This object contains measurement metadata for sensor objects. The corresponding sensor is identified with an object link. If the LwM2M Client provides measurement quality information both inside the sensor objects and in the Measurement Metadata object, it MUST ensure that identical data is reported in corresponding object instances. The LwM2M Server SHOULD use the data from the Measurement Metadata object if both are available. The LwM2M Client also MUST ensure that no two Measurement Metadata object instances link to the same sensor object instance. If the LwM2M Server receives such non-conforming data, the Measurement Metadata object instance with largest Instance ID SHOULD be used. + + 509 + urn:oma:lwm2m:oma:509 + 1.1 + 1.0 + Multiple + Optional + + + Linked Sensor + R + Single + Mandatory + Objlnk + + + Link to the sensor object instance that this metadata relates to. + + + + Measurement Quality Reason Code + R + Multiple + Optional + Integer + 0..1023 + + Measurement quality degradation reason reported by a smart sensor. A degraded measurement has Measurement Quality Indicator value 1-3 or Measurement Quality Level less than 100. +0: UNKNOWN Reason is unknown. +1: UNDER_RANGE Measured value is under measurement range. +2: OVER_RANGE Measured value is over measurement range. +3: NOISY Measured value seems to change too quickly. +4: STUCK_VALUE Measured value seems to change too slowly. +5: STEP_TOO_HIGH Measured value has changed too much. +6: CALIBRATION_EXPIRED Sensor calibration has expired. +7: WARMING_UP Sensor is warming up. +8: SERVICE_MODE Sensor is under service. +9: HUMAN_INTERFERENCE Human presence near the sensor. +10: NATURAL_INTERFERENCE Natural phenomenon or animal presence. +11: CONTAMINATION Contamination of the sensor. +12: HW_FAILURE Sensor hardware has failed. +13: LACK_OF_DATA_SAMPLES Data sampling is lossy. +14: OUT_OF_OPERATING_RANGE Environment conditions exceeded. +15: AUTO_CALIBRATION Auto calibration in progress. +16-127: RESERVED_GENERIC_BLOCK Reserved generic block. +128-511: VENDOR_SPECIFIC_BLOCK Vendor specific block. +512-1023: RESERVED_VENDOR_BLOCK Reserved vendor specific block. + + + + Measurement Quality Indicator + R + Single + Optional + Integer + 0..23 + + Measurement quality indicator reported by a smart sensor. +0: UNCHECKED No quality checks were done because they do not exist or can not be applied. +1: REJECTED WITH CERTAINTY The measured value is invalid. +2: REJECTED WITH PROBABILITY The measured value is likely invalid. +3: ACCEPTED BUT SUSPICIOUS The measured value is likely OK. +4: ACCEPTED The measured value is OK. +5-15: Reserved for future extensions. +16-23: Vendor specific measurement quality. + + + + Measurement Quality Level + R + Single + Optional + Integer + 0..100 + + Measurement quality level reported by a smart sensor. Quality level 100 means that the measurement has fully passed quality check algorithms. Smaller quality levels mean that quality has decreased and the measurement has only partially passed quality check algorithms. The smaller the quality level, the more caution should be used by the application when using the measurement. When the quality level is 0 it means that the measurement should certainly be rejected. + + + + + + diff --git a/application/src/main/data/lwm2m-registry/510.xml b/application/src/main/data/lwm2m-registry/510.xml new file mode 100644 index 0000000000..302377bbff --- /dev/null +++ b/application/src/main/data/lwm2m-registry/510.xml @@ -0,0 +1,103 @@ + + + + + + + Vendor Specific Measurement Quality Reason + This object contains description for vendor specific measurement quality reason codes provided in a Measurement Metadata (509) object. Instances of this object define the mapping of vendor specific reason codes to reason description in the scope of an individual device. + + 510 + urn:oma:lwm2m:oma:510 + 1.1 + 1.0 + Multiple + Optional + + + Vendor Specific Quality Reason Code + R + Single + Mandatory + Integer + 128..1023 + + Measurement quality degradation reason reported by a smart sensor. Reason codes 0-127 are generic reason codes and they are defined in Measurement Metadata object description. +128-511: VENDOR_SPECIFIC_BLOCK Vendor specific block. This block contains vendor specific quality reason codes. +512-1023: RESERVED_VENDOR_BLOCK Reserved vendor specific block. This block is reserved for future use. + + + + Quality Reason Name + R + Single + Mandatory + String + 1..128 + + The name of the quality reason. It is used as a key to find a localized reason description. The name should be concise and unique in the localization scope. + + + + Quality Reason Description + R + Single + Mandatory + String + + + Description of the quality reason. This text can be used if a localized version is not found. + + + + + + diff --git a/application/src/main/data/lwm2m-registry/6.xml b/application/src/main/data/lwm2m-registry/6.xml new file mode 100644 index 0000000000..8b1b3da625 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/6.xml @@ -0,0 +1,143 @@ + + + + + + + Location + + 6 + urn:oma:lwm2m:oma:6 + 1.0 + 1.0 + Single + Optional + + + Latitude + R + Single + Mandatory + Float + + lat + + + + Longitude + R + Single + Mandatory + Float + + lon + + + + Altitude + R + Single + Optional + Float + + m + + + + Radius + R + Single + Optional + Float + + m + + + + Velocity + R + Single + Optional + Opaque + + + + + + Timestamp + R + Single + Mandatory + Time + + + + + Speed + R + Single + Optional + Float + + m/s + + + + + diff --git a/application/src/main/data/lwm2m-registry/7.xml b/application/src/main/data/lwm2m-registry/7.xml new file mode 100644 index 0000000000..451780da1f --- /dev/null +++ b/application/src/main/data/lwm2m-registry/7.xml @@ -0,0 +1,164 @@ + + + + + + + Connectivity Statistics + + 7 + urn:oma:lwm2m:oma:7 + 1.0 + 1.0 + Single + Optional + + + SMS Tx Counter + R + Single + Optional + Integer + + + + + + SMS Rx Counter + R + Single + Optional + Integer + + + + + + Tx Data + R + Single + Optional + Integer + + + + + + Rx Data + R + Single + Optional + Integer + + + + + + Max Message Size + R + Single + Optional + Integer + + B + + + + Average Message Size + R + Single + Optional + Integer + + B + + + + Start + E + Single + Mandatory + + + + + + Stop + E + Single + Mandatory + + + + + + Collection Period + RW + Single + Optional + Integer + + s + + + + + + diff --git a/application/src/main/data/lwm2m-registry/8.xml b/application/src/main/data/lwm2m-registry/8.xml new file mode 100644 index 0000000000..a9296999f5 --- /dev/null +++ b/application/src/main/data/lwm2m-registry/8.xml @@ -0,0 +1,141 @@ + + + + + + + Lock and Wipe + + 8 + urn:oma:lwm2m:oma:8 + 1.0 + 1.0 + Single + Optional + + State + RW + Single + Mandatory + Integer + 0..2 + + + + Lock target + W + Multiple + Mandatory + String + + + + + Wipe item + R + Multiple + Optional + String + + + + + Wipe + E + Single + Mandatory + + + + + + Wipe target + W + Multiple + Mandatory + String + + + + Lock or Wipe Operation Result + R + Single + Mandatory + Integer + 0..8 + + + + + + diff --git a/application/src/main/data/lwm2m-registry/9.xml b/application/src/main/data/lwm2m-registry/9.xml new file mode 100644 index 0000000000..4186b1248d --- /dev/null +++ b/application/src/main/data/lwm2m-registry/9.xml @@ -0,0 +1,321 @@ + + + + + + + LWM2M Software Management + + 9 + urn:oma:lwm2m:oma:9 + 1.0 + 1.0 + Multiple + Optional + + + PkgName + R + Single + Mandatory + String + 0..255 bytes + + + + + PkgVersion + R + Single + Mandatory + String + 0..255 bytes + + + + + Package + W + Single + Optional + Opaque + + + + + + Package URI + W + Single + Optional + String + 0..255 bytes + + + + + + Install + E + Single + Mandatory + + + + + + + Checkpoint + R + Single + Optional + Objlnk + + + + + + Uninstall + E + Single + Mandatory + + + + + + + Update State + R + Single + Mandatory + Integer + 0..4 + + + + + Update Supported Objects + RW + Single + Optional + Boolean + + + + + + Update Result + R + Single + Mandatory + Integer + 0..200 + + + + + Activate + E + Single + Mandatory + + + + + + + Deactivate + E + Single + Mandatory + + + + + + + Activation State + R + Single + Mandatory + Boolean + + + + + + Package Settings + RW + Single + Optional + Objlnk + + + + + + User Name + W + Single + Optional + String + 0..255 bytes + + + + + Password + W + Single + Optional + String + 0..255 bytes + + + + + Status Reason + R + Single + Optional + String + + + + + + Software Component Link + R + Multiple + Optional + Objlnk + + + + + + Software Component tree length + R + Single + Optional + Integer + 0..255 + + + + + + + diff --git a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java index c0f4bd5cf4..257db58a9b 100644 --- a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java +++ b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java @@ -26,6 +26,7 @@ import org.thingsboard.server.service.component.ComponentDiscoveryService; import org.thingsboard.server.service.install.DatabaseEntitiesUpgradeService; import org.thingsboard.server.service.install.DatabaseTsUpgradeService; import org.thingsboard.server.service.install.EntityDatabaseSchemaService; +import org.thingsboard.server.service.install.InstallScripts; import org.thingsboard.server.service.install.NoSqlKeyspaceService; import org.thingsboard.server.service.install.SystemDataLoaderService; import org.thingsboard.server.service.install.TsDatabaseSchemaService; @@ -88,6 +89,9 @@ public class ThingsboardInstallService { @Autowired(required = false) private TsLatestMigrateService latestMigrateService; + @Autowired + private InstallScripts installScripts; + public void performInstall() { try { if (isUpgrade) { @@ -242,6 +246,7 @@ public class ThingsboardInstallService { databaseEntitiesUpgradeService.upgradeDatabase("3.4.4"); log.info("Updating system data..."); systemDataLoaderService.updateSystemWidgets(); + installScripts.loadSystemLwm2mResources(); break; //TODO update CacheCleanupService on the next version upgrade default: @@ -284,6 +289,7 @@ public class ThingsboardInstallService { systemDataLoaderService.createQueues(); // systemDataLoaderService.loadSystemPlugins(); // systemDataLoaderService.loadSystemRules(); + installScripts.loadSystemLwm2mResources(); if (loadDemo) { log.info("Loading demo data..."); @@ -302,3 +308,4 @@ public class ThingsboardInstallService { } } + diff --git a/application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java b/application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java index 7f63ed5310..0ccb201cb9 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java +++ b/application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java @@ -21,7 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.thingsboard.server.common.data.Dashboard; +import org.thingsboard.server.common.data.ResourceType; import org.thingsboard.server.common.data.StringUtils; +import org.thingsboard.server.common.data.TbResource; +import org.thingsboard.server.common.data.exception.ThingsboardException; import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.oauth2.OAuth2ClientRegistrationTemplate; @@ -30,6 +33,7 @@ import org.thingsboard.server.common.data.rule.RuleChainMetaData; import org.thingsboard.server.common.data.widget.WidgetTypeDetails; import org.thingsboard.server.common.data.widget.WidgetsBundle; import org.thingsboard.server.dao.dashboard.DashboardService; +import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.oauth2.OAuth2ConfigTemplateService; import org.thingsboard.server.dao.resource.ResourceService; import org.thingsboard.server.dao.rule.RuleChainService; @@ -41,9 +45,11 @@ import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Base64; import java.util.Optional; import static org.thingsboard.server.service.install.DatabaseHelper.objectMapper; +import static org.thingsboard.server.utils.LwM2mObjectModelUtils.toLwm2mResource; /** * Created by ashvayka on 18.04.18. @@ -65,7 +71,7 @@ public class InstallScripts { public static final String WIDGET_BUNDLES_DIR = "widget_bundles"; public static final String OAUTH2_CONFIG_TEMPLATES_DIR = "oauth2_config_templates"; public static final String DASHBOARDS_DIR = "dashboards"; - public static final String MODELS_DIR = "models"; + public static final String MODELS_LWM2M_DIR = "lwm2m-registry"; public static final String CREDENTIALS_DIR = "credentials"; public static final String EDGE_MANAGEMENT = "edge_management"; @@ -260,4 +266,45 @@ public class InstallScripts { ); } } + + public void loadSystemLwm2mResources() { + Path resourceLwm2mPath = Paths.get(dataDir, MODELS_LWM2M_DIR); + try (DirectoryStream dirStream = Files.newDirectoryStream(resourceLwm2mPath, path -> path.toString().endsWith(InstallScripts.XML_EXT))) { + dirStream.forEach( + path -> { + try { + String data = Base64.getEncoder().encodeToString(Files.readAllBytes(path)); + TbResource tbResource = new TbResource(); + tbResource.setTenantId(TenantId.SYS_TENANT_ID); + tbResource.setData(data); + tbResource.setResourceType(ResourceType.LWM2M_MODEL); + tbResource.setFileName(path.toFile().getName()); + doSaveLwm2mResource(tbResource); + } catch (Exception e) { + log.error("Unable to load resource lwm2m object model from file: [{}]", path.toString()); + throw new RuntimeException("resource lwm2m object model from file", e); + } + } + ); + } catch (Exception e) { + log.error("Unable to load resources lwm2m object model from file: [{}]", resourceLwm2mPath.toString()); + throw new RuntimeException("resource lwm2m object model from file", e); + } + } + + private void doSaveLwm2mResource(TbResource resource) throws ThingsboardException { + try { + log.trace("Executing saveResource [{}]", resource); + if (StringUtils.isEmpty(resource.getData())) { + throw new DataValidationException("Resource data should be specified!"); + } + toLwm2mResource(resource); + resourceService.saveResource(resource); + } catch (DataValidationException e) { + log.debug("[{}] {}", resource.getFileName(), e.getMessage()); + } catch (Exception ex) { + throw ex; + } + } } + diff --git a/application/src/main/java/org/thingsboard/server/service/resource/DefaultTbResourceService.java b/application/src/main/java/org/thingsboard/server/service/resource/DefaultTbResourceService.java index c06e102af7..5cf051367a 100644 --- a/application/src/main/java/org/thingsboard/server/service/resource/DefaultTbResourceService.java +++ b/application/src/main/java/org/thingsboard/server/service/resource/DefaultTbResourceService.java @@ -18,8 +18,6 @@ package org.thingsboard.server.service.resource; import lombok.extern.slf4j.Slf4j; import org.eclipse.leshan.core.model.DDFFileParser; import org.eclipse.leshan.core.model.DefaultDDFFileValidator; -import org.eclipse.leshan.core.model.InvalidDDFFileException; -import org.eclipse.leshan.core.model.ObjectModel; import org.springframework.stereotype.Service; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.ResourceType; @@ -28,13 +26,10 @@ import org.thingsboard.server.common.data.TbResource; import org.thingsboard.server.common.data.TbResourceInfo; import org.thingsboard.server.common.data.User; import org.thingsboard.server.common.data.audit.ActionType; -import org.thingsboard.server.common.data.exception.ThingsboardErrorCode; import org.thingsboard.server.common.data.exception.ThingsboardException; import org.thingsboard.server.common.data.id.TbResourceId; import org.thingsboard.server.common.data.id.TenantId; -import org.thingsboard.server.common.data.lwm2m.LwM2mInstance; import org.thingsboard.server.common.data.lwm2m.LwM2mObject; -import org.thingsboard.server.common.data.lwm2m.LwM2mResourceObserve; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.dao.exception.DataValidationException; @@ -42,19 +37,15 @@ import org.thingsboard.server.dao.resource.ResourceService; import org.thingsboard.server.queue.util.TbCoreComponent; import org.thingsboard.server.service.entitiy.AbstractTbEntityService; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Base64; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.thingsboard.server.common.data.lwm2m.LwM2mConstants.LWM2M_SEPARATOR_KEY; -import static org.thingsboard.server.common.data.lwm2m.LwM2mConstants.LWM2M_SEPARATOR_SEARCH_TEXT; import static org.thingsboard.server.dao.device.DeviceServiceImpl.INCORRECT_TENANT_ID; import static org.thingsboard.server.dao.service.Validator.validateId; +import static org.thingsboard.server.utils.LwM2mObjectModelUtils.toLwM2mObject; +import static org.thingsboard.server.utils.LwM2mObjectModelUtils.toLwm2mResource; @Slf4j @Service @@ -137,47 +128,6 @@ public class DefaultTbResourceService extends AbstractTbEntityService implements return "DESC".equals(sortOrder) ? comparator.reversed() : comparator; } - private LwM2mObject toLwM2mObject(TbResource resource, boolean isSave) { - try { - DDFFileParser ddfFileParser = new DDFFileParser(new DefaultDDFFileValidator()); - List objectModels = - ddfFileParser.parse(new ByteArrayInputStream(Base64.getDecoder().decode(resource.getData())), resource.getSearchText()); - if (objectModels.size() == 0) { - return null; - } else { - ObjectModel obj = objectModels.get(0); - LwM2mObject lwM2mObject = new LwM2mObject(); - lwM2mObject.setId(obj.id); - lwM2mObject.setKeyId(resource.getResourceKey()); - lwM2mObject.setName(obj.name); - lwM2mObject.setMultiple(obj.multiple); - lwM2mObject.setMandatory(obj.mandatory); - LwM2mInstance instance = new LwM2mInstance(); - instance.setId(0); - List resources = new ArrayList<>(); - obj.resources.forEach((k, v) -> { - if (isSave) { - LwM2mResourceObserve lwM2MResourceObserve = new LwM2mResourceObserve(k, v.name, false, false, false); - resources.add(lwM2MResourceObserve); - } else if (v.operations.isReadable()) { - LwM2mResourceObserve lwM2MResourceObserve = new LwM2mResourceObserve(k, v.name, false, false, false); - resources.add(lwM2MResourceObserve); - } - }); - if (isSave || resources.size() > 0) { - instance.setResources(resources.toArray(LwM2mResourceObserve[]::new)); - lwM2mObject.setInstances(new LwM2mInstance[]{instance}); - return lwM2mObject; - } else { - return null; - } - } - } catch (IOException | InvalidDDFFileException e) { - log.error("Could not parse the XML of objectModel with name [{}]", resource.getSearchText(), e); - return null; - } - } - @Override public TbResource save(TbResource tbResource, User user) throws ThingsboardException { ActionType actionType = tbResource.getId() == null ? ActionType.ADDED : ActionType.UPDATED; @@ -215,35 +165,11 @@ public class DefaultTbResourceService extends AbstractTbEntityService implements throw new DataValidationException("Resource data should be specified!"); } if (ResourceType.LWM2M_MODEL.equals(resource.getResourceType())) { - try { - List objectModels = - ddfFileParser.parse(new ByteArrayInputStream(Base64.getDecoder().decode(resource.getData())), resource.getSearchText()); - if (!objectModels.isEmpty()) { - ObjectModel objectModel = objectModels.get(0); - - String resourceKey = objectModel.id + LWM2M_SEPARATOR_KEY + objectModel.version; - String name = objectModel.name; - resource.setResourceKey(resourceKey); - if (resource.getId() == null) { - resource.setTitle(name + " id=" + objectModel.id + " v" + objectModel.version); - } - resource.setSearchText(resourceKey + LWM2M_SEPARATOR_SEARCH_TEXT + name); - } else { - throw new DataValidationException(String.format("Could not parse the XML of objectModel with name %s", resource.getSearchText())); - } - } catch (InvalidDDFFileException e) { - log.error("Failed to parse file {}", resource.getFileName(), e); - throw new DataValidationException("Failed to parse file " + resource.getFileName()); - } catch (IOException e) { - throw new ThingsboardException(e, ThingsboardErrorCode.GENERAL); - } - if (resource.getResourceType().equals(ResourceType.LWM2M_MODEL) && toLwM2mObject(resource, true) == null) { - throw new DataValidationException(String.format("Could not parse the XML of objectModel with name %s", resource.getSearchText())); - } + toLwm2mResource(resource); } else { resource.setResourceKey(resource.getFileName()); } - return resourceService.saveResource(resource); } } + diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/settings/DefaultJwtSettingsValidator.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/settings/DefaultJwtSettingsValidator.java index 274630cc39..dddb011fd5 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/settings/DefaultJwtSettingsValidator.java +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/settings/DefaultJwtSettingsValidator.java @@ -36,10 +36,10 @@ public class DefaultJwtSettingsValidator implements JwtSettingsValidator { if (StringUtils.isEmpty(jwtSettings.getTokenIssuer())) { throw new DataValidationException("JWT token issuer should be specified!"); } - if (Optional.ofNullable(jwtSettings.getRefreshTokenExpTime()).orElse(0) <= TimeUnit.MINUTES.toSeconds(15)) { + if (Optional.ofNullable(jwtSettings.getRefreshTokenExpTime()).orElse(0) < TimeUnit.MINUTES.toSeconds(15)) { throw new DataValidationException("JWT refresh token expiration time should be at least 15 minutes!"); } - if (Optional.ofNullable(jwtSettings.getTokenExpirationTime()).orElse(0) <= TimeUnit.MINUTES.toSeconds(1)) { + if (Optional.ofNullable(jwtSettings.getTokenExpirationTime()).orElse(0) < TimeUnit.MINUTES.toSeconds(1)) { throw new DataValidationException("JWT token expiration time should be at least 1 minute!"); } if (jwtSettings.getTokenExpirationTime() >= jwtSettings.getRefreshTokenExpTime()) { diff --git a/application/src/main/java/org/thingsboard/server/utils/LwM2mObjectModelUtils.java b/application/src/main/java/org/thingsboard/server/utils/LwM2mObjectModelUtils.java new file mode 100644 index 0000000000..bb2e49bd62 --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/utils/LwM2mObjectModelUtils.java @@ -0,0 +1,114 @@ +/** + * Copyright © 2016-2023 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.utils; + +import lombok.extern.slf4j.Slf4j; +import org.eclipse.leshan.core.model.DDFFileParser; +import org.eclipse.leshan.core.model.DefaultDDFFileValidator; +import org.eclipse.leshan.core.model.InvalidDDFFileException; +import org.eclipse.leshan.core.model.ObjectModel; +import org.thingsboard.server.common.data.ResourceType; +import org.thingsboard.server.common.data.TbResource; +import org.thingsboard.server.common.data.exception.ThingsboardErrorCode; +import org.thingsboard.server.common.data.exception.ThingsboardException; +import org.thingsboard.server.common.data.lwm2m.LwM2mInstance; +import org.thingsboard.server.common.data.lwm2m.LwM2mObject; +import org.thingsboard.server.common.data.lwm2m.LwM2mResourceObserve; +import org.thingsboard.server.dao.exception.DataValidationException; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; + +import static org.thingsboard.server.common.data.lwm2m.LwM2mConstants.LWM2M_SEPARATOR_KEY; +import static org.thingsboard.server.common.data.lwm2m.LwM2mConstants.LWM2M_SEPARATOR_SEARCH_TEXT; + +@Slf4j +public class LwM2mObjectModelUtils { + + private static final DDFFileParser ddfFileParser = new DDFFileParser(new DefaultDDFFileValidator()); + + public static void toLwm2mResource (TbResource resource) throws ThingsboardException { + try { + List objectModels = + ddfFileParser.parse(new ByteArrayInputStream(Base64.getDecoder().decode(resource.getData())), resource.getSearchText()); + if (!objectModels.isEmpty()) { + ObjectModel objectModel = objectModels.get(0); + + String resourceKey = objectModel.id + LWM2M_SEPARATOR_KEY + objectModel.version; + String name = objectModel.name; + resource.setResourceKey(resourceKey); + if (resource.getId() == null) { + resource.setTitle(name + " id=" + objectModel.id + " v" + objectModel.version); + } + resource.setSearchText(resourceKey + LWM2M_SEPARATOR_SEARCH_TEXT + name); + } else { + throw new DataValidationException(String.format("Could not parse the XML of objectModel with name %s", resource.getSearchText())); + } + } catch (InvalidDDFFileException e) { + log.error("Failed to parse file {}", resource.getFileName(), e); + throw new DataValidationException("Failed to parse file " + resource.getFileName()); + } catch (IOException e) { + throw new ThingsboardException(e, ThingsboardErrorCode.GENERAL); + } + if (resource.getResourceType().equals(ResourceType.LWM2M_MODEL) && toLwM2mObject(resource, true) == null) { + throw new DataValidationException(String.format("Could not parse the XML of objectModel with name %s", resource.getSearchText())); + } + } + + public static LwM2mObject toLwM2mObject(TbResource resource, boolean isSave) { + try { + List objectModels = + ddfFileParser.parse(new ByteArrayInputStream(Base64.getDecoder().decode(resource.getData())), resource.getSearchText()); + if (objectModels.size() == 0) { + return null; + } else { + ObjectModel obj = objectModels.get(0); + LwM2mObject lwM2mObject = new LwM2mObject(); + lwM2mObject.setId(obj.id); + lwM2mObject.setKeyId(resource.getResourceKey()); + lwM2mObject.setName(obj.name); + lwM2mObject.setMultiple(obj.multiple); + lwM2mObject.setMandatory(obj.mandatory); + LwM2mInstance instance = new LwM2mInstance(); + instance.setId(0); + List resources = new ArrayList<>(); + obj.resources.forEach((k, v) -> { + if (isSave) { + LwM2mResourceObserve lwM2MResourceObserve = new LwM2mResourceObserve(k, v.name, false, false, false); + resources.add(lwM2MResourceObserve); + } else if (v.operations.isReadable()) { + LwM2mResourceObserve lwM2MResourceObserve = new LwM2mResourceObserve(k, v.name, false, false, false); + resources.add(lwM2MResourceObserve); + } + }); + if (isSave || resources.size() > 0) { + instance.setResources(resources.toArray(LwM2mResourceObserve[]::new)); + lwM2mObject.setInstances(new LwM2mInstance[]{instance}); + return lwM2mObject; + } else { + return null; + } + } + } catch (IOException | InvalidDDFFileException e) { + log.error("Could not parse the XML of objectModel with name [{}]", resource.getSearchText(), e); + return null; + } + } + +} diff --git a/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java b/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java index c09f259aaa..c9b739bad1 100644 --- a/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java @@ -862,7 +862,10 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest { protected void awaitForDeviceActorToReceiveSubscription(DeviceId deviceId, FeatureType featureType, int subscriptionCount) { DeviceActorMessageProcessor processor = getDeviceActorProcessor(deviceId); Map subscriptions = (Map) ReflectionTestUtils.getField(processor, getMapName(featureType)); - Awaitility.await("Device actor received subscription command from the transport").atMost(TIMEOUT, TimeUnit.SECONDS).until(() -> subscriptions.size() == subscriptionCount); + Awaitility.await("Device actor received subscription command from the transport").atMost(5, TimeUnit.SECONDS).until(() -> { + log.warn("device {}, subscriptions.size() == {}", deviceId, subscriptions.size()); + return subscriptions.size() == subscriptionCount; + }); } protected static String getMapName(FeatureType featureType) { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseDeviceEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/BaseDeviceEdgeTest.java index 98508e72ce..904a6246ab 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseDeviceEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/BaseDeviceEdgeTest.java @@ -671,6 +671,7 @@ abstract public class BaseDeviceEdgeTest extends AbstractEdgeTest { client.setCallback(onUpdateCallback); client.subscribeAndWait("v1/devices/me/attributes", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(device.getId(), FeatureType.ATTRIBUTES, 1); edgeImitator.expectResponsesAmount(1); @@ -690,7 +691,7 @@ abstract public class BaseDeviceEdgeTest extends AbstractEdgeTest { edgeImitator.sendUplinkMsg(uplinkMsgBuilder.build()); Assert.assertTrue(edgeImitator.waitForResponses()); - Assert.assertTrue(onUpdateCallback.getSubscribeLatch().await(5, TimeUnit.SECONDS)); + Assert.assertTrue(onUpdateCallback.getSubscribeLatch().await(30, TimeUnit.SECONDS)); Assert.assertEquals(JacksonUtil.OBJECT_MAPPER.createObjectNode().put(attrKey, attrValue), JacksonUtil.fromBytes(onUpdateCallback.getPayloadBytes())); diff --git a/application/src/test/java/org/thingsboard/server/service/resource/sql/BaseTbResourceServiceTest.java b/application/src/test/java/org/thingsboard/server/service/resource/sql/BaseTbResourceServiceTest.java index ce02296733..e2c5985553 100644 --- a/application/src/test/java/org/thingsboard/server/service/resource/sql/BaseTbResourceServiceTest.java +++ b/application/src/test/java/org/thingsboard/server/service/resource/sql/BaseTbResourceServiceTest.java @@ -19,9 +19,8 @@ import com.datastax.oss.driver.api.core.uuid.Uuids; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; +import org.junit.jupiter.api.Assertions; import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.EntityInfo; import org.thingsboard.server.common.data.ResourceType; @@ -45,6 +44,7 @@ import java.util.Base64; import java.util.Collections; import java.util.List; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @DaoSqlTest @@ -115,10 +115,6 @@ public class BaseTbResourceServiceTest extends AbstractControllerTest { .andExpect(status().isOk()); } - @SuppressWarnings("deprecation") - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void testSaveResourceWithMaxSumDataSizeOutOfLimit() throws Exception { loginSysAdmin(); @@ -137,9 +133,9 @@ public class BaseTbResourceServiceTest extends AbstractControllerTest { Assert.assertEquals(1, resourceService.sumDataSizeByTenantId(tenantId)); try { - thrown.expect(DataValidationException.class); - thrown.expectMessage(String.format("Failed to create the tb resource, files size limit is exhausted %d bytes!", limit)); - createResource("test1", 1 + DEFAULT_FILE_NAME); + assertThatThrownBy(() -> createResource("test1", 1 + DEFAULT_FILE_NAME)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("Failed to create the tb resource, files size limit is exhausted %d bytes!", limit); } finally { defaultTenantProfile.getProfileData().setConfiguration(DefaultTenantProfileConfiguration.builder().maxResourcesInBytes(0).build()); loginSysAdmin(); @@ -237,7 +233,7 @@ public class BaseTbResourceServiceTest extends AbstractControllerTest { resourceService.delete(savedResource, null); } - @Test(expected = DataValidationException.class) + @Test public void testSaveTbResourceWithExistsFileName() throws Exception { TbResource resource = new TbResource(); resource.setTenantId(tenantId); @@ -256,23 +252,27 @@ public class BaseTbResourceServiceTest extends AbstractControllerTest { resource.setData("Test Data"); try { - resourceService.save(resource2); + Assertions.assertThrows(DataValidationException.class, () -> { + resourceService.save(resource2); + }); } finally { resourceService.delete(savedResource, null); } } - @Test(expected = DataValidationException.class) + @Test public void testSaveTbResourceWithEmptyTitle() throws Exception { TbResource resource = new TbResource(); resource.setTenantId(tenantId); resource.setResourceType(ResourceType.JKS); resource.setFileName(DEFAULT_FILE_NAME); resource.setData("Test Data"); - resourceService.save(resource); + Assertions.assertThrows(DataValidationException.class, () -> { + resourceService.save(resource); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveTbResourceWithInvalidTenant() throws Exception { TbResource resource = new TbResource(); resource.setTenantId(TenantId.fromUUID(Uuids.timeBased())); @@ -280,7 +280,9 @@ public class BaseTbResourceServiceTest extends AbstractControllerTest { resource.setTitle("My resource"); resource.setFileName(DEFAULT_FILE_NAME); resource.setData("Test Data"); - resourceService.save(resource); + Assertions.assertThrows(DataValidationException.class, () -> { + resourceService.save(resource); + }); } @Test diff --git a/application/src/test/java/org/thingsboard/server/transport/lwm2m/AbstractLwM2MIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/lwm2m/AbstractLwM2MIntegrationTest.java index ef00a3050e..c92369e3c2 100644 --- a/application/src/test/java/org/thingsboard/server/transport/lwm2m/AbstractLwM2MIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/lwm2m/AbstractLwM2MIntegrationTest.java @@ -70,7 +70,7 @@ import org.thingsboard.server.service.telemetry.cmd.v2.LatestValueCmd; import org.thingsboard.server.transport.AbstractTransportIntegrationTest; import org.thingsboard.server.transport.lwm2m.client.LwM2MTestClient; import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClientContext; -import org.thingsboard.server.transport.lwm2m.server.uplink.DefaultLwM2mUplinkMsgHandler; +import org.thingsboard.server.transport.lwm2m.server.uplink.LwM2mUplinkMsgHandler; import java.io.IOException; import java.net.ServerSocket; @@ -108,7 +108,7 @@ import static org.thingsboard.server.transport.lwm2m.Lwm2mTestHelper.LwM2MProfil public abstract class AbstractLwM2MIntegrationTest extends AbstractTransportIntegrationTest { @SpyBean - DefaultLwM2mUplinkMsgHandler defaultLwM2mUplinkMsgHandlerTest; + LwM2mUplinkMsgHandler defaultLwM2mUplinkMsgHandlerTest; @Autowired private LwM2mClientContext clientContextTest; diff --git a/application/src/test/java/org/thingsboard/server/transport/lwm2m/client/LwM2MTestClient.java b/application/src/test/java/org/thingsboard/server/transport/lwm2m/client/LwM2MTestClient.java index 7cb5f88733..449ac4c2ae 100644 --- a/application/src/test/java/org/thingsboard/server/transport/lwm2m/client/LwM2MTestClient.java +++ b/application/src/test/java/org/thingsboard/server/transport/lwm2m/client/LwM2MTestClient.java @@ -45,7 +45,7 @@ import org.junit.Assert; import org.mockito.Mockito; import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient; import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClientContext; -import org.thingsboard.server.transport.lwm2m.server.uplink.DefaultLwM2mUplinkMsgHandler; +import org.thingsboard.server.transport.lwm2m.server.uplink.LwM2mUplinkMsgHandler; import org.thingsboard.server.transport.lwm2m.utils.LwM2mValueConverterImpl; import java.io.IOException; @@ -109,12 +109,12 @@ public class LwM2MTestClient { private LwM2MLocationParams locationParams; private LwM2mTemperatureSensor lwM2MTemperatureSensor; private Set clientStates; - private DefaultLwM2mUplinkMsgHandler defaultLwM2mUplinkMsgHandlerTest; + private LwM2mUplinkMsgHandler defaultLwM2mUplinkMsgHandlerTest; private LwM2mClientContext clientContext; public void init(Security security, Configuration coapConfig, int port, boolean isRpc, boolean isBootstrap, int shortServerId, int shortServerIdBs, Security securityBs, - DefaultLwM2mUplinkMsgHandler defaultLwM2mUplinkMsgHandler, + LwM2mUplinkMsgHandler defaultLwM2mUplinkMsgHandler, LwM2mClientContext clientContext) throws InvalidDDFFileException, IOException { Assert.assertNull("client already initialized", leshanClient); this.defaultLwM2mUplinkMsgHandlerTest = defaultLwM2mUplinkMsgHandler; diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/attributes/AbstractMqttAttributesIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/attributes/AbstractMqttAttributesIntegrationTest.java index f8165b0237..fa6c4d16a3 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/attributes/AbstractMqttAttributesIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/attributes/AbstractMqttAttributesIntegrationTest.java @@ -354,6 +354,8 @@ public abstract class AbstractMqttAttributesIntegrationTest extends AbstractMqtt SHARED_ATTRIBUTES_PAYLOAD, String.class, status().isOk()); client.publishAndWait(attrPubTopic, CLIENT_ATTRIBUTES_PAYLOAD.getBytes()); client.subscribeAndWait(attrSubTopic, MqttQoS.AT_MOST_ONCE); + //RequestAttributes does not make any subscriptions in device actor + String update = getWsClient().waitForUpdate(); assertThat(update).as("ws update received").isNotBlank(); MqttTestCallback callback = new MqttTestCallback(attrSubTopic.replace("+", "1")); @@ -383,6 +385,8 @@ public abstract class AbstractMqttAttributesIntegrationTest extends AbstractMqtt doPostAsync("/api/plugins/telemetry/DEVICE/" + savedDevice.getId().getId() + "/attributes/SHARED_SCOPE", SHARED_ATTRIBUTES_PAYLOAD, String.class, status().isOk()); client.publishAndWait(attrPubTopic, getAttributesProtoPayloadBytes()); client.subscribeAndWait(attrSubTopic, MqttQoS.AT_MOST_ONCE); + //RequestAttributes does not make any subscriptions in device actor + String update = getWsClient().waitForUpdate(); assertThat(update).as("ws update received").isNotBlank(); MqttTestCallback callback = new MqttTestCallback(attrSubTopic.replace("+", "1")); @@ -442,6 +446,7 @@ public abstract class AbstractMqttAttributesIntegrationTest extends AbstractMqtt assertThat(update).as("ws update received").isNotBlank(); client.subscribeAndWait(GATEWAY_ATTRIBUTES_RESPONSE_TOPIC, MqttQoS.AT_LEAST_ONCE); + //RequestAttributes does not make any subscriptions in device actor MqttTestCallback clientAttributesCallback = new MqttTestCallback(GATEWAY_ATTRIBUTES_RESPONSE_TOPIC); client.setCallback(clientAttributesCallback); @@ -495,6 +500,7 @@ public abstract class AbstractMqttAttributesIntegrationTest extends AbstractMqtt assertThat(update).as("ws update received").isNotBlank(); client.subscribeAndWait(GATEWAY_ATTRIBUTES_RESPONSE_TOPIC, MqttQoS.AT_LEAST_ONCE); + awaitForDeviceActorToReceiveSubscription(device.getId(), FeatureType.ATTRIBUTES, 1); MqttTestCallback clientAttributesCallback = new MqttTestCallback(GATEWAY_ATTRIBUTES_RESPONSE_TOPIC); client.setCallback(clientAttributesCallback); diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/credentials/BasicMqttCredentialsTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/credentials/BasicMqttCredentialsTest.java index 32f7647048..3880141c36 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/credentials/BasicMqttCredentialsTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/credentials/BasicMqttCredentialsTest.java @@ -20,6 +20,7 @@ import org.eclipse.paho.client.mqttv3.MqttException; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.StringUtils; @@ -115,7 +116,7 @@ public class BasicMqttCredentialsTest extends AbstractMqttIntegrationTest { testTelemetryIsDelivered(accessToken2Device, mqttTestClient5); } - @Test(expected = MqttException.class) + @Test public void testCorrectClientIdAndUserNameButWrongPassword() throws Exception { // Not correct. Correct clientId and username, but wrong password MqttTestClient mqttTestClient = new MqttTestClient(CLIENT_ID); @@ -125,7 +126,9 @@ public class BasicMqttCredentialsTest extends AbstractMqttIntegrationTest { } catch (MqttException e) { Assert.assertEquals(4, e.getReasonCode()); // 4 - Reason code for bad username or password in MQTT v3 } - testTelemetryIsNotDelivered(clientIdAndUserNameAndPasswordDevice3, mqttTestClient); + Assertions.assertThrows(MqttException.class, () -> { + testTelemetryIsNotDelivered(clientIdAndUserNameAndPasswordDevice3, mqttTestClient); + }); } private void testTelemetryIsDelivered(Device device, MqttTestClient client) throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/rpc/AbstractMqttServerSideRpcIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/rpc/AbstractMqttServerSideRpcIntegrationTest.java index 924b4d50a6..205386a32e 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/rpc/AbstractMqttServerSideRpcIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/rpc/AbstractMqttServerSideRpcIntegrationTest.java @@ -223,7 +223,6 @@ public abstract class AbstractMqttServerSideRpcIntegrationTest extends AbstractM MqttTestCallback callback = new MqttTestCallback(GATEWAY_RPC_TOPIC); client.setCallback(callback); - client.subscribeAndWait(GATEWAY_RPC_TOPIC, MqttQoS.AT_MOST_ONCE); subscribeAndCheckSubscription(client, GATEWAY_RPC_TOPIC, savedDevice.getId(), FeatureType.RPC); String setGpioRequest = "{\"method\": \"toggle_gpio\", \"params\": {\"pin\":1}}"; diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/attributes/AbstractAttributesMqttV5Test.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/attributes/AbstractAttributesMqttV5Test.java index e3dfc6fb55..347b397ef5 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/attributes/AbstractAttributesMqttV5Test.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/attributes/AbstractAttributesMqttV5Test.java @@ -21,6 +21,7 @@ import org.junit.Before; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.device.profile.MqttTopics; import org.thingsboard.server.common.data.id.DeviceId; +import org.thingsboard.server.common.msg.session.FeatureType; import org.thingsboard.server.transport.mqtt.MqttTestConfigProperties; import org.thingsboard.server.transport.mqtt.mqttv5.AbstractMqttV5Test; import org.thingsboard.server.transport.mqtt.mqttv5.MqttV5TestCallback; @@ -104,6 +105,7 @@ public abstract class AbstractAttributesMqttV5Test extends AbstractMqttV5Test { MqttV5TestCallback onUpdateCallback = new MqttV5TestCallback(); client.setCallback(onUpdateCallback); client.subscribeAndWait(MqttTopics.DEVICE_ATTRIBUTES_TOPIC, MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedDevice.getId(), FeatureType.ATTRIBUTES, 1); doPostAsync("/api/plugins/telemetry/DEVICE/" + savedDevice.getId().getId() + "/attributes/SHARED_SCOPE", SHARED_ATTRIBUTES_PAYLOAD, String.class, status().isOk()); onUpdateCallback.getSubscribeLatch().await(3, TimeUnit.SECONDS); diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/connection/AbstractMqttV5ClientConnectionTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/connection/AbstractMqttV5ClientConnectionTest.java index 81b015e245..93d349e0ec 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/connection/AbstractMqttV5ClientConnectionTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/connection/AbstractMqttV5ClientConnectionTest.java @@ -25,6 +25,7 @@ import org.eclipse.paho.mqttv5.common.packet.MqttReturnCode; import org.eclipse.paho.mqttv5.common.packet.MqttWireMessage; import org.junit.Assert; import org.thingsboard.server.common.data.device.profile.MqttTopics; +import org.thingsboard.server.common.msg.session.FeatureType; import org.thingsboard.server.transport.mqtt.AbstractMqttIntegrationTest; import org.thingsboard.server.transport.mqtt.mqttv5.MqttV5TestCallback; import org.thingsboard.server.transport.mqtt.mqttv5.MqttV5TestClient; @@ -101,6 +102,7 @@ public abstract class AbstractMqttV5ClientConnectionTest extends AbstractMqttInt MqttV5TestCallback onUpdateCallback = new MqttV5TestCallback(); client.setCallback(onUpdateCallback); client.subscribeAndWait(MqttTopics.DEVICE_ATTRIBUTES_TOPIC, MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedDevice.getId(), FeatureType.ATTRIBUTES, 1); String payload = "{\"sharedStr\":\"" + StringUtils.repeat("*", valueLen) + "\"}"; diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/subscribe/AbstractMqttV5ClientSubscriptionTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/subscribe/AbstractMqttV5ClientSubscriptionTest.java index f681ad5b55..aebb5a7ed2 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/subscribe/AbstractMqttV5ClientSubscriptionTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/subscribe/AbstractMqttV5ClientSubscriptionTest.java @@ -22,6 +22,7 @@ import org.eclipse.paho.mqttv5.common.packet.MqttSubAck; import org.eclipse.paho.mqttv5.common.packet.MqttWireMessage; import org.junit.Assert; import org.thingsboard.server.common.data.device.profile.MqttTopics; +import org.thingsboard.server.common.msg.session.FeatureType; import org.thingsboard.server.transport.mqtt.AbstractMqttIntegrationTest; import org.thingsboard.server.transport.mqtt.mqttv5.MqttV5TestClient; @@ -34,6 +35,7 @@ public abstract class AbstractMqttV5ClientSubscriptionTest extends AbstractMqttI client.connectAndWait(accessToken); IMqttToken subscriptionResult = client.subscribeAndWait(MqttTopics.DEVICE_ATTRIBUTES_TOPIC, MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedDevice.getId(), FeatureType.ATTRIBUTES, 1); MqttWireMessage response = subscriptionResult.getResponse(); @@ -52,6 +54,7 @@ public abstract class AbstractMqttV5ClientSubscriptionTest extends AbstractMqttI client.connectAndWait(accessToken); IMqttToken iMqttToken = client.subscribeAndWait("wrong/topic/+", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedDevice.getId(), FeatureType.ATTRIBUTES, 0); Assert.assertEquals(MESSAGE_TYPE_SUBACK,iMqttToken.getResponse().getType()); MqttSubAck subAck = (MqttSubAck) iMqttToken.getResponse(); Assert.assertEquals(1, subAck.getReturnCodes().length); diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/unsubscribe/AbstractMqttV5ClientUnsubscribeTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/unsubscribe/AbstractMqttV5ClientUnsubscribeTest.java index 835e225da4..ca534b9999 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/unsubscribe/AbstractMqttV5ClientUnsubscribeTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/client/unsubscribe/AbstractMqttV5ClientUnsubscribeTest.java @@ -22,6 +22,7 @@ import org.eclipse.paho.mqttv5.common.packet.MqttUnsubAck; import org.eclipse.paho.mqttv5.common.packet.MqttWireMessage; import org.junit.Assert; import org.thingsboard.server.common.data.device.profile.MqttTopics; +import org.thingsboard.server.common.msg.session.FeatureType; import org.thingsboard.server.transport.mqtt.AbstractMqttIntegrationTest; import org.thingsboard.server.transport.mqtt.mqttv5.MqttV5TestClient; @@ -34,6 +35,7 @@ public abstract class AbstractMqttV5ClientUnsubscribeTest extends AbstractMqttIn client.connectAndWait(accessToken); client.subscribeAndWait(MqttTopics.DEVICE_ATTRIBUTES_TOPIC, MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedDevice.getId(), FeatureType.ATTRIBUTES, 1); IMqttToken unsubscribeResult = client.unsubscribeAndWait(MqttTopics.DEVICE_ATTRIBUTES_TOPIC); MqttWireMessage response = unsubscribeResult.getResponse(); Assert.assertEquals(MESSAGE_TYPE_UNSUBACK, response.getType()); diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/rpc/AbstractMqttV5RpcTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/rpc/AbstractMqttV5RpcTest.java index b6604439da..aecd1124e3 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/rpc/AbstractMqttV5RpcTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv5/rpc/AbstractMqttV5RpcTest.java @@ -22,6 +22,7 @@ import org.eclipse.paho.mqttv5.common.MqttException; import org.eclipse.paho.mqttv5.common.MqttMessage; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.StringUtils; +import org.thingsboard.server.common.msg.session.FeatureType; import org.thingsboard.server.transport.mqtt.mqttv5.AbstractMqttV5Test; import org.thingsboard.server.transport.mqtt.mqttv5.MqttV5TestCallback; import org.thingsboard.server.transport.mqtt.mqttv5.MqttV5TestClient; @@ -45,6 +46,7 @@ public abstract class AbstractMqttV5RpcTest extends AbstractMqttV5Test { MqttV5TestCallback callback = new MqttV5TestCallback(DEVICE_RPC_REQUESTS_SUB_TOPIC.replace("+", "0")); client.setCallback(callback); client.subscribeAndWait(DEVICE_RPC_REQUESTS_SUB_TOPIC, MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedDevice.getId(), FeatureType.RPC, 1); String setGpioRequest = "{\"method\":\"setGpio\",\"params\":{\"pin\": \"23\",\"value\": 1}}"; String result = doPostAsync("/api/rpc/oneway/" + savedDevice.getId(), setGpioRequest, String.class, status().isOk()); @@ -59,6 +61,7 @@ public abstract class AbstractMqttV5RpcTest extends AbstractMqttV5Test { MqttV5TestClient client = new MqttV5TestClient(); client.connectAndWait(accessToken); client.subscribeAndWait(DEVICE_RPC_REQUESTS_SUB_TOPIC, MqttQoS.AT_LEAST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedDevice.getId(), FeatureType.RPC, 1); MqttV5TestRpcCallback callback = new MqttV5TestRpcCallback(client, DEVICE_RPC_REQUESTS_SUB_TOPIC.replace("+", "0")); client.setCallback(callback); String setGpioRequest = "{\"method\":\"setGpio\",\"params\":{\"pin\": \"26\",\"value\": 1}}"; diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/attributes/AbstractMqttV5ClientSparkplugAttributesTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/attributes/AbstractMqttV5ClientSparkplugAttributesTest.java index 04349d0672..4e05e44668 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/attributes/AbstractMqttV5ClientSparkplugAttributesTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/attributes/AbstractMqttV5ClientSparkplugAttributesTest.java @@ -20,6 +20,7 @@ import io.netty.handler.codec.mqtt.MqttQoS; import lombok.extern.slf4j.Slf4j; import org.junit.Assert; import org.thingsboard.server.common.data.Device; +import org.thingsboard.server.common.msg.session.FeatureType; import org.thingsboard.server.transport.mqtt.sparkplug.AbstractMqttV5ClientSparkplugTest; import org.thingsboard.server.transport.mqtt.util.sparkplug.MetricDataType; import org.thingsboard.server.transport.mqtt.util.sparkplug.SparkplugMessageType; @@ -50,6 +51,7 @@ public abstract class AbstractMqttV5ClientSparkplugAttributesTest extends Abstra String SHARED_ATTRIBUTES_PAYLOAD = "{\"" + keyNodeRebirth + "\":" + value + "}"; Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.ATTRIBUTES, 1); doPostAsync("/api/plugins/telemetry/DEVICE/" + savedGateway.getId().getId() + "/attributes/SHARED_SCOPE", SHARED_ATTRIBUTES_PAYLOAD, String.class, status().isOk()); await(alias + SparkplugMessageType.NBIRTH.name()) .atMost(40, TimeUnit.SECONDS) @@ -75,6 +77,7 @@ public abstract class AbstractMqttV5ClientSparkplugAttributesTest extends Abstra connectionWithNBirth(metricDataType, metricKey, metricValue); Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.ATTRIBUTES, 1); // Boolean <-> String boolean expectedValue = true; @@ -138,6 +141,7 @@ public abstract class AbstractMqttV5ClientSparkplugAttributesTest extends Abstra connectionWithNBirth(metricDataType, metricKey, metricValue); Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.ATTRIBUTES, 1); // Long <-> String String valueStr = "123"; @@ -189,6 +193,7 @@ public abstract class AbstractMqttV5ClientSparkplugAttributesTest extends Abstra connectionWithNBirth(metricDataType, metricKey, metricValue); Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.ATTRIBUTES, 1); // Float <-> String String valueStr = "123.345"; @@ -240,6 +245,7 @@ public abstract class AbstractMqttV5ClientSparkplugAttributesTest extends Abstra connectionWithNBirth(metricDataType, metricKey, metricValue); Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.ATTRIBUTES, 1); // Double <-> String String valueStr = "123345456"; @@ -291,6 +297,7 @@ public abstract class AbstractMqttV5ClientSparkplugAttributesTest extends Abstra connectionWithNBirth(metricDataType, metricKey, metricValue); Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.ATTRIBUTES, 1); // String <-> Long long valueLong = 123345456L; diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/connection/AbstractMqttV5ClientSparkplugConnectionTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/connection/AbstractMqttV5ClientSparkplugConnectionTest.java index 5f9b794739..1a5781afd4 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/connection/AbstractMqttV5ClientSparkplugConnectionTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/connection/AbstractMqttV5ClientSparkplugConnectionTest.java @@ -137,6 +137,12 @@ public abstract class AbstractMqttV5ClientSparkplugConnectionTest extends Abstra } } + /** + * OFFLINE_All + * @param cntDevices + * @throws Exception + */ + protected void processConnectClientWithCorrectAccessTokenWithNDEATH_State_ONLINE_All_Then_OFFLINE_All(int cntDevices) throws Exception { long ts = calendar.getTimeInMillis(); List devices = connectClientWithCorrectAccessTokenWithNDEATHCreatedDevices(cntDevices, ts); @@ -166,6 +172,7 @@ public abstract class AbstractMqttV5ClientSparkplugConnectionTest extends Abstra } } + private boolean findEqualsKeyValueInKvEntrys(List finalFuture, TsKvEntry tsKvEntry) { for (TsKvEntry kvEntry : finalFuture) { if (kvEntry.getKey().equals(tsKvEntry.getKey()) && kvEntry.getValue().equals(tsKvEntry.getValue())) { @@ -174,5 +181,5 @@ public abstract class AbstractMqttV5ClientSparkplugConnectionTest extends Abstra } return false; } - } + diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/rpc/AbstractMqttV5RpcSparkplugTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/rpc/AbstractMqttV5RpcSparkplugTest.java index b08baac875..036b779de1 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/rpc/AbstractMqttV5RpcSparkplugTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/rpc/AbstractMqttV5RpcSparkplugTest.java @@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j; import org.junit.Assert; import org.junit.Test; import org.thingsboard.server.common.data.Device; +import org.thingsboard.server.common.msg.session.FeatureType; import org.thingsboard.server.transport.mqtt.sparkplug.AbstractMqttV5ClientSparkplugTest; import org.thingsboard.server.transport.mqtt.util.sparkplug.SparkplugMessageType; @@ -45,6 +46,7 @@ public abstract class AbstractMqttV5RpcSparkplugTest extends AbstractMqttV5Clie connectionWithNBirth(metricBirthDataType_Int32, metricBirthName_Int32, nextInt32()); Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.RPC, 1); String expected = "{\"result\":\"Success: " + SparkplugMessageType.NCMD.name() + "\"}"; String actual = sendRPCSparkplug(NCMD.name(), sparkplugRpcRequest, savedGateway); await(alias + SparkplugMessageType.NCMD.name()) @@ -79,6 +81,7 @@ public abstract class AbstractMqttV5RpcSparkplugTest extends AbstractMqttV5Clie connectionWithNBirth(metricBirthDataType_Int32, metricBirthName_Int32, nextInt32()); Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.RPC, 1); String invalidateTypeMessageName = "RCMD"; String expected = "{\"result\":\"" + INVALID_ARGUMENTS + "\",\"error\":\"Failed to convert device RPC command to MQTT msg: " + invalidateTypeMessageName + "{\\\"metricName\\\":\\\"" + metricBirthName_Int32 + "\\\",\\\"value\\\":" + metricBirthValue_Int32 + "}\"}"; @@ -92,6 +95,7 @@ public abstract class AbstractMqttV5RpcSparkplugTest extends AbstractMqttV5Clie connectionWithNBirth(metricBirthDataType_Int32, metricBirthName_Int32, nextInt32()); Assert.assertTrue("Connection node is failed", client.isConnected()); client.subscribeAndWait(NAMESPACE + "/" + groupId + "/" + NCMD.name() + "/" + edgeNode + "/#", MqttQoS.AT_MOST_ONCE); + awaitForDeviceActorToReceiveSubscription(savedGateway.getId(), FeatureType.RPC, 1); String metricNameBad = metricBirthName_Int32 + "_Bad"; String sparkplugRpcRequestBad = "{\"metricName\":\"" + metricNameBad + "\",\"value\":" + metricBirthValue_Int32 + "}"; String expected = "{\"result\":\"BAD_REQUEST_PARAMS\",\"error\":\"Failed send To Node Rpc Request: " + diff --git a/application/src/test/resources/logback-test.xml b/application/src/test/resources/logback-test.xml index 23e6d8c2f6..953b7094a4 100644 --- a/application/src/test/resources/logback-test.xml +++ b/application/src/test/resources/logback-test.xml @@ -21,6 +21,13 @@ + + + + + + + diff --git a/common/cluster-api/src/main/proto/queue.proto b/common/cluster-api/src/main/proto/queue.proto index f4992cbba7..d8c55c5917 100644 --- a/common/cluster-api/src/main/proto/queue.proto +++ b/common/cluster-api/src/main/proto/queue.proto @@ -186,7 +186,6 @@ message GetOrCreateDeviceFromGatewayRequestMsg { int64 gatewayIdLSB = 2; string deviceName = 3; string deviceType = 4; - bool sparkplug = 5; } message GetOrCreateDeviceFromGatewayResponseMsg { diff --git a/common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java b/common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java index e2af72892f..cad0d9370c 100644 --- a/common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java +++ b/common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java @@ -18,6 +18,7 @@ package org.thingsboard.server.common.data; import com.datastax.oss.driver.api.core.uuid.Uuids; import org.junit.Assert; import org.junit.Test; +import org.junit.jupiter.api.Assertions; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; @@ -58,9 +59,11 @@ public class UUIDConverterTest { Assert.assertEquals(UUID.fromString("58e0a7d7-eebc-11d8-9669-0800200c9a66"), result); } - @Test(expected = IllegalArgumentException.class) + @Test public void nonV1UuidToStringTest() { - UUIDConverter.fromTimeUUID(UUID.fromString("58e0a7d7-eebc-01d8-9669-0800200c9a66")); + Assertions.assertThrows(IllegalArgumentException.class, () -> { + UUIDConverter.fromTimeUUID(UUID.fromString("58e0a7d7-eebc-01d8-9669-0800200c9a66")); + }); } @Test diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/DefaultLwM2mTransportService.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/DefaultLwM2mTransportService.java index f4b52a0f5f..3eb096cd38 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/DefaultLwM2mTransportService.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/DefaultLwM2mTransportService.java @@ -25,6 +25,7 @@ import org.eclipse.leshan.core.node.codec.DefaultLwM2mEncoder; import org.eclipse.leshan.server.californium.LeshanServer; import org.eclipse.leshan.server.californium.LeshanServerBuilder; import org.eclipse.leshan.server.californium.registration.CaliforniumRegistrationStore; +import org.springframework.context.annotation.DependsOn; import org.springframework.stereotype.Component; import org.thingsboard.server.cache.ota.OtaPackageDataCache; import org.thingsboard.server.common.data.DataConstants; @@ -35,7 +36,7 @@ import org.thingsboard.server.transport.lwm2m.config.LwM2MTransportServerConfig; import org.thingsboard.server.transport.lwm2m.secure.TbLwM2MAuthorizer; import org.thingsboard.server.transport.lwm2m.secure.TbLwM2MDtlsCertificateVerifier; import org.thingsboard.server.transport.lwm2m.server.store.TbSecurityStore; -import org.thingsboard.server.transport.lwm2m.server.uplink.DefaultLwM2mUplinkMsgHandler; +import org.thingsboard.server.transport.lwm2m.server.uplink.LwM2mUplinkMsgHandler; import org.thingsboard.server.transport.lwm2m.utils.LwM2mValueConverterImpl; import javax.annotation.PreDestroy; @@ -56,6 +57,7 @@ import static org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaU @Slf4j @Component +@DependsOn({"lwM2mDownlinkMsgHandler", "lwM2mUplinkMsgHandler"}) @TbLwM2mTransportComponent @RequiredArgsConstructor public class DefaultLwM2mTransportService implements LwM2MTransportService { @@ -66,7 +68,7 @@ public class DefaultLwM2mTransportService implements LwM2MTransportService { private final LwM2mTransportContext context; private final LwM2MTransportServerConfig config; private final OtaPackageDataCache otaPackageDataCache; - private final DefaultLwM2mUplinkMsgHandler handler; + private final LwM2mUplinkMsgHandler handler; private final CaliforniumRegistrationStore registrationStore; private final TbSecurityStore securityStore; private final TbLwM2MDtlsCertificateVerifier certificateVerifier; diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java index 49a77d1eea..d624badc1a 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java @@ -42,7 +42,7 @@ import org.thingsboard.server.transport.lwm2m.server.ota.LwM2MOtaUpdateService; import org.thingsboard.server.transport.lwm2m.server.session.LwM2MSessionManager; import org.thingsboard.server.transport.lwm2m.server.store.TbLwM2MClientStore; import org.thingsboard.server.transport.lwm2m.server.store.TbMainSecurityStore; -import org.thingsboard.server.transport.lwm2m.server.uplink.DefaultLwM2mUplinkMsgHandler; +import org.thingsboard.server.transport.lwm2m.server.uplink.LwM2mUplinkMsgHandler; import org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil; import java.util.Arrays; @@ -75,7 +75,7 @@ public class LwM2mClientContextImpl implements LwM2mClientContext { @Autowired @Lazy - private DefaultLwM2mUplinkMsgHandler defaultLwM2MUplinkMsgHandler; + private LwM2mUplinkMsgHandler defaultLwM2MUplinkMsgHandler; @Autowired @Lazy private LwM2MOtaUpdateService otaUpdateService; diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/downlink/DefaultLwM2mDownlinkMsgHandler.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/downlink/DefaultLwM2mDownlinkMsgHandler.java index 735fa36e1e..ecc57a7458 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/downlink/DefaultLwM2mDownlinkMsgHandler.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/downlink/DefaultLwM2mDownlinkMsgHandler.java @@ -85,6 +85,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.RejectedExecutionException; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -103,7 +104,7 @@ import static org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.ge import static org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.validateVersionedId; @Slf4j -@Service +@Service("lwM2mDownlinkMsgHandler") @TbLwM2mTransportComponent @RequiredArgsConstructor public class DefaultLwM2mDownlinkMsgHandler extends LwM2MExecutorAwareService implements LwM2mDownlinkMsgHandler { @@ -124,6 +125,7 @@ public class DefaultLwM2mDownlinkMsgHandler extends LwM2MExecutorAwareService im @PreDestroy public void destroy() { + log.trace("Destroying {}", getClass().getSimpleName()); super.destroy(); } @@ -521,16 +523,22 @@ public class DefaultLwM2mDownlinkMsgHandler extends LwM2MExecutorAwareService im private , T extends LwM2mResponse> void handleDownlinkError(LwM2mClient client, R request, DownlinkRequestCallback callback, Exception e) { log.trace("[{}] Received downlink error: {}.", client.getEndpoint(), e); - client.updateLastUplinkTime(); - executor.submit(() -> { - if (e instanceof TimeoutException || e instanceof ClientSleepingException) { - log.trace("[{}] Received {}, client is probably sleeping", client.getEndpoint(), e.getClass().getSimpleName()); - clientContext.asleep(client); - } else { - log.trace("[{}] Received {}", client.getEndpoint(), e.getClass().getSimpleName()); - } - callback.onError(toString(request), e); - }); + try { + client.updateLastUplinkTime(); + executor.submit(() -> { + if (e instanceof TimeoutException || e instanceof ClientSleepingException) { + log.trace("[{}] Received {}, client is probably sleeping", client.getEndpoint(), e.getClass().getSimpleName()); + clientContext.asleep(client); + } else { + log.trace("[{}] Received {}", client.getEndpoint(), e.getClass().getSimpleName()); + } + callback.onError(toString(request), e); + }); + } catch (RejectedExecutionException ree) { + log.warn("[{}] Can not handle downlink error. Executor already down", client.getEndpoint(), ree); + } catch (Exception exception) { + log.warn("[{}] Can not handle downlink error", client.getEndpoint(), exception); + } } private WriteRequest getWriteRequestSingleResource(ResourceModel.Type type, ContentFormat contentFormat, int objectId, int instanceId, int resourceId, Object value) { diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/ota/DefaultLwM2MOtaUpdateService.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/ota/DefaultLwM2MOtaUpdateService.java index 153e3894fb..f59643cbeb 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/ota/DefaultLwM2MOtaUpdateService.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/ota/DefaultLwM2MOtaUpdateService.java @@ -146,6 +146,7 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl @PreDestroy public void destroy() { + log.trace("Destroying {}", getClass().getSimpleName()); super.destroy(); } diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/uplink/DefaultLwM2mUplinkMsgHandler.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/uplink/DefaultLwM2mUplinkMsgHandler.java index c790d2495c..25e3a6b591 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/uplink/DefaultLwM2mUplinkMsgHandler.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/uplink/DefaultLwM2mUplinkMsgHandler.java @@ -20,6 +20,8 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; +import lombok.Getter; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.leshan.core.ResponseCode; import org.eclipse.leshan.core.model.ObjectModel; @@ -32,6 +34,7 @@ import org.eclipse.leshan.core.node.LwM2mPath; import org.eclipse.leshan.core.node.LwM2mResource; import org.eclipse.leshan.core.node.LwM2mResourceInstance; import org.eclipse.leshan.core.node.LwM2mSingleResource; +import org.eclipse.leshan.core.node.codec.LwM2mValueConverter; import org.eclipse.leshan.core.observation.Observation; import org.eclipse.leshan.core.request.*; import org.eclipse.leshan.core.request.WriteRequest.Mode; @@ -122,69 +125,41 @@ import static org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.fr @Slf4j -@Service +@Service("lwM2mUplinkMsgHandler") @TbLwM2mTransportComponent +@RequiredArgsConstructor public class DefaultLwM2mUplinkMsgHandler extends LwM2MExecutorAwareService implements LwM2mUplinkMsgHandler { - public LwM2mValueConverterImpl converter; + @Getter + private final LwM2mValueConverter converter = LwM2mValueConverterImpl.getInstance();; private final TransportService transportService; private final LwM2mTransportContext context; + @Lazy private final LwM2MAttributesService attributesService; private final LwM2MSessionManager sessionManager; + @Lazy private final LwM2MOtaUpdateService otaService; private final LwM2MTransportServerConfig config; private final LwM2MTelemetryLogService logService; private final LwM2mTransportServerHelper helper; private final TbLwM2MDtlsSessionStore sessionStore; private final LwM2mClientContext clientContext; - private final LwM2mDownlinkMsgHandler defaultLwM2MDownlinkMsgHandler; + private final LwM2mDownlinkMsgHandler defaultLwM2MDownlinkMsgHandler; //Do not use Lazy because we need live executor to handle msgs private final LwM2mVersionedModelProvider modelProvider; private final RegistrationStore registrationStore; private final TbLwM2mSecurityStore securityStore; private final LwM2MModelConfigService modelConfigService; - public DefaultLwM2mUplinkMsgHandler(TransportService transportService, - LwM2MTransportServerConfig config, - LwM2mTransportServerHelper helper, - LwM2mClientContext clientContext, - LwM2MTelemetryLogService logService, - LwM2MSessionManager sessionManager, - @Lazy LwM2MOtaUpdateService otaService, - @Lazy LwM2MAttributesService attributesService, - @Lazy LwM2mDownlinkMsgHandler defaultLwM2MDownlinkMsgHandler, - LwM2mTransportContext context, - TbLwM2MDtlsSessionStore sessionStore, - LwM2mVersionedModelProvider modelProvider, - RegistrationStore registrationStore, - TbLwM2mSecurityStore securityStore, - LwM2MModelConfigService modelConfigService) { - this.transportService = transportService; - this.sessionManager = sessionManager; - this.attributesService = attributesService; - this.otaService = otaService; - this.config = config; - this.helper = helper; - this.clientContext = clientContext; - this.logService = logService; - this.defaultLwM2MDownlinkMsgHandler = defaultLwM2MDownlinkMsgHandler; - this.context = context; - this.sessionStore = sessionStore; - this.modelProvider = modelProvider; - this.registrationStore = registrationStore; - this.securityStore = securityStore; - this.modelConfigService = modelConfigService; - } - @PostConstruct public void init() { super.init(); this.context.getScheduler().scheduleAtFixedRate(this::reportActivity, new Random().nextInt((int) config.getSessionReportTimeout()), config.getSessionReportTimeout(), TimeUnit.MILLISECONDS); - this.converter = LwM2mValueConverterImpl.getInstance(); } @PreDestroy public void destroy() { + log.trace("Destroying {}", getClass().getSimpleName()); super.destroy(); } @@ -955,6 +930,7 @@ public class DefaultLwM2mUplinkMsgHandler extends LwM2MExecutorAwareService impl * * @param lwM2MClient - LwM2M Client */ + @Override public void initAttributes(LwM2mClient lwM2MClient, boolean logFailedUpdateOfNonChangedValue) { Map keyNamesMap = this.getNamesFromProfileForSharedAttributes(lwM2MClient); if (!keyNamesMap.isEmpty()) { diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/uplink/LwM2mUplinkMsgHandler.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/uplink/LwM2mUplinkMsgHandler.java index 0b2d819fa8..9beebe5279 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/uplink/LwM2mUplinkMsgHandler.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/uplink/LwM2mUplinkMsgHandler.java @@ -15,6 +15,7 @@ */ package org.thingsboard.server.transport.lwm2m.server.uplink; +import org.eclipse.leshan.core.node.codec.LwM2mValueConverter; import org.eclipse.leshan.core.observation.Observation; import org.eclipse.leshan.core.request.CreateRequest; import org.eclipse.leshan.core.request.SendRequest; @@ -69,5 +70,10 @@ public interface LwM2mUplinkMsgHandler { void onToTransportUpdateCredentials(TransportProtos.SessionInfoProto sessionInfo, TransportProtos.ToTransportUpdateCredentialsProto updateCredentials); + void initAttributes(LwM2mClient lwM2MClient, boolean logFailedUpdateOfNonChangedValue); + LwM2MTransportServerConfig getConfig(); + + LwM2mValueConverter getConverter(); + } diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2MTransportUtil.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2MTransportUtil.java index f207e7d05a..861261d951 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2MTransportUtil.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2MTransportUtil.java @@ -52,7 +52,7 @@ import org.thingsboard.server.transport.lwm2m.server.ota.firmware.FirmwareUpdate import org.thingsboard.server.transport.lwm2m.server.ota.firmware.FirmwareUpdateState; import org.thingsboard.server.transport.lwm2m.server.ota.software.SoftwareUpdateResult; import org.thingsboard.server.transport.lwm2m.server.ota.software.SoftwareUpdateState; -import org.thingsboard.server.transport.lwm2m.server.uplink.DefaultLwM2mUplinkMsgHandler; +import org.thingsboard.server.transport.lwm2m.server.uplink.LwM2mUplinkMsgHandler; import java.util.ArrayList; import java.util.Arrays; @@ -289,12 +289,12 @@ public class LwM2MTransportUtil { * Attribute pmax = new Attribute(MAXIMUM_PERIOD, "60"); * Attribute [] attrs = {gt, st}; */ - public static SimpleDownlinkRequest createWriteAttributeRequest(String target, Object params, DefaultLwM2mUplinkMsgHandler serviceImpl) { + public static SimpleDownlinkRequest createWriteAttributeRequest(String target, Object params, LwM2mUplinkMsgHandler serviceImpl) { AttributeSet attrSet = new AttributeSet(createWriteAttributes(params, serviceImpl, target)); return attrSet.getAttributes().size() > 0 ? new WriteAttributesRequest(target, attrSet) : null; } - private static Attribute[] createWriteAttributes(Object params, DefaultLwM2mUplinkMsgHandler serviceImpl, String target) { + private static Attribute[] createWriteAttributes(Object params, LwM2mUplinkMsgHandler serviceImpl, String target) { List attributeLists = new ArrayList<>(); Map map = JacksonUtil.convertValue(params, new TypeReference<>() { }); @@ -366,19 +366,19 @@ public class LwM2MTransportUtil { return newValues; } - public static Object convertWriteAttributes(String type, Object value, DefaultLwM2mUplinkMsgHandler serviceImpl, String target) { + public static Object convertWriteAttributes(String type, Object value, LwM2mUplinkMsgHandler serviceImpl, String target) { switch (type) { /** Integer [0:255]; */ case DIMENSION: - Long dim = (Long) serviceImpl.converter.convertValue(value, equalsResourceTypeGetSimpleName(value), INTEGER, new LwM2mPath(target)); + Long dim = (Long) serviceImpl.getConverter().convertValue(value, equalsResourceTypeGetSimpleName(value), INTEGER, new LwM2mPath(target)); return dim >= 0 && dim <= 255 ? dim : null; /**String;*/ case OBJECT_VERSION: - return serviceImpl.converter.convertValue(value, equalsResourceTypeGetSimpleName(value), STRING, new LwM2mPath(target)); + return serviceImpl.getConverter().convertValue(value, equalsResourceTypeGetSimpleName(value), STRING, new LwM2mPath(target)); /**INTEGER */ case MINIMUM_PERIOD: case MAXIMUM_PERIOD: - return serviceImpl.converter.convertValue(value, equalsResourceTypeGetSimpleName(value), INTEGER, new LwM2mPath(target)); + return serviceImpl.getConverter().convertValue(value, equalsResourceTypeGetSimpleName(value), INTEGER, new LwM2mPath(target)); /**Float; */ case GREATER_THAN: case LESSER_THAN: @@ -386,7 +386,7 @@ public class LwM2MTransportUtil { if (value.getClass().getSimpleName().equals("String")) { value = Double.valueOf((String) value); } - return serviceImpl.converter.convertValue(value, equalsResourceTypeGetSimpleName(value), FLOAT, new LwM2mPath(target)); + return serviceImpl.getConverter().convertValue(value, equalsResourceTypeGetSimpleName(value), FLOAT, new LwM2mPath(target)); default: return null; } diff --git a/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java b/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java index 0d43fc6c93..69f5f78475 100644 --- a/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java +++ b/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java @@ -399,7 +399,7 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement case NBIRTH: case NCMD: case NDATA: - sparkplugSessionHandler.onAttributesTelemetryProto(msgId, sparkplugBProtoNode, deviceSessionCtx.getDeviceInfo().getDeviceName(), sparkplugTopic); + sparkplugSessionHandler.onAttributesTelemetryProto(msgId, sparkplugBProtoNode, sparkplugTopic); break; default: } @@ -410,7 +410,7 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement case DBIRTH: case DCMD: case DDATA: - sparkplugSessionHandler.onAttributesTelemetryProto(msgId, sparkplugBProtoDevice, sparkplugTopic.getDeviceId(), sparkplugTopic); + sparkplugSessionHandler.onAttributesTelemetryProto(msgId, sparkplugBProtoDevice, sparkplugTopic); break; case DDEATH: sparkplugSessionHandler.onDeviceDisconnect(mqttMsg, sparkplugTopic.getDeviceId()); @@ -1060,15 +1060,15 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement } } - private void checkSparkplugNodeSession(MqttConnectMessage connectMessage, ChannelHandlerContext ctx) { + private void checkSparkplugNodeSession(MqttConnectMessage connectMessage, ChannelHandlerContext ctx, SessionMetaData sessionMetaData) { try { if (sparkplugSessionHandler == null) { SparkplugTopic sparkplugTopicNode = validatedSparkplugTopicConnectedNode(connectMessage); if (sparkplugTopicNode != null) { SparkplugBProto.Payload sparkplugBProtoNode = SparkplugBProto.Payload.parseFrom(connectMessage.payload().willMessageInBytes()); sparkplugSessionHandler = new SparkplugNodeSessionHandler(this, deviceSessionCtx, sessionId, sparkplugTopicNode); - sparkplugSessionHandler.onAttributesTelemetryProto(0, sparkplugBProtoNode, - deviceSessionCtx.getDeviceInfo().getDeviceName(), sparkplugTopicNode); + sparkplugSessionHandler.onAttributesTelemetryProto(0, sparkplugBProtoNode, sparkplugTopicNode); + sessionMetaData.setOverwriteActivityTime(true); } else { log.trace("[{}][{}] Failed to fetch sparkplugDevice connect: sparkplugTopicName without SparkplugMessageType.NDEATH.", sessionId, deviceSessionCtx.getDeviceInfo().getDeviceName()); throw new ThingsboardException("Invalid request body", ThingsboardErrorCode.BAD_REQUEST_PARAMS); @@ -1145,7 +1145,7 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement public void onSuccess(Void msg) { SessionMetaData sessionMetaData = transportService.registerAsyncSession(deviceSessionCtx.getSessionInfo(), MqttTransportHandler.this); if (deviceSessionCtx.isSparkplug()) { - checkSparkplugNodeSession(connectMessage, ctx); + checkSparkplugNodeSession(connectMessage, ctx, sessionMetaData); } else { checkGatewaySession(sessionMetaData); } diff --git a/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/AbstractGatewaySessionHandler.java b/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/AbstractGatewaySessionHandler.java index 2bb59dc9e8..ab0b7be5db 100644 --- a/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/AbstractGatewaySessionHandler.java +++ b/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/AbstractGatewaySessionHandler.java @@ -253,7 +253,6 @@ public abstract class AbstractGatewaySessionHandler() { @Override diff --git a/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/SparkplugNodeSessionHandler.java b/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/SparkplugNodeSessionHandler.java index fc480fa882..9b1e3e664e 100644 --- a/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/SparkplugNodeSessionHandler.java +++ b/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/SparkplugNodeSessionHandler.java @@ -101,7 +101,8 @@ public class SparkplugNodeSessionHandler extends AbstractGatewaySessionHandler contextListenableFuture; @@ -113,7 +114,7 @@ public class SparkplugNodeSessionHandler extends AbstractGatewaySessionHandler deviceCtx = onDeviceConnectProto(deviceName); + ListenableFuture deviceCtx = onDeviceConnectProto(topic); contextListenableFuture = Futures.transform(deviceCtx, ctx -> { if (topic.isType(DBIRTH)) { sendSparkplugStateOnTelemetry(ctx.getSessionInfo(), deviceName, ONLINE, @@ -218,10 +219,10 @@ public class SparkplugNodeSessionHandler extends AbstractGatewaySessionHandler onDeviceConnectProto(String deviceName) throws ThingsboardException { + private ListenableFuture onDeviceConnectProto(SparkplugTopic topic) throws ThingsboardException { try { String deviceType = this.gateway.getDeviceType() + "-node"; - return onDeviceConnect(deviceName, deviceType); + return onDeviceConnect(topic.getNodeDeviceName(), deviceType); } catch (RuntimeException e) { log.error("Failed Sparkplug Device connect proto!", e); throw new ThingsboardException(e, ThingsboardErrorCode.BAD_REQUEST_PARAMS); diff --git a/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/util/sparkplug/SparkplugTopic.java b/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/util/sparkplug/SparkplugTopic.java index be721f11bb..2fc49e2b69 100644 --- a/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/util/sparkplug/SparkplugTopic.java +++ b/common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/util/sparkplug/SparkplugTopic.java @@ -161,4 +161,9 @@ public class SparkplugTopic { public boolean isNode() { return this.deviceId == null; } + + public String getNodeDeviceName() { + return isNode() ? edgeNodeId : deviceId; + } } + diff --git a/common/transport/transport-api/src/test/java/JsonConverterTest.java b/common/transport/transport-api/src/test/java/JsonConverterTest.java index a60516e784..39ed04a29a 100644 --- a/common/transport/transport-api/src/test/java/JsonConverterTest.java +++ b/common/transport/transport-api/src/test/java/JsonConverterTest.java @@ -16,20 +16,18 @@ import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.thingsboard.server.common.transport.adaptor.JsonConverter; import java.util.ArrayList; -@RunWith(MockitoJUnitRunner.class) public class JsonConverterTest { - private static final JsonParser JSON_PARSER = new JsonParser(); + private final JsonParser JSON_PARSER = new JsonParser(); - @Before + @BeforeEach public void before() { JsonConverter.setTypeCastEnabled(true); } @@ -88,15 +86,19 @@ public class JsonConverterTest { Assert.assertEquals("10000000000000000000", result.get(0L).get(0).getStrValue().get()); } - @Test(expected = JsonSyntaxException.class) + @Test public void testParseBigDecimalOutOfLongRangeWithoutParsing() { JsonConverter.setTypeCastEnabled(false); - JsonConverter.convertToTelemetry(JSON_PARSER.parse("{\"meterReadingDelta\": 89701010051400054084}"), 0L); + Assertions.assertThrows(JsonSyntaxException.class, () -> { + JsonConverter.convertToTelemetry(JSON_PARSER.parse("{\"meterReadingDelta\": 89701010051400054084}"), 0L); + }); } - @Test(expected = JsonSyntaxException.class) + @Test public void testParseBigDecimalOutOfLongRangeWithoutParsing2() { JsonConverter.setTypeCastEnabled(false); - JsonConverter.convertToTelemetry(JSON_PARSER.parse("{\"meterReadingDelta\": 9.9701010061400066E19}"), 0L); + Assertions.assertThrows(JsonSyntaxException.class, () -> { + JsonConverter.convertToTelemetry(JSON_PARSER.parse("{\"meterReadingDelta\": 9.9701010061400066E19}"), 0L); + }); } } diff --git a/dao/src/main/java/org/thingsboard/server/dao/entity/DefaultEntityServiceRegistry.java b/dao/src/main/java/org/thingsboard/server/dao/entity/DefaultEntityServiceRegistry.java index a8b1d97bac..232905e9fc 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/entity/DefaultEntityServiceRegistry.java +++ b/dao/src/main/java/org/thingsboard/server/dao/entity/DefaultEntityServiceRegistry.java @@ -15,27 +15,31 @@ */ package org.thingsboard.server.dao.entity; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.context.ApplicationContext; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.context.event.EventListener; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; import org.springframework.stereotype.Service; import org.thingsboard.server.common.data.EntityType; -import javax.annotation.PostConstruct; import java.util.HashMap; import java.util.Map; @Service +@RequiredArgsConstructor +@Slf4j public class DefaultEntityServiceRegistry implements EntityServiceRegistry { private final ApplicationContext applicationContext; - private final Map entityDaoServicesMap; + private final Map entityDaoServicesMap = new HashMap<>(); - public DefaultEntityServiceRegistry(ApplicationContext applicationContext) { - this.applicationContext = applicationContext; - this.entityDaoServicesMap = new HashMap<>(); - } - - @PostConstruct + @EventListener(ContextRefreshedEvent.class) + @Order(Ordered.HIGHEST_PRECEDENCE) public void init() { + log.debug("Initializing EntityServiceRegistry on ContextRefreshedEvent"); applicationContext.getBeansOfType(EntityDaoService.class).values().forEach(entityDaoService -> { EntityType entityType = entityDaoService.getEntityType(); entityDaoServicesMap.put(entityType, entityDaoService); @@ -43,6 +47,7 @@ public class DefaultEntityServiceRegistry implements EntityServiceRegistry { entityDaoServicesMap.put(EntityType.RULE_NODE, entityDaoService); } }); + log.debug("Initialized EntityServiceRegistry total [{}] entries", entityDaoServicesMap.size()); } @Override diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultAlarmQueryRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultAlarmQueryRepository.java index ecf9c1c95f..d9fd2cc66d 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultAlarmQueryRepository.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultAlarmQueryRepository.java @@ -148,6 +148,10 @@ public class DefaultAlarmQueryRepository implements AlarmQueryRepository { } EntityDataSortOrder sortOrder = pageLink.getSortOrder(); + if (sortOrder != null && EntityKeyType.ALARM_FIELD.equals(sortOrder.getKey().getType()) && ASSIGNEE_KEY.equalsIgnoreCase(sortOrder.getKey().getKey())) { + sortOrder = new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, ASSIGNEE_EMAIL_KEY), sortOrder.getDirection()); + } + List alarmFields = new ArrayList<>(); for (EntityKey key : query.getAlarmFields()) { if (EntityKeyType.ALARM_FIELD.equals(key.getType()) && ASSIGNEE_KEY.equalsIgnoreCase(key.getKey())) { @@ -265,6 +269,8 @@ public class DefaultAlarmQueryRepository implements AlarmQueryRepository { } if (pageLink.getAssigneeId() != null) { + addAndIfNeeded(wherePart, addAnd); + addAnd = true; ctx.addUuidParameter("assigneeId", pageLink.getAssigneeId().getId()); wherePart.append(" a.assignee_id = :assigneeId"); } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/AbstractServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/AbstractServiceTest.java index 7f1f5e9ca0..55f3bb58c8 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/AbstractServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/AbstractServiceTest.java @@ -18,6 +18,8 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.After; +import org.junit.Before; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -47,44 +49,17 @@ import org.thingsboard.server.common.data.id.HasId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.ota.ChecksumAlgorithm; import org.thingsboard.server.common.data.ota.OtaPackageType; -import org.thingsboard.server.dao.alarm.AlarmCommentService; -import org.thingsboard.server.dao.alarm.AlarmService; -import org.thingsboard.server.dao.asset.AssetProfileService; -import org.thingsboard.server.dao.asset.AssetService; import org.thingsboard.server.dao.audit.AuditLogLevelFilter; import org.thingsboard.server.dao.audit.AuditLogLevelMask; import org.thingsboard.server.dao.audit.AuditLogLevelProperties; -import org.thingsboard.server.dao.component.ComponentDescriptorService; -import org.thingsboard.server.dao.customer.CustomerService; -import org.thingsboard.server.dao.dashboard.DashboardService; -import org.thingsboard.server.dao.device.DeviceCredentialsService; -import org.thingsboard.server.dao.device.DeviceProfileService; -import org.thingsboard.server.dao.device.DeviceService; -import org.thingsboard.server.dao.edge.EdgeEventService; -import org.thingsboard.server.dao.edge.EdgeService; -import org.thingsboard.server.dao.entity.EntityService; -import org.thingsboard.server.dao.entityview.EntityViewService; -import org.thingsboard.server.dao.event.EventService; -import org.thingsboard.server.dao.ota.OtaPackageService; -import org.thingsboard.server.dao.queue.QueueService; -import org.thingsboard.server.dao.relation.RelationService; -import org.thingsboard.server.dao.resource.ResourceService; -import org.thingsboard.server.dao.rpc.RpcService; -import org.thingsboard.server.dao.rule.RuleChainService; -import org.thingsboard.server.dao.settings.AdminSettingsService; -import org.thingsboard.server.dao.tenant.TenantProfileService; import org.thingsboard.server.dao.tenant.TenantService; -import org.thingsboard.server.dao.timeseries.TimeseriesService; -import org.thingsboard.server.dao.usagerecord.ApiUsageStateService; -import org.thingsboard.server.dao.user.UserService; -import org.thingsboard.server.dao.widget.WidgetTypeService; -import org.thingsboard.server.dao.widget.WidgetsBundleService; import java.io.IOException; import java.nio.ByteBuffer; import java.util.Comparator; import java.util.HashMap; import java.util.Map; +import java.util.UUID; import static org.junit.Assert.assertNotNull; @@ -100,91 +75,20 @@ public abstract class AbstractServiceTest { public static final TenantId SYSTEM_TENANT_ID = TenantId.SYS_TENANT_ID; - @Autowired - protected UserService userService; - - @Autowired - protected ApiUsageStateService apiUsageStateService; - - @Autowired - protected AdminSettingsService adminSettingsService; - @Autowired protected TenantService tenantService; - @Autowired - protected CustomerService customerService; - - @Autowired - protected DeviceService deviceService; - - @Autowired - protected AssetService assetService; - - @Autowired - protected EntityViewService entityViewService; - - @Autowired - protected EntityService entityService; - - @Autowired - protected DeviceCredentialsService deviceCredentialsService; - - @Autowired - protected WidgetsBundleService widgetsBundleService; - - @Autowired - protected WidgetTypeService widgetTypeService; - - @Autowired - protected DashboardService dashboardService; - - @Autowired - protected TimeseriesService tsService; - - @Autowired - protected EventService eventService; - - @Autowired - protected RelationService relationService; - - @Autowired - protected AlarmService alarmService; - @Autowired - protected AlarmCommentService alarmCommentService; - - @Autowired - protected RuleChainService ruleChainService; - - @Autowired - protected EdgeService edgeService; - - @Autowired - protected EdgeEventService edgeEventService; + protected TenantId tenantId; - @Autowired - private ComponentDescriptorService componentDescriptorService; - - @Autowired - protected TenantProfileService tenantProfileService; - - @Autowired - protected DeviceProfileService deviceProfileService; - - @Autowired - protected AssetProfileService assetProfileService; - - @Autowired - protected ResourceService resourceService; - - @Autowired - protected OtaPackageService otaPackageService; - - @Autowired - protected RpcService rpcService; + @Before + public void beforeAbstractService() { + tenantId = createTenant(); + } - @Autowired - protected QueueService queueService; + @After + public void afterAbstractService() { + tenantService.deleteTenants(); + } public class IdComparator implements Comparator { @Override @@ -270,7 +174,7 @@ public abstract class AbstractServiceTest { public TenantId createTenant() { Tenant tenant = new Tenant(); - tenant.setTitle("My tenant " + Uuids.timeBased()); + tenant.setTitle("My tenant " + UUID.randomUUID()); Tenant savedTenant = tenantService.saveTenant(tenant); assertNotNull(savedTenant); return savedTenant.getId(); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java index 1905a0b784..3b8659f93c 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java @@ -19,11 +19,17 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import org.junit.Assert; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.AdminSettings; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.settings.AdminSettingsService; public abstract class BaseAdminSettingsServiceTest extends AbstractServiceTest { + @Autowired + AdminSettingsService adminSettingsService; + @Test public void testFindAdminSettingsByKey() { AdminSettings adminSettings = adminSettingsService.findAdminSettingsByKey(SYSTEM_TENANT_ID, "general"); @@ -54,17 +60,21 @@ public abstract class BaseAdminSettingsServiceTest extends AbstractServiceTest { Assert.assertEquals(adminSettings.getJsonValue(), savedAdminSettings.getJsonValue()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveAdminSettingsWithEmptyKey() { AdminSettings adminSettings = adminSettingsService.findAdminSettingsByKey(SYSTEM_TENANT_ID, "mail"); adminSettings.setKey(null); - adminSettingsService.saveAdminSettings(SYSTEM_TENANT_ID, adminSettings); + Assertions.assertThrows(DataValidationException.class, () -> { + adminSettingsService.saveAdminSettings(SYSTEM_TENANT_ID, adminSettings); + }); } - @Test(expected = DataValidationException.class) + @Test public void testChangeAdminSettingsKey() { AdminSettings adminSettings = adminSettingsService.findAdminSettingsByKey(SYSTEM_TENANT_ID, "mail"); adminSettings.setKey("newKey"); - adminSettingsService.saveAdminSettings(SYSTEM_TENANT_ID, adminSettings); + Assertions.assertThrows(DataValidationException.class, () -> { + adminSettingsService.saveAdminSettings(SYSTEM_TENANT_ID, adminSettings); + }); } } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmCommentServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmCommentServiceTest.java index 688793d6c6..1144ec6513 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmCommentServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmCommentServiceTest.java @@ -20,21 +20,22 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.testcontainers.shaded.org.apache.commons.lang3.RandomStringUtils; import org.thingsboard.common.util.JacksonUtil; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.User; import org.thingsboard.server.common.data.alarm.Alarm; import org.thingsboard.server.common.data.alarm.AlarmComment; import org.thingsboard.server.common.data.alarm.AlarmCommentInfo; import org.thingsboard.server.common.data.alarm.AlarmSeverity; -import org.thingsboard.server.common.data.alarm.AlarmStatus; import org.thingsboard.server.common.data.id.AssetId; -import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.id.UserId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.dao.alarm.AlarmCommentService; +import org.thingsboard.server.dao.alarm.AlarmService; +import org.thingsboard.server.dao.user.UserService; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -43,19 +44,19 @@ import static org.thingsboard.server.common.data.alarm.AlarmCommentType.OTHER; public abstract class BaseAlarmCommentServiceTest extends AbstractServiceTest { + @Autowired + AlarmService alarmService; + @Autowired + AlarmCommentService alarmCommentService; + @Autowired + UserService userService; + public static final String TEST_ALARM = "TEST_ALARM"; - private TenantId tenantId; private Alarm alarm; private User user; @Before public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - alarm = Alarm.builder().tenantId(tenantId).originator(new AssetId(Uuids.timeBased())) .type(TEST_ALARM) .severity(AlarmSeverity.CRITICAL) @@ -74,7 +75,6 @@ public abstract class BaseAlarmCommentServiceTest extends AbstractServiceTest { @After public void after() { alarmService.deleteAlarm(tenantId, alarm.getId()); - tenantService.deleteTenant(tenantId); } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java index b7f5135533..9c81bfd232 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java @@ -16,14 +16,12 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.Device; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.User; import org.thingsboard.server.common.data.alarm.Alarm; import org.thingsboard.server.common.data.alarm.AlarmCreateOrUpdateActiveRequest; @@ -36,9 +34,7 @@ import org.thingsboard.server.common.data.alarm.AlarmStatus; import org.thingsboard.server.common.data.alarm.AlarmUpdateRequest; import org.thingsboard.server.common.data.asset.Asset; import org.thingsboard.server.common.data.id.AssetId; -import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; -import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.page.SortOrder; import org.thingsboard.server.common.data.page.TimePageLink; import org.thingsboard.server.common.data.query.AlarmData; @@ -52,7 +48,12 @@ import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.RelationTypeGroup; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.alarm.AlarmApiCallResult; -import org.thingsboard.server.dao.alarm.AlarmOperationResult; +import org.thingsboard.server.dao.alarm.AlarmService; +import org.thingsboard.server.dao.asset.AssetService; +import org.thingsboard.server.dao.customer.CustomerService; +import org.thingsboard.server.dao.device.DeviceService; +import org.thingsboard.server.dao.relation.RelationService; +import org.thingsboard.server.dao.user.UserService; import java.util.Arrays; import java.util.Collections; @@ -61,29 +62,24 @@ import java.util.concurrent.ExecutionException; public abstract class BaseAlarmServiceTest extends AbstractServiceTest { - public static final String TEST_ALARM = "TEST_ALARM"; + @Autowired + AlarmService alarmService; + @Autowired + AssetService assetService; + @Autowired + CustomerService customerService; + @Autowired + DeviceService deviceService; + @Autowired + RelationService relationService; + @Autowired + UserService userService; + public static final String TEST_ALARM = "TEST_ALARM"; private static final String TEST_TENANT_EMAIL = "testtenant@thingsboard.org"; private static final String TEST_TENANT_FIRST_NAME = "testtenantfirstname"; private static final String TEST_TENANT_LAST_NAME = "testtenantlastname"; - private TenantId tenantId; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } - - @After - public void after() { - tenantService.deleteTenant(tenantId); - } - - @Test public void testSaveAndFetchAlarm() throws ExecutionException, InterruptedException { AssetId parentId = new AssetId(Uuids.timeBased()); @@ -271,6 +267,7 @@ public abstract class BaseAlarmServiceTest extends AbstractServiceTest { pageLink.setPage(0); pageLink.setPageSize(10); pageLink.setAssigneeId(tenantUser.getId()); + pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, "assignee"))); PageData assignedAlarms = alarmService.findAlarmDataByQueryForEntities(tenantId, toQuery(pageLink), Collections.singletonList(created.getOriginator())); Assert.assertNotNull(assignedAlarms.getData()); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseApiUsageStateServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseApiUsageStateServiceTest.java index 2ea7147a65..2ee2f74b3e 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseApiUsageStateServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseApiUsageStateServiceTest.java @@ -15,33 +15,18 @@ */ package org.thingsboard.server.dao.service; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.ApiUsageStateValue; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.ApiUsageState; -import org.thingsboard.server.common.data.id.TenantId; +import org.thingsboard.server.dao.usagerecord.ApiUsageStateService; public abstract class BaseApiUsageStateServiceTest extends AbstractServiceTest { - private TenantId tenantId; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } - - @After - public void after() { - tenantService.deleteTenant(tenantId); - } + @Autowired + ApiUsageStateService apiUsageStateService; @Test public void testFindApiUsageStateByTenantId() { diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetProfileServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetProfileServiceTest.java index 345671968e..02bf4b1b1a 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetProfileServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetProfileServiceTest.java @@ -19,18 +19,18 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.common.util.ThingsBoardThreadFactory; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.asset.Asset; import org.thingsboard.server.common.data.asset.AssetProfile; import org.thingsboard.server.common.data.asset.AssetProfileInfo; -import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; +import org.thingsboard.server.dao.asset.AssetProfileService; +import org.thingsboard.server.dao.asset.AssetService; import org.thingsboard.server.dao.exception.DataValidationException; import java.util.ArrayList; @@ -45,21 +45,10 @@ public abstract class BaseAssetProfileServiceTest extends AbstractServiceTest { private IdComparator idComparator = new IdComparator<>(); private IdComparator assetProfileInfoIdComparator = new IdComparator<>(); - private TenantId tenantId; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } - - @After - public void after() { - tenantService.deleteTenant(tenantId); - } + @Autowired + AssetProfileService assetProfileService; + @Autowired + AssetService assetService; @Test public void testSaveAssetProfile() { @@ -150,22 +139,26 @@ public abstract class BaseAssetProfileServiceTest extends AbstractServiceTest { Assert.assertEquals(savedAssetProfile2.getId(), defaultAssetProfile.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveAssetProfileWithEmptyName() { AssetProfile assetProfile = new AssetProfile(); assetProfile.setTenantId(tenantId); - assetProfileService.saveAssetProfile(assetProfile); + Assertions.assertThrows(DataValidationException.class, () -> { + assetProfileService.saveAssetProfile(assetProfile); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveAssetProfileWithSameName() { AssetProfile assetProfile = this.createAssetProfile(tenantId, "Asset Profile"); assetProfileService.saveAssetProfile(assetProfile); AssetProfile assetProfile2 = this.createAssetProfile(tenantId, "Asset Profile"); - assetProfileService.saveAssetProfile(assetProfile2); + Assertions.assertThrows(DataValidationException.class, () -> { + assetProfileService.saveAssetProfile(assetProfile2); + }); } - @Test(expected = DataValidationException.class) + @Test public void testDeleteAssetProfileWithExistingAsset() { AssetProfile assetProfile = this.createAssetProfile(tenantId, "Asset Profile"); AssetProfile savedAssetProfile = assetProfileService.saveAssetProfile(assetProfile); @@ -174,7 +167,9 @@ public abstract class BaseAssetProfileServiceTest extends AbstractServiceTest { asset.setName("Test asset"); asset.setAssetProfileId(savedAssetProfile.getId()); assetService.saveAsset(asset); - assetProfileService.deleteAssetProfile(tenantId, savedAssetProfile.getId()); + Assertions.assertThrows(DataValidationException.class, () -> { + assetProfileService.deleteAssetProfile(tenantId, savedAssetProfile.getId()); + }); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java index 9fe9752a85..9f4c8fe363 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java @@ -16,10 +16,10 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.EntitySubtype; import org.thingsboard.server.common.data.StringUtils; @@ -30,6 +30,8 @@ import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; +import org.thingsboard.server.dao.asset.AssetService; +import org.thingsboard.server.dao.customer.CustomerService; import org.thingsboard.server.dao.exception.DataValidationException; import java.util.ArrayList; @@ -40,23 +42,12 @@ import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; public abstract class BaseAssetServiceTest extends AbstractServiceTest { - private IdComparator idComparator = new IdComparator<>(); - - private TenantId tenantId; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } + @Autowired + AssetService assetService; + @Autowired + CustomerService customerService; - @After - public void after() { - tenantService.deleteTenant(tenantId); - } + private IdComparator idComparator = new IdComparator<>(); @Test public void testSaveAsset() { @@ -83,63 +74,73 @@ public abstract class BaseAssetServiceTest extends AbstractServiceTest { assetService.deleteAsset(tenantId, savedAsset.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveAssetWithEmptyName() { Asset asset = new Asset(); asset.setTenantId(tenantId); asset.setType("default"); - assetService.saveAsset(asset); + Assertions.assertThrows(DataValidationException.class, () -> { + assetService.saveAsset(asset); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveAssetWithEmptyTenant() { Asset asset = new Asset(); asset.setName("My asset"); asset.setType("default"); - assetService.saveAsset(asset); + Assertions.assertThrows(DataValidationException.class, () -> { + assetService.saveAsset(asset); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveAssetWithInvalidTenant() { Asset asset = new Asset(); asset.setName("My asset"); asset.setType("default"); asset.setTenantId(TenantId.fromUUID(Uuids.timeBased())); - assetService.saveAsset(asset); + Assertions.assertThrows(DataValidationException.class, () -> { + assetService.saveAsset(asset); + }); } - @Test(expected = DataValidationException.class) + @Test public void testAssignAssetToNonExistentCustomer() { Asset asset = new Asset(); asset.setName("My asset"); asset.setType("default"); asset.setTenantId(tenantId); - asset = assetService.saveAsset(asset); + Asset savedAsset = assetService.saveAsset(asset); try { - assetService.assignAssetToCustomer(tenantId, asset.getId(), new CustomerId(Uuids.timeBased())); + Assertions.assertThrows(DataValidationException.class, () -> { + assetService.assignAssetToCustomer(tenantId, savedAsset.getId(), new CustomerId(Uuids.timeBased())); + }); } finally { - assetService.deleteAsset(tenantId, asset.getId()); + assetService.deleteAsset(tenantId, savedAsset.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testAssignAssetToCustomerFromDifferentTenant() { Asset asset = new Asset(); asset.setName("My asset"); asset.setType("default"); asset.setTenantId(tenantId); - asset = assetService.saveAsset(asset); + Asset savedAsset = assetService.saveAsset(asset); Tenant tenant = new Tenant(); tenant.setTitle("Test different tenant"); tenant = tenantService.saveTenant(tenant); Customer customer = new Customer(); customer.setTenantId(tenant.getId()); customer.setTitle("Test different customer"); - customer = customerService.saveCustomer(customer); + Customer savedCustomer = customerService.saveCustomer(customer); try { - assetService.assignAssetToCustomer(tenantId, asset.getId(), customer.getId()); + Assertions.assertThrows(DataValidationException.class, () -> { + assetService.assignAssetToCustomer(tenantId, savedAsset.getId(), savedCustomer.getId()); + }); } finally { - assetService.deleteAsset(tenantId, asset.getId()); + assetService.deleteAsset(tenantId, savedAsset.getId()); tenantService.deleteTenant(tenant.getId()); } } @@ -209,12 +210,6 @@ public abstract class BaseAssetServiceTest extends AbstractServiceTest { @Test public void testFindAssetsByTenantId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - List assets = new ArrayList<>(); for (int i=0;i<178;i++) { Asset asset = new Asset(); @@ -246,8 +241,6 @@ public abstract class BaseAssetServiceTest extends AbstractServiceTest { pageData = assetService.findAssetsByTenantId(tenantId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test @@ -408,12 +401,6 @@ public abstract class BaseAssetServiceTest extends AbstractServiceTest { @Test public void testFindAssetsByTenantIdAndCustomerId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - Customer customer = new Customer(); customer.setTitle("Test customer"); customer.setTenantId(tenantId); @@ -452,8 +439,6 @@ public abstract class BaseAssetServiceTest extends AbstractServiceTest { pageData = assetService.findAssetInfosByTenantIdAndCustomerId(tenantId, customerId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java index 11d82ad963..371d8abb99 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java @@ -24,6 +24,8 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.common.util.ThingsBoardExecutors; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.StringUtils; @@ -31,6 +33,7 @@ import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; +import org.thingsboard.server.dao.customer.CustomerService; import org.thingsboard.server.dao.exception.DataValidationException; import java.util.ArrayList; @@ -40,28 +43,22 @@ import java.util.concurrent.TimeUnit; import static org.assertj.core.api.Assertions.assertThat; public abstract class BaseCustomerServiceTest extends AbstractServiceTest { + + @Autowired + CustomerService customerService; + static final int TIMEOUT = 30; ListeningExecutorService executor; - private TenantId tenantId; - @Before public void before() { executor = MoreExecutors.listeningDecorator(ThingsBoardExecutors.newWorkStealingPool(8, getClass())); - - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } + } @After public void after() { executor.shutdownNow(); - - tenantService.deleteTenant(tenantId); } @Test @@ -99,35 +96,43 @@ public abstract class BaseCustomerServiceTest extends AbstractServiceTest { customerService.deleteCustomer(tenantId, savedCustomer.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveCustomerWithEmptyTitle() { Customer customer = new Customer(); customer.setTenantId(tenantId); - customerService.saveCustomer(customer); + Assertions.assertThrows(DataValidationException.class, () -> { + customerService.saveCustomer(customer); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveCustomerWithEmptyTenant() { Customer customer = new Customer(); customer.setTitle("My customer"); - customerService.saveCustomer(customer); + Assertions.assertThrows(DataValidationException.class, () -> { + customerService.saveCustomer(customer); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveCustomerWithInvalidTenant() { Customer customer = new Customer(); customer.setTitle("My customer"); customer.setTenantId(TenantId.fromUUID(Uuids.timeBased())); - customerService.saveCustomer(customer); + Assertions.assertThrows(DataValidationException.class, () -> { + customerService.saveCustomer(customer); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveCustomerWithInvalidEmail() { Customer customer = new Customer(); customer.setTenantId(tenantId); customer.setTitle("My customer"); customer.setEmail("invalid@mail"); - customerService.saveCustomer(customer); + Assertions.assertThrows(DataValidationException.class, () -> { + customerService.saveCustomer(customer); + }); } @Test @@ -143,11 +148,6 @@ public abstract class BaseCustomerServiceTest extends AbstractServiceTest { @Test public void testFindCustomersByTenantId() throws Exception { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); List> futures = new ArrayList<>(135); for (int i = 0; i < 135; i++) { @@ -178,8 +178,6 @@ public abstract class BaseCustomerServiceTest extends AbstractServiceTest { pageData = customerService.findCustomersByTenantId(tenantId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java index 88d66e9586..7ccd5e6211 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java @@ -16,10 +16,10 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.Dashboard; import org.thingsboard.server.common.data.DashboardInfo; @@ -32,6 +32,9 @@ import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.page.SortOrder; +import org.thingsboard.server.dao.customer.CustomerService; +import org.thingsboard.server.dao.dashboard.DashboardService; +import org.thingsboard.server.dao.edge.EdgeService; import org.thingsboard.server.dao.exception.DataValidationException; import java.io.IOException; @@ -41,24 +44,15 @@ import java.util.List; import java.util.concurrent.ExecutionException; public abstract class BaseDashboardServiceTest extends AbstractServiceTest { - - private IdComparator idComparator = new IdComparator<>(); - - private TenantId tenantId; - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } + @Autowired + CustomerService customerService; + @Autowired + DashboardService dashboardService; + @Autowired + EdgeService edgeService; - @After - public void after() { - tenantService.deleteTenant(tenantId); - } + private IdComparator idComparator = new IdComparator<>(); @Test public void testSaveDashboard() throws IOException { @@ -82,58 +76,68 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest { dashboardService.deleteDashboard(tenantId, savedDashboard.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDashboardWithEmptyTitle() { Dashboard dashboard = new Dashboard(); dashboard.setTenantId(tenantId); - dashboardService.saveDashboard(dashboard); + Assertions.assertThrows(DataValidationException.class, () -> { + dashboardService.saveDashboard(dashboard); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDashboardWithEmptyTenant() { Dashboard dashboard = new Dashboard(); dashboard.setTitle("My dashboard"); - dashboardService.saveDashboard(dashboard); + Assertions.assertThrows(DataValidationException.class, () -> { + dashboardService.saveDashboard(dashboard); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDashboardWithInvalidTenant() { Dashboard dashboard = new Dashboard(); dashboard.setTitle("My dashboard"); dashboard.setTenantId(TenantId.fromUUID(Uuids.timeBased())); - dashboardService.saveDashboard(dashboard); + Assertions.assertThrows(DataValidationException.class, () -> { + dashboardService.saveDashboard(dashboard); + }); } - @Test(expected = DataValidationException.class) + @Test public void testAssignDashboardToNonExistentCustomer() { Dashboard dashboard = new Dashboard(); dashboard.setTitle("My dashboard"); dashboard.setTenantId(tenantId); - dashboard = dashboardService.saveDashboard(dashboard); + Dashboard savedDashboard = dashboardService.saveDashboard(dashboard); try { - dashboardService.assignDashboardToCustomer(tenantId, dashboard.getId(), new CustomerId(Uuids.timeBased())); + Assertions.assertThrows(DataValidationException.class, () -> { + dashboardService.assignDashboardToCustomer(tenantId, savedDashboard.getId(), new CustomerId(Uuids.timeBased())); + }); } finally { - dashboardService.deleteDashboard(tenantId, dashboard.getId()); + dashboardService.deleteDashboard(tenantId, savedDashboard.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testAssignDashboardToCustomerFromDifferentTenant() { Dashboard dashboard = new Dashboard(); dashboard.setTitle("My dashboard"); dashboard.setTenantId(tenantId); - dashboard = dashboardService.saveDashboard(dashboard); + Dashboard savedDashboard = dashboardService.saveDashboard(dashboard); Tenant tenant = new Tenant(); tenant.setTitle("Test different tenant [dashboard]"); tenant = tenantService.saveTenant(tenant); Customer customer = new Customer(); customer.setTenantId(tenant.getId()); customer.setTitle("Test different customer"); - customer = customerService.saveCustomer(customer); + Customer savedCustomer = customerService.saveCustomer(customer); try { - dashboardService.assignDashboardToCustomer(tenantId, dashboard.getId(), customer.getId()); + Assertions.assertThrows(DataValidationException.class, () -> { + dashboardService.assignDashboardToCustomer(tenantId, savedDashboard.getId(), savedCustomer.getId()); + }); } finally { - dashboardService.deleteDashboard(tenantId, dashboard.getId()); + dashboardService.deleteDashboard(tenantId, savedDashboard.getId()); tenantService.deleteTenant(tenant.getId()); } } @@ -165,12 +169,6 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest { @Test public void testFindDashboardsByTenantId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - List dashboards = new ArrayList<>(); for (int i=0;i<165;i++) { Dashboard dashboard = new Dashboard(); @@ -201,18 +199,10 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest { pageData = dashboardService.findDashboardsByTenantId(tenantId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test public void testFindMobileDashboardsByTenantId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - List mobileDashboards = new ArrayList<>(); for (int i=0;i<165;i++) { Dashboard dashboard = new Dashboard(); @@ -261,8 +251,6 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest { pageData = dashboardService.findMobileDashboardsByTenantId(tenantId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test @@ -342,12 +330,6 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest { @Test public void testFindDashboardsByTenantIdAndCustomerId() throws ExecutionException, InterruptedException { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - Customer customer = new Customer(); customer.setTitle("Test customer"); customer.setTenantId(tenantId); @@ -385,29 +367,29 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest { pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } - @Test(expected = DataValidationException.class) + @Test public void testAssignDashboardToNonExistentEdge() { Dashboard dashboard = new Dashboard(); dashboard.setTitle("My dashboard"); dashboard.setTenantId(tenantId); - dashboard = dashboardService.saveDashboard(dashboard); + Dashboard savedDashboard = dashboardService.saveDashboard(dashboard); try { - dashboardService.assignDashboardToEdge(tenantId, dashboard.getId(), new EdgeId(Uuids.timeBased())); + Assertions.assertThrows(DataValidationException.class, () -> { + dashboardService.assignDashboardToEdge(tenantId, savedDashboard.getId(), new EdgeId(Uuids.timeBased())); + }); } finally { - dashboardService.deleteDashboard(tenantId, dashboard.getId()); + dashboardService.deleteDashboard(tenantId, savedDashboard.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testAssignDashboardToEdgeFromDifferentTenant() { Dashboard dashboard = new Dashboard(); dashboard.setTitle("My dashboard"); dashboard.setTenantId(tenantId); - dashboard = dashboardService.saveDashboard(dashboard); + Dashboard savedDashboard = dashboardService.saveDashboard(dashboard); Tenant tenant = new Tenant(); tenant.setTitle("Test different tenant [edge]"); tenant = tenantService.saveTenant(tenant); @@ -418,11 +400,13 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest { edge.setType("default"); edge.setSecret(StringUtils.randomAlphanumeric(20)); edge.setRoutingKey(StringUtils.randomAlphanumeric(20)); - edge = edgeService.saveEdge(edge); + Edge savedEdge = edgeService.saveEdge(edge); try { - dashboardService.assignDashboardToEdge(tenantId, dashboard.getId(), edge.getId()); + Assertions.assertThrows(DataValidationException.class, () -> { + dashboardService.assignDashboardToEdge(tenantId, savedDashboard.getId(), savedEdge.getId()); + }); } finally { - dashboardService.deleteDashboard(tenantId, dashboard.getId()); + dashboardService.deleteDashboard(tenantId, savedDashboard.getId()); tenantService.deleteTenant(tenant.getId()); } } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java index a1d4543c58..4512a5fa4f 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java @@ -16,44 +16,35 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.Device; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.id.DeviceCredentialsId; import org.thingsboard.server.common.data.id.DeviceId; -import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.security.DeviceCredentials; import org.thingsboard.server.common.data.security.DeviceCredentialsType; +import org.thingsboard.server.dao.device.DeviceCredentialsService; +import org.thingsboard.server.dao.device.DeviceService; import org.thingsboard.server.dao.exception.DataValidationException; public abstract class BaseDeviceCredentialsServiceTest extends AbstractServiceTest { - private TenantId tenantId; + @Autowired + DeviceCredentialsService deviceCredentialsService; + @Autowired + DeviceService deviceService; - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } - - @After - public void after() { - tenantService.deleteTenant(tenantId); - } - - @Test(expected = DataValidationException.class) + @Test public void testCreateDeviceCredentials() { DeviceCredentials deviceCredentials = new DeviceCredentials(); - deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceCredentialsWithEmptyDevice() { Device device = new Device(); device.setName("My device"); @@ -63,13 +54,15 @@ public abstract class BaseDeviceCredentialsServiceTest extends AbstractServiceTe DeviceCredentials deviceCredentials = deviceCredentialsService.findDeviceCredentialsByDeviceId(tenantId, device.getId()); deviceCredentials.setDeviceId(null); try { - deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + }); } finally { deviceService.deleteDevice(tenantId, device.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceCredentialsWithEmptyCredentialsType() { Device device = new Device(); device.setName("My device"); @@ -79,13 +72,15 @@ public abstract class BaseDeviceCredentialsServiceTest extends AbstractServiceTe DeviceCredentials deviceCredentials = deviceCredentialsService.findDeviceCredentialsByDeviceId(tenantId, device.getId()); deviceCredentials.setCredentialsType(null); try { - deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + }); } finally { deviceService.deleteDevice(tenantId, device.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceCredentialsWithEmptyCredentialsId() { Device device = new Device(); device.setName("My device"); @@ -95,13 +90,15 @@ public abstract class BaseDeviceCredentialsServiceTest extends AbstractServiceTe DeviceCredentials deviceCredentials = deviceCredentialsService.findDeviceCredentialsByDeviceId(tenantId, device.getId()); deviceCredentials.setCredentialsId(null); try { - deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + }); } finally { deviceService.deleteDevice(tenantId, device.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testSaveNonExistentDeviceCredentials() { Device device = new Device(); device.setName("My device"); @@ -115,13 +112,15 @@ public abstract class BaseDeviceCredentialsServiceTest extends AbstractServiceTe newDeviceCredentials.setCredentialsType(deviceCredentials.getCredentialsType()); newDeviceCredentials.setCredentialsId(deviceCredentials.getCredentialsId()); try { - deviceCredentialsService.updateDeviceCredentials(tenantId, newDeviceCredentials); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceCredentialsService.updateDeviceCredentials(tenantId, newDeviceCredentials); + }); } finally { deviceService.deleteDevice(tenantId, device.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceCredentialsWithNonExistentDevice() { Device device = new Device(); device.setName("My device"); @@ -131,7 +130,9 @@ public abstract class BaseDeviceCredentialsServiceTest extends AbstractServiceTe DeviceCredentials deviceCredentials = deviceCredentialsService.findDeviceCredentialsByDeviceId(tenantId, device.getId()); deviceCredentials.setDeviceId(new DeviceId(Uuids.timeBased())); try { - deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials); + }); } finally { deviceService.deleteDevice(tenantId, device.getId()); } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java index 744de8f027..fa43d98374 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java @@ -19,23 +19,24 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Ignore; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.common.util.ThingsBoardThreadFactory; import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.DeviceProfileInfo; import org.thingsboard.server.common.data.DeviceTransportType; import org.thingsboard.server.common.data.OtaPackage; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.ota.ChecksumAlgorithm; -import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; +import org.thingsboard.server.dao.device.DeviceProfileService; +import org.thingsboard.server.dao.device.DeviceService; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.ota.OtaPackageService; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -43,7 +44,6 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; @@ -51,25 +51,16 @@ import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; public abstract class BaseDeviceProfileServiceTest extends AbstractServiceTest { + @Autowired + DeviceProfileService deviceProfileService; + @Autowired + DeviceService deviceService; + @Autowired + OtaPackageService otaPackageService; + private IdComparator idComparator = new IdComparator<>(); private IdComparator deviceProfileInfoIdComparator = new IdComparator<>(); - private TenantId tenantId; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } - - @After - public void after() { - tenantService.deleteTenant(tenantId); - } - @Test public void testSaveDeviceProfile() { DeviceProfile deviceProfile = this.createDeviceProfile(tenantId, "Device Profile"); @@ -196,23 +187,27 @@ public abstract class BaseDeviceProfileServiceTest extends AbstractServiceTest { Assert.assertEquals(savedDeviceProfile2.getId(), defaultDeviceProfile.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceProfileWithEmptyName() { DeviceProfile deviceProfile = new DeviceProfile(); deviceProfile.setTenantId(tenantId); - deviceProfileService.saveDeviceProfile(deviceProfile); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceProfileService.saveDeviceProfile(deviceProfile); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceProfileWithSameName() { DeviceProfile deviceProfile = this.createDeviceProfile(tenantId, "Device Profile"); deviceProfileService.saveDeviceProfile(deviceProfile); DeviceProfile deviceProfile2 = this.createDeviceProfile(tenantId, "Device Profile"); - deviceProfileService.saveDeviceProfile(deviceProfile2); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceProfileService.saveDeviceProfile(deviceProfile2); + }); } @Ignore - @Test(expected = DataValidationException.class) + @Test public void testChangeDeviceProfileTypeWithExistingDevices() { DeviceProfile deviceProfile = this.createDeviceProfile(tenantId, "Device Profile"); DeviceProfile savedDeviceProfile = deviceProfileService.saveDeviceProfile(deviceProfile); @@ -224,10 +219,12 @@ public abstract class BaseDeviceProfileServiceTest extends AbstractServiceTest { deviceService.saveDevice(device); //TODO: once we have more profile types, we should test that we can not change profile type in runtime and uncomment the @Ignore. // savedDeviceProfile.setType(DeviceProfileType.LWM2M); - deviceProfileService.saveDeviceProfile(savedDeviceProfile); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceProfileService.saveDeviceProfile(savedDeviceProfile); + }); } - @Test(expected = DataValidationException.class) + @Test public void testChangeDeviceProfileTransportTypeWithExistingDevices() { DeviceProfile deviceProfile = this.createDeviceProfile(tenantId, "Device Profile"); DeviceProfile savedDeviceProfile = deviceProfileService.saveDeviceProfile(deviceProfile); @@ -238,10 +235,12 @@ public abstract class BaseDeviceProfileServiceTest extends AbstractServiceTest { device.setDeviceProfileId(savedDeviceProfile.getId()); deviceService.saveDevice(device); savedDeviceProfile.setTransportType(DeviceTransportType.MQTT); - deviceProfileService.saveDeviceProfile(savedDeviceProfile); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceProfileService.saveDeviceProfile(savedDeviceProfile); + }); } - @Test(expected = DataValidationException.class) + @Test public void testDeleteDeviceProfileWithExistingDevice() { DeviceProfile deviceProfile = this.createDeviceProfile(tenantId, "Device Profile"); DeviceProfile savedDeviceProfile = deviceProfileService.saveDeviceProfile(deviceProfile); @@ -251,7 +250,9 @@ public abstract class BaseDeviceProfileServiceTest extends AbstractServiceTest { device.setType("default"); device.setDeviceProfileId(savedDeviceProfile.getId()); deviceService.saveDevice(device); - deviceProfileService.deleteDeviceProfile(tenantId, savedDeviceProfile.getId()); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceProfileService.deleteDeviceProfile(tenantId, savedDeviceProfile.getId()); + }); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java index ea2fa9546f..73b71ceae3 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java @@ -19,9 +19,9 @@ import com.datastax.oss.driver.api.core.uuid.Uuids; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.DeviceInfo; @@ -39,26 +39,43 @@ import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.security.DeviceCredentials; import org.thingsboard.server.common.data.security.DeviceCredentialsType; import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration; +import org.thingsboard.server.dao.customer.CustomerService; +import org.thingsboard.server.dao.device.DeviceCredentialsService; +import org.thingsboard.server.dao.device.DeviceProfileService; +import org.thingsboard.server.dao.device.DeviceService; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.ota.OtaPackageService; +import org.thingsboard.server.dao.tenant.TenantProfileService; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; public abstract class BaseDeviceServiceTest extends AbstractServiceTest { - private IdComparator idComparator = new IdComparator<>(); + @Autowired + CustomerService customerService; + @Autowired + DeviceCredentialsService deviceCredentialsService; + @Autowired + DeviceProfileService deviceProfileService; + @Autowired + DeviceService deviceService; + @Autowired + OtaPackageService otaPackageService; + @Autowired + TenantProfileService tenantProfileService; - private TenantId tenantId; + private IdComparator idComparator = new IdComparator<>(); private TenantId anotherTenantId; @Before public void before() { - tenantId = createTenant(); anotherTenantId = createTenant(); } @@ -71,10 +88,6 @@ public abstract class BaseDeviceServiceTest extends AbstractServiceTest { tenantProfileService.deleteTenantProfiles(anotherTenantId); } - @SuppressWarnings("deprecation") - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void testSaveDevicesWithoutMaxDeviceLimit() { Device device = this.saveDevice(tenantId, "My device"); @@ -91,7 +104,7 @@ public abstract class BaseDeviceServiceTest extends AbstractServiceTest { deleteDevice(tenantId, device); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDevicesWithMaxDeviceOutOfLimit() { TenantProfile defaultTenantProfile = tenantProfileService.findDefaultTenantProfile(tenantId); defaultTenantProfile.getProfileData().setConfiguration(DefaultTenantProfileConfiguration.builder().maxDevices(1).build()); @@ -102,7 +115,9 @@ public abstract class BaseDeviceServiceTest extends AbstractServiceTest { this.saveDevice(tenantId, "My first device"); Assert.assertEquals(1, deviceService.countByTenantId(tenantId)); - this.saveDevice(tenantId, "My second device that out of maxDeviceCount limit"); + Assertions.assertThrows(DataValidationException.class, () -> { + this.saveDevice(tenantId, "My second device that out of maxDeviceCount limit"); + }); } @Test @@ -241,68 +256,78 @@ public abstract class BaseDeviceServiceTest extends AbstractServiceTest { savedDevice.setFirmwareId(savedFirmware.getId()); - thrown.expect(DataValidationException.class); - thrown.expectMessage("Can't assign firmware with different deviceProfile!"); - deviceService.saveDevice(savedDevice); + assertThatThrownBy(() -> deviceService.saveDevice(savedDevice)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("Can't assign firmware with different deviceProfile!"); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceWithEmptyName() { Device device = new Device(); device.setType("default"); device.setTenantId(tenantId); - deviceService.saveDevice(device); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceService.saveDevice(device); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceWithEmptyTenant() { Device device = new Device(); device.setName("My device"); device.setType("default"); - deviceService.saveDevice(device); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceService.saveDevice(device); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveDeviceWithInvalidTenant() { Device device = new Device(); device.setName("My device"); device.setType("default"); device.setTenantId(TenantId.fromUUID(Uuids.timeBased())); - deviceService.saveDevice(device); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceService.saveDevice(device); + }); } - @Test(expected = DataValidationException.class) + @Test public void testAssignDeviceToNonExistentCustomer() { Device device = new Device(); device.setName("My device"); device.setType("default"); device.setTenantId(tenantId); - device = deviceService.saveDevice(device); + Device savedDevice = deviceService.saveDevice(device); try { - deviceService.assignDeviceToCustomer(tenantId, device.getId(), new CustomerId(Uuids.timeBased())); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceService.assignDeviceToCustomer(tenantId, savedDevice.getId(), new CustomerId(Uuids.timeBased())); + }); } finally { - deviceService.deleteDevice(tenantId, device.getId()); + deviceService.deleteDevice(tenantId, savedDevice.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testAssignDeviceToCustomerFromDifferentTenant() { Device device = new Device(); device.setName("My device"); device.setType("default"); device.setTenantId(tenantId); - device = deviceService.saveDevice(device); + Device savedDevice = deviceService.saveDevice(device); Tenant tenant = new Tenant(); tenant.setTitle("Test different tenant"); tenant = tenantService.saveTenant(tenant); Customer customer = new Customer(); customer.setTenantId(tenant.getId()); customer.setTitle("Test different customer"); - customer = customerService.saveCustomer(customer); + Customer savedCustomer = customerService.saveCustomer(customer); try { - deviceService.assignDeviceToCustomer(tenantId, device.getId(), customer.getId()); + Assertions.assertThrows(DataValidationException.class, () -> { + deviceService.assignDeviceToCustomer(tenantId, savedDevice.getId(), savedCustomer.getId()); + }); } finally { - deviceService.deleteDevice(tenantId, device.getId()); + deviceService.deleteDevice(tenantId, savedDevice.getId()); tenantService.deleteTenant(tenant.getId()); } } @@ -376,12 +401,6 @@ public abstract class BaseDeviceServiceTest extends AbstractServiceTest { @Test public void testFindDevicesByTenantId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - List devices = new ArrayList<>(); for (int i = 0; i < 178; i++) { Device device = new Device(); @@ -413,8 +432,6 @@ public abstract class BaseDeviceServiceTest extends AbstractServiceTest { pageData = deviceService.findDevicesByTenantId(tenantId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test @@ -575,12 +592,6 @@ public abstract class BaseDeviceServiceTest extends AbstractServiceTest { @Test public void testFindDevicesByTenantIdAndCustomerId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - Customer customer = new Customer(); customer.setTitle("Test customer"); customer.setTenantId(tenantId); @@ -619,8 +630,6 @@ public abstract class BaseDeviceServiceTest extends AbstractServiceTest { pageData = deviceService.findDeviceInfosByTenantIdAndCustomerId(tenantId, customerId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeEventServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeEventServiceTest.java index 3bd47cc991..3b942dab5f 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeEventServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeEventServiceTest.java @@ -21,6 +21,7 @@ import com.google.common.util.concurrent.ListenableFuture; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.edge.EdgeEvent; import org.thingsboard.server.common.data.edge.EdgeEventActionType; import org.thingsboard.server.common.data.edge.EdgeEventType; @@ -32,20 +33,20 @@ import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.SortOrder; import org.thingsboard.server.common.data.page.TimePageLink; +import org.thingsboard.server.dao.edge.EdgeEventService; import java.io.IOException; import java.text.ParseException; -import java.time.LocalDateTime; -import java.time.Month; -import java.time.ZoneOffset; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.TimeUnit; import static org.apache.commons.lang3.time.DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT; public abstract class BaseEdgeEventServiceTest extends AbstractServiceTest { + @Autowired + EdgeEventService edgeEventService; + long timeBeforeStartTime; long startTime; long eventTime; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeServiceTest.java index 5aced56afd..9b307b2f8c 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeServiceTest.java @@ -17,10 +17,10 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.EntitySubtype; @@ -35,7 +35,10 @@ import org.thingsboard.server.common.data.rule.RuleChain; import org.thingsboard.server.common.data.rule.RuleChainMetaData; import org.thingsboard.server.common.data.rule.RuleChainType; import org.thingsboard.server.common.data.rule.RuleNode; +import org.thingsboard.server.dao.customer.CustomerService; +import org.thingsboard.server.dao.edge.EdgeService; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.rule.RuleChainService; import java.util.ArrayList; import java.util.Arrays; @@ -46,23 +49,14 @@ import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; public abstract class BaseEdgeServiceTest extends AbstractServiceTest { - private IdComparator idComparator = new IdComparator<>(); - - private TenantId tenantId; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } + @Autowired + CustomerService customerService; + @Autowired + EdgeService edgeService; + @Autowired + RuleChainService ruleChainService; - @After - public void after() { - tenantService.deleteTenant(tenantId); - } + private IdComparator idComparator = new IdComparator<>(); @Test public void testSaveEdge() { @@ -86,57 +80,67 @@ public abstract class BaseEdgeServiceTest extends AbstractServiceTest { edgeService.deleteEdge(tenantId, savedEdge.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveEdgeWithEmptyName() { Edge edge = new Edge(); edge.setType("default"); edge.setTenantId(tenantId); - edgeService.saveEdge(edge); + Assertions.assertThrows(DataValidationException.class, () -> { + edgeService.saveEdge(edge); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveEdgeWithEmptyTenant() { Edge edge = new Edge(); edge.setName("My edge"); edge.setType("default"); - edgeService.saveEdge(edge); + Assertions.assertThrows(DataValidationException.class, () -> { + edgeService.saveEdge(edge); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveEdgeWithInvalidTenant() { Edge edge = new Edge(); edge.setName("My edge"); edge.setType("default"); edge.setTenantId(TenantId.fromUUID(Uuids.timeBased())); - edgeService.saveEdge(edge); + Assertions.assertThrows(DataValidationException.class, () -> { + edgeService.saveEdge(edge); + }); } - @Test(expected = DataValidationException.class) + @Test public void testAssignEdgeToNonExistentCustomer() { Edge edge = constructEdge("My edge", "default"); - edge = edgeService.saveEdge(edge); + Edge savedEdge = edgeService.saveEdge(edge); try { - edgeService.assignEdgeToCustomer(tenantId, edge.getId(), new CustomerId(Uuids.timeBased())); + Assertions.assertThrows(DataValidationException.class, () -> { + edgeService.assignEdgeToCustomer(tenantId, savedEdge.getId(), new CustomerId(Uuids.timeBased())); + }); } finally { - edgeService.deleteEdge(tenantId, edge.getId()); + edgeService.deleteEdge(tenantId, savedEdge.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testAssignEdgeToCustomerFromDifferentTenant() { Edge edge = constructEdge("My edge", "default"); - edge = edgeService.saveEdge(edge); + Edge savedEdge = edgeService.saveEdge(edge); Tenant tenant = new Tenant(); tenant.setTitle("Test different tenant"); tenant = tenantService.saveTenant(tenant); Customer customer = new Customer(); customer.setTenantId(tenant.getId()); customer.setTitle("Test different customer"); - customer = customerService.saveCustomer(customer); + Customer savedCustomer = customerService.saveCustomer(customer); try { - edgeService.assignEdgeToCustomer(tenantId, edge.getId(), customer.getId()); + Assertions.assertThrows(DataValidationException.class, () -> { + edgeService.assignEdgeToCustomer(tenantId, savedEdge.getId(), savedCustomer.getId()); + }); } finally { - edgeService.deleteEdge(tenantId, edge.getId()); + edgeService.deleteEdge(tenantId, savedEdge.getId()); tenantService.deleteTenant(tenant.getId()); } } @@ -193,12 +197,6 @@ public abstract class BaseEdgeServiceTest extends AbstractServiceTest { @Test public void testFindEdgesByTenantId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - List edges = new ArrayList<>(); for (int i = 0; i < 178; i++) { Edge edge = constructEdge(tenantId, "Edge " + i, "default"); @@ -227,8 +225,6 @@ public abstract class BaseEdgeServiceTest extends AbstractServiceTest { pageData = edgeService.findEdgesByTenantId(tenantId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test @@ -377,12 +373,6 @@ public abstract class BaseEdgeServiceTest extends AbstractServiceTest { @Test public void testFindEdgesByTenantIdAndCustomerId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - Customer customer = new Customer(); customer.setTitle("Test customer"); customer.setTenantId(tenantId); @@ -418,8 +408,6 @@ public abstract class BaseEdgeServiceTest extends AbstractServiceTest { pageData = edgeService.findEdgesByTenantIdAndCustomerId(tenantId, customerId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceRegistryTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceRegistryTest.java index 81a512dc95..87b6bbdd80 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceRegistryTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceRegistryTest.java @@ -28,7 +28,7 @@ import org.thingsboard.server.dao.rule.RuleChainService; public abstract class BaseEntityServiceRegistryTest extends AbstractServiceTest { @Autowired - private EntityServiceRegistry entityServiceRegistry; + EntityServiceRegistry entityServiceRegistry; @Test public void givenAllEntityTypes_whenGetServiceByEntityTypeCalled_thenAllBeansExists() { diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java index 7c80bef095..1af63c0ed7 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java @@ -21,9 +21,7 @@ import com.google.common.util.concurrent.ListenableFuture; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.RandomUtils; import org.hamcrest.Matchers; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.ResultSetExtractor; @@ -31,7 +29,6 @@ import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.StringUtils; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.asset.Asset; import org.thingsboard.server.common.data.edge.Edge; import org.thingsboard.server.common.data.id.CustomerId; @@ -73,8 +70,13 @@ import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntitySearchDirection; import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationTypeGroup; +import org.thingsboard.server.dao.asset.AssetService; import org.thingsboard.server.dao.attributes.AttributesService; +import org.thingsboard.server.dao.device.DeviceService; +import org.thingsboard.server.dao.edge.EdgeService; +import org.thingsboard.server.dao.entity.EntityService; import org.thingsboard.server.dao.model.sqlts.ts.TsKvEntity; +import org.thingsboard.server.dao.relation.RelationService; import org.thingsboard.server.dao.sql.relation.RelationRepository; import org.thingsboard.server.dao.timeseries.TimeseriesService; @@ -100,30 +102,21 @@ public abstract class BaseEntityServiceTest extends AbstractServiceTest { static final int ENTITY_COUNT = 5; @Autowired - private AttributesService attributesService; - + AssetService assetService; @Autowired - private TimeseriesService timeseriesService; - - private TenantId tenantId; - + AttributesService attributesService; @Autowired - private RelationRepository relationRepository; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } - - @After - public void after() { - tenantService.deleteTenant(tenantId); - } - + DeviceService deviceService; + @Autowired + EdgeService edgeService; + @Autowired + EntityService entityService; + @Autowired + RelationRepository relationRepository; + @Autowired + RelationService relationService; + @Autowired + TimeseriesService timeseriesService; @Test public void testCountEntitiesByQuery() throws InterruptedException { diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ConfigTemplateServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ConfigTemplateServiceTest.java index 3ab182519c..510ca0f2db 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ConfigTemplateServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ConfigTemplateServiceTest.java @@ -19,6 +19,7 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.oauth2.MapperType; @@ -51,12 +52,14 @@ public abstract class BaseOAuth2ConfigTemplateServiceTest extends AbstractServic } - @Test(expected = DataValidationException.class) + @Test public void testSaveDuplicateProviderId() { OAuth2ClientRegistrationTemplate first = validClientRegistrationTemplate("providerId"); OAuth2ClientRegistrationTemplate second = validClientRegistrationTemplate("providerId"); oAuth2ConfigTemplateService.saveClientRegistrationTemplate(first); - oAuth2ConfigTemplateService.saveClientRegistrationTemplate(second); + Assertions.assertThrows(DataValidationException.class, () -> { + oAuth2ConfigTemplateService.saveClientRegistrationTemplate(second); + }); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java index 42ea18bdec..73dd08d53c 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java @@ -20,6 +20,7 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.StringUtils; import org.thingsboard.server.common.data.oauth2.MapperType; @@ -61,7 +62,7 @@ public abstract class BaseOAuth2ServiceTest extends AbstractServiceTest { Assert.assertTrue(oAuth2Service.findOAuth2Info().getOauth2ParamsInfos().isEmpty()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveHttpAndMixedDomainsTogether() { OAuth2Info oAuth2Info = new OAuth2Info(true, Lists.newArrayList( OAuth2ParamsInfo.builder() @@ -77,10 +78,12 @@ public abstract class BaseOAuth2ServiceTest extends AbstractServiceTest { )) .build() )); - oAuth2Service.saveOAuth2Info(oAuth2Info); + Assertions.assertThrows(DataValidationException.class, () -> { + oAuth2Service.saveOAuth2Info(oAuth2Info); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveHttpsAndMixedDomainsTogether() { OAuth2Info oAuth2Info = new OAuth2Info(true, Lists.newArrayList( OAuth2ParamsInfo.builder() @@ -96,7 +99,9 @@ public abstract class BaseOAuth2ServiceTest extends AbstractServiceTest { )) .build() )); - oAuth2Service.saveOAuth2Info(oAuth2Info); + Assertions.assertThrows(DataValidationException.class, () -> { + oAuth2Service.saveOAuth2Info(oAuth2Info); + }); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOtaPackageServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseOtaPackageServiceTest.java index c89e7c4b69..d430e1945a 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOtaPackageServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseOtaPackageServiceTest.java @@ -19,16 +19,14 @@ import com.datastax.oss.driver.api.core.uuid.Uuids; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.OtaPackage; import org.thingsboard.server.common.data.OtaPackageInfo; import org.thingsboard.server.common.data.StringUtils; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.TenantProfile; import org.thingsboard.server.common.data.id.DeviceProfileId; import org.thingsboard.server.common.data.id.TenantId; @@ -36,7 +34,11 @@ import org.thingsboard.server.common.data.ota.ChecksumAlgorithm; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration; +import org.thingsboard.server.dao.device.DeviceProfileService; +import org.thingsboard.server.dao.device.DeviceService; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.ota.OtaPackageService; +import org.thingsboard.server.dao.tenant.TenantProfileService; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -44,6 +46,7 @@ import java.util.Collections; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { @@ -60,28 +63,25 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { private final IdComparator idComparator = new IdComparator<>(); - private TenantId tenantId; - private DeviceProfileId deviceProfileId; + @Autowired + DeviceProfileService deviceProfileService; + @Autowired + DeviceService deviceService; + @Autowired + OtaPackageService otaPackageService; + @Autowired + TenantProfileService tenantProfileService; + @Before public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - DeviceProfile deviceProfile = this.createDeviceProfile(tenantId, "Device Profile"); DeviceProfile savedDeviceProfile = deviceProfileService.saveDeviceProfile(deviceProfile); Assert.assertNotNull(savedDeviceProfile); deviceProfileId = savedDeviceProfile.getId(); } - @SuppressWarnings("deprecation") - @Rule - public ExpectedException thrown = ExpectedException.none(); - @After public void after() { tenantService.deleteTenant(tenantId); @@ -99,9 +99,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { createAndSaveFirmware(tenantId, "1"); Assert.assertEquals(1, otaPackageService.sumDataSizeByTenantId(tenantId)); - thrown.expect(DataValidationException.class); - thrown.expectMessage(String.format("Failed to create the ota package, files size limit is exhausted %d bytes!", DATA_SIZE)); - createAndSaveFirmware(tenantId, "2"); + assertThatThrownBy(() -> createAndSaveFirmware(tenantId, "2")) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("Failed to create the ota package, files size limit is exhausted %d bytes!", DATA_SIZE); } @Test @@ -243,9 +243,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksum(CHECKSUM); firmware.setData(DATA); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage should be assigned to tenant!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage should be assigned to tenant!"); } @Test @@ -261,9 +261,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksum(CHECKSUM); firmware.setData(DATA); - thrown.expect(DataValidationException.class); - thrown.expectMessage("Type should be specified!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("Type should be specified!"); } @Test @@ -279,9 +279,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksum(CHECKSUM); firmware.setData(DATA); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage title should be specified!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage title should be specified!"); } @Test @@ -297,9 +297,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksum(CHECKSUM); firmware.setData(DATA); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage file name should be specified!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage file name should be specified!"); } @Test @@ -315,9 +315,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksum(CHECKSUM); firmware.setData(DATA); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage content type should be specified!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage content type should be specified!"); } @Test @@ -333,9 +333,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksumAlgorithm(CHECKSUM_ALGORITHM); firmware.setChecksum(CHECKSUM); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage data should be specified!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage data should be specified!"); } @Test @@ -352,9 +352,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksum(CHECKSUM); firmware.setData(DATA); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage is referencing to non-existent tenant!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage is referencing to non-existent tenant!"); } @Test @@ -371,9 +371,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksum(CHECKSUM); firmware.setData(DATA); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage is referencing to non-existent device profile!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage is referencing to non-existent device profile!"); } @Test @@ -389,9 +389,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmware.setChecksumAlgorithm(CHECKSUM_ALGORITHM); firmware.setData(DATA); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage checksum should be specified!"); - otaPackageService.saveOtaPackage(firmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(firmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage checksum should be specified!"); } @Test @@ -411,17 +411,17 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { newFirmwareInfo.setTitle(TITLE); newFirmwareInfo.setVersion(VERSION); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage with such title and version already exists!"); - otaPackageService.saveOtaPackageInfo(newFirmwareInfo, false); + assertThatThrownBy(() -> otaPackageService.saveOtaPackageInfo(newFirmwareInfo, false)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage with such title and version already exists!"); } @Test public void testSaveFirmwareWithExistingTitleAndVersion() { createAndSaveFirmware(tenantId, VERSION); - thrown.expect(DataValidationException.class); - thrown.expectMessage("OtaPackage with such title and version already exists!"); - createAndSaveFirmware(tenantId, VERSION); + assertThatThrownBy(() -> createAndSaveFirmware(tenantId, VERSION)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("OtaPackage with such title and version already exists!"); } @Test @@ -436,9 +436,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { Device savedDevice = deviceService.saveDevice(device); try { - thrown.expect(DataValidationException.class); - thrown.expectMessage("The otaPackage referenced by the devices cannot be deleted!"); - otaPackageService.deleteOtaPackage(tenantId, savedFirmware.getId()); + assertThatThrownBy(() -> otaPackageService.deleteOtaPackage(tenantId, savedFirmware.getId())) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("The otaPackage referenced by the devices cannot be deleted!"); } finally { deviceService.deleteDevice(tenantId, savedDevice.getId()); otaPackageService.deleteOtaPackage(tenantId, savedFirmware.getId()); @@ -448,12 +448,12 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { @Test public void testUpdateDeviceProfileId() { OtaPackage savedFirmware = createAndSaveFirmware(tenantId, VERSION); + savedFirmware.setDeviceProfileId(null); try { - thrown.expect(DataValidationException.class); - thrown.expectMessage("Updating otaPackage deviceProfile is prohibited!"); - savedFirmware.setDeviceProfileId(null); - otaPackageService.saveOtaPackage(savedFirmware); + assertThatThrownBy(() -> otaPackageService.saveOtaPackage(savedFirmware)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("Updating otaPackage deviceProfile is prohibited!"); } finally { otaPackageService.deleteOtaPackage(tenantId, savedFirmware.getId()); } @@ -482,9 +482,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { deviceProfileService.saveDeviceProfile(savedDeviceProfile); try { - thrown.expect(DataValidationException.class); - thrown.expectMessage("The otaPackage referenced by the device profile cannot be deleted!"); - otaPackageService.deleteOtaPackage(tenantId, savedFirmware.getId()); + assertThatThrownBy(() -> otaPackageService.deleteOtaPackage(tenantId, savedFirmware.getId())) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("The otaPackage referenced by the device profile cannot be deleted!"); } finally { deviceProfileService.deleteDeviceProfile(tenantId, savedDeviceProfile.getId()); } @@ -636,12 +636,18 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmwareInfo.setType(FIRMWARE); firmwareInfo.setTitle(TITLE); firmwareInfo.setVersion(VERSION); + firmwareInfo.setUrl(" "); - thrown.expect(DataValidationException.class); - thrown.expectMessage("Ota package URL should be specified!"); - otaPackageService.saveOtaPackageInfo(firmwareInfo, true); + assertThatThrownBy(() -> otaPackageService.saveOtaPackageInfo(firmwareInfo, true)) + .as("firmwareInfo url set whitespaces") + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("Ota package URL should be specified!"); + firmwareInfo.setUrl(""); - otaPackageService.saveOtaPackageInfo(firmwareInfo, true); + assertThatThrownBy(() -> otaPackageService.saveOtaPackageInfo(firmwareInfo, true)) + .as("firmwareInfo url is empty") + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("Ota package URL should be specified!"); } @Test @@ -655,12 +661,10 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmwareInfo.setTenantId(tenantId); OtaPackageInfo savedFirmwareInfo = otaPackageService.saveOtaPackageInfo(firmwareInfo, true); - - thrown.expect(DataValidationException.class); - thrown.expectMessage("Updating otaPackage URL is prohibited!"); - savedFirmwareInfo.setUrl("https://newurl.com"); - otaPackageService.saveOtaPackageInfo(savedFirmwareInfo, true); + assertThatThrownBy(() -> otaPackageService.saveOtaPackageInfo(savedFirmwareInfo, true)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("Updating otaPackage URL is prohibited!"); } @Test @@ -673,10 +677,9 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmwareInfo.setUrl(URL); firmwareInfo.setTenantId(tenantId); - thrown.expect(DataValidationException.class); - thrown.expectMessage("title length must be equal or less than 255"); - - otaPackageService.saveOtaPackageInfo(firmwareInfo, true); + assertThatThrownBy(() -> otaPackageService.saveOtaPackageInfo(firmwareInfo, true)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("title length must be equal or less than 255"); } @Test @@ -687,11 +690,11 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { firmwareInfo.setUrl(URL); firmwareInfo.setTenantId(tenantId); firmwareInfo.setTitle(TITLE); - firmwareInfo.setVersion(StringUtils.random(257)); - thrown.expectMessage("version length must be equal or less than 255"); - otaPackageService.saveOtaPackageInfo(firmwareInfo, true); + assertThatThrownBy(() -> otaPackageService.saveOtaPackageInfo(firmwareInfo, true)) + .isInstanceOf(DataValidationException.class) + .hasMessageContaining("version length must be equal or less than 255"); } private OtaPackage createAndSaveFirmware(TenantId tenantId, String version) { diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseQueueServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseQueueServiceTest.java index d4242fb1c4..9d2c2bac5a 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseQueueServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseQueueServiceTest.java @@ -19,6 +19,8 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.TenantProfile; @@ -34,6 +36,8 @@ import org.thingsboard.server.common.data.queue.SubmitStrategyType; import org.thingsboard.server.common.data.tenant.profile.TenantProfileData; import org.thingsboard.server.common.data.tenant.profile.TenantProfileQueueConfiguration; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.queue.QueueService; +import org.thingsboard.server.dao.tenant.TenantProfileService; import java.util.ArrayList; import java.util.Collections; @@ -41,6 +45,11 @@ import java.util.List; public abstract class BaseQueueServiceTest extends AbstractServiceTest { + @Autowired + TenantProfileService tenantProfileService; + @Autowired + QueueService queueService; + private IdComparator idComparator = new IdComparator<>(); private TenantId tenantId; @@ -82,7 +91,7 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { Tenant tenant = new Tenant(); tenant.setTitle("My tenant"); - tenant.setTenantProfileId(tenantProfileId); + tenant.setTenantProfileId(tenantProfileId); //custom profile Tenant savedTenant = tenantService.saveTenant(tenant); Assert.assertNotNull(savedTenant); tenantId = savedTenant.getId(); @@ -139,7 +148,7 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queueService.deleteQueue(tenantId, foundQueue.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptyName() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -149,10 +158,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPackProcessingTimeout(2000); queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithInvalidName() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -163,10 +174,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPackProcessingTimeout(2000); queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptyTopic() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -176,10 +189,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPackProcessingTimeout(2000); queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithInvalidTopic() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -190,10 +205,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPackProcessingTimeout(2000); queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptyPollInterval() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -203,10 +220,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPackProcessingTimeout(2000); queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptyPartitions() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -216,10 +235,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPackProcessingTimeout(2000); queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptyPackProcessingTimeout() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -229,10 +250,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPartitions(1); queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptySubmitStrategy() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -242,10 +265,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPartitions(1); queue.setPackProcessingTimeout(2000); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptyProcessingStrategy() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -255,10 +280,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setPartitions(1); queue.setPackProcessingTimeout(2000); queue.setSubmitStrategy(createTestSubmitStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptySubmitStrategyType() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -270,10 +297,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setSubmitStrategy(createTestSubmitStrategy()); queue.getSubmitStrategy().setType(null); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptySubmitStrategyBatchSize() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -286,10 +315,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.getSubmitStrategy().setType(SubmitStrategyType.BATCH); queue.getSubmitStrategy().setBatchSize(0); queue.setProcessingStrategy(createTestProcessingStrategy()); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithEmptyProcessingStrategyType() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -301,10 +332,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); queue.getProcessingStrategy().setType(null); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithNegativeProcessingStrategyRetries() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -316,10 +349,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); queue.getProcessingStrategy().setRetries(-1); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithNegativeProcessingStrategyFailurePercentage() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -331,10 +366,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); queue.getProcessingStrategy().setFailurePercentage(-1); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithNegativeProcessingStrategyPauseBetweenRetries() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -346,10 +383,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); queue.getProcessingStrategy().setPauseBetweenRetries(-1); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithProcessingStrategyPauseBetweenRetriesBiggerThenMaxPauseBetweenRetries() { Queue queue = new Queue(); queue.setTenantId(tenantId); @@ -361,10 +400,12 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); queue.getProcessingStrategy().setPauseBetweenRetries(100); - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveQueueWithNotIsolatedTenant() { Tenant tenant = new Tenant(); tenant.setTitle("Not isolated tenant"); @@ -381,7 +422,9 @@ public abstract class BaseQueueServiceTest extends AbstractServiceTest { queue.setSubmitStrategy(createTestSubmitStrategy()); queue.setProcessingStrategy(createTestProcessingStrategy()); try { - queueService.saveQueue(queue); + Assertions.assertThrows(DataValidationException.class, () -> { + queueService.saveQueue(queue); + }); } finally { tenantService.deleteTenant(savedTenant.getId()); } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java index 82c50f2438..d60a896aec 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java @@ -22,6 +22,8 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.id.AssetId; import org.thingsboard.server.common.data.id.DeviceId; @@ -32,6 +34,7 @@ import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationTypeGroup; import org.thingsboard.server.common.data.relation.RelationsSearchParameters; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.relation.RelationService; import java.util.ArrayList; import java.util.Collections; @@ -41,6 +44,9 @@ import java.util.concurrent.ExecutionException; public abstract class BaseRelationServiceTest extends AbstractServiceTest { + @Autowired + RelationService relationService; + @Before public void before() { } @@ -334,28 +340,34 @@ public abstract class BaseRelationServiceTest extends AbstractServiceTest { } } - @Test(expected = DataValidationException.class) + @Test public void testSaveRelationWithEmptyFrom() throws ExecutionException, InterruptedException { EntityRelation relation = new EntityRelation(); relation.setTo(new AssetId(Uuids.timeBased())); relation.setType(EntityRelation.CONTAINS_TYPE); - Assert.assertTrue(saveRelation(relation)); + Assertions.assertThrows(DataValidationException.class, () -> { + Assert.assertTrue(saveRelation(relation)); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveRelationWithEmptyTo() throws ExecutionException, InterruptedException { EntityRelation relation = new EntityRelation(); relation.setFrom(new AssetId(Uuids.timeBased())); relation.setType(EntityRelation.CONTAINS_TYPE); - Assert.assertTrue(saveRelation(relation)); + Assertions.assertThrows(DataValidationException.class, () -> { + Assert.assertTrue(saveRelation(relation)); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveRelationWithEmptyType() throws ExecutionException, InterruptedException { EntityRelation relation = new EntityRelation(); relation.setFrom(new AssetId(Uuids.timeBased())); relation.setTo(new AssetId(Uuids.timeBased())); - Assert.assertTrue(saveRelation(relation)); + Assertions.assertThrows(DataValidationException.class, () -> { + Assert.assertTrue(saveRelation(relation)); + }); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java index 18c6e110d5..e3c5234942 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java @@ -17,10 +17,10 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.StringUtils; import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.edge.Edge; @@ -33,7 +33,9 @@ import org.thingsboard.server.common.data.rule.RuleChain; import org.thingsboard.server.common.data.rule.RuleChainMetaData; import org.thingsboard.server.common.data.rule.RuleChainType; import org.thingsboard.server.common.data.rule.RuleNode; +import org.thingsboard.server.dao.edge.EdgeService; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.rule.RuleChainService; import java.io.IOException; import java.util.ArrayList; @@ -45,25 +47,14 @@ import java.util.List; */ public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { + @Autowired + EdgeService edgeService; + @Autowired + RuleChainService ruleChainService; + private IdComparator idComparator = new IdComparator<>(); private IdComparator ruleNodeIdComparator = new IdComparator<>(); - private TenantId tenantId; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } - - @After - public void after() { - tenantService.deleteTenant(tenantId); - } - @Test public void testSaveRuleChain() throws IOException { RuleChain ruleChain = new RuleChain(); @@ -86,19 +77,23 @@ public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { ruleChainService.deleteRuleChainById(tenantId, savedRuleChain.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveRuleChainWithEmptyName() { RuleChain ruleChain = new RuleChain(); ruleChain.setTenantId(tenantId); - ruleChainService.saveRuleChain(ruleChain); + Assertions.assertThrows(DataValidationException.class, () -> { + ruleChainService.saveRuleChain(ruleChain); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveRuleChainWithInvalidTenant() { RuleChain ruleChain = new RuleChain(); ruleChain.setName("My RuleChain"); ruleChain.setTenantId(TenantId.fromUUID(Uuids.timeBased())); - ruleChainService.saveRuleChain(ruleChain); + Assertions.assertThrows(DataValidationException.class, () -> { + ruleChainService.saveRuleChain(ruleChain); + }); } @Test @@ -128,12 +123,6 @@ public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { @Test public void testFindRuleChainsByTenantId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - List ruleChains = new ArrayList<>(); for (int i = 0; i < 165; i++) { RuleChain ruleChain = new RuleChain(); @@ -164,8 +153,6 @@ public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { pageData = ruleChainService.findTenantRuleChainsByType(tenantId, RuleChainType.CORE, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - - tenantService.deleteTenant(tenantId); } @Test @@ -321,14 +308,18 @@ public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { ruleChainService.deleteRuleChainById(tenantId, savedRuleChainMetaData.getRuleChainId()); } - @Test(expected = DataValidationException.class) - public void testUpdateRuleChainMetaDataWithCirclingRelation() throws Exception { - ruleChainService.saveRuleChainMetaData(tenantId, createRuleChainMetadataWithCirclingRelation()); + @Test + public void testUpdateRuleChainMetaDataWithCirclingRelation() { + Assertions.assertThrows(DataValidationException.class, () -> { + ruleChainService.saveRuleChainMetaData(tenantId, createRuleChainMetadataWithCirclingRelation()); + }); } - @Test(expected = DataValidationException.class) - public void testUpdateRuleChainMetaDataWithCirclingRelation2() throws Exception { - ruleChainService.saveRuleChainMetaData(tenantId, createRuleChainMetadataWithCirclingRelation2()); + @Test + public void testUpdateRuleChainMetaDataWithCirclingRelation2() { + Assertions.assertThrows(DataValidationException.class, () -> { + ruleChainService.saveRuleChainMetaData(tenantId, createRuleChainMetadataWithCirclingRelation2()); + }); } @Test diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantProfileServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantProfileServiceTest.java index a21a8e5845..6d41da2965 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantProfileServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantProfileServiceTest.java @@ -18,7 +18,10 @@ package org.thingsboard.server.dao.service; import com.fasterxml.jackson.databind.node.NullNode; import org.junit.After; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.EntityInfo; import org.thingsboard.server.common.data.Tenant; @@ -35,6 +38,7 @@ import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileCon import org.thingsboard.server.common.data.tenant.profile.TenantProfileData; import org.thingsboard.server.common.data.tenant.profile.TenantProfileQueueConfiguration; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.tenant.TenantProfileService; import java.util.ArrayList; import java.util.Collections; @@ -43,9 +47,20 @@ import java.util.stream.Collectors; public abstract class BaseTenantProfileServiceTest extends AbstractServiceTest { + @Autowired + TenantProfileService tenantProfileService; + private IdComparator idComparator = new IdComparator<>(); private IdComparator tenantProfileInfoIdComparator = new IdComparator<>(); + @Before + public void before() { + //this test requires no Tenants in the database + tenantId = null; + tenantService.deleteTenants(); + tenantProfileService.deleteTenantProfiles(TenantId.SYS_TENANT_ID); + } + @After public void after() { tenantProfileService.deleteTenantProfiles(TenantId.SYS_TENANT_ID); @@ -154,30 +169,36 @@ public abstract class BaseTenantProfileServiceTest extends AbstractServiceTest { Assert.assertEquals(savedTenantProfile2.getId(), defaultTenantProfile.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveTenantProfileWithEmptyName() { TenantProfile tenantProfile = new TenantProfile(); - tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile); + Assertions.assertThrows(DataValidationException.class, () -> { + tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveTenantProfileWithSameName() { TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile"); tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile); TenantProfile tenantProfile2 = this.createTenantProfile("Tenant Profile"); - tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile2); + Assertions.assertThrows(DataValidationException.class, () -> { + tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile2); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveSameTenantProfileWithDifferentIsolatedTbRuleEngine() { TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile"); TenantProfile savedTenantProfile = tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile); savedTenantProfile.setIsolatedTbRuleEngine(true); addMainQueueConfig(savedTenantProfile); - tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile); + Assertions.assertThrows(DataValidationException.class, () -> { + tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile); + }); } - @Test(expected = DataValidationException.class) + @Test public void testDeleteTenantProfileWithExistingTenant() { TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile"); TenantProfile savedTenantProfile = tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile); @@ -186,7 +207,9 @@ public abstract class BaseTenantProfileServiceTest extends AbstractServiceTest { tenant.setTenantProfileId(savedTenantProfile.getId()); tenant = tenantService.saveTenant(tenant); try { - tenantProfileService.deleteTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile.getId()); + Assertions.assertThrows(DataValidationException.class, () -> { + tenantProfileService.deleteTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile.getId()); + }); } finally { tenantService.deleteTenant(tenant.getId()); } @@ -294,7 +317,7 @@ public abstract class BaseTenantProfileServiceTest extends AbstractServiceTest { return tenantProfile; } - private void addMainQueueConfig(TenantProfile tenantProfile) { + public static void addMainQueueConfig(TenantProfile tenantProfile) { TenantProfileQueueConfiguration mainQueueConfiguration = new TenantProfileQueueConfiguration(); mainQueueConfiguration.setName(DataConstants.MAIN_QUEUE_NAME); mainQueueConfiguration.setTopic(DataConstants.MAIN_QUEUE_TOPIC); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java index 4e4fc44c56..938272c0a8 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java @@ -17,29 +17,13 @@ package org.thingsboard.server.dao.service; import org.junit.Assert; import org.junit.Test; +import org.junit.jupiter.api.Assertions; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.SpyBean; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.cache.TbTransactionalCache; -import org.thingsboard.server.common.data.Customer; -import org.thingsboard.server.common.data.Dashboard; -import org.thingsboard.server.common.data.DashboardInfo; -import org.thingsboard.server.common.data.Device; -import org.thingsboard.server.common.data.DeviceProfile; -import org.thingsboard.server.common.data.DeviceProfileType; -import org.thingsboard.server.common.data.DeviceTransportType; -import org.thingsboard.server.common.data.EntityView; -import org.thingsboard.server.common.data.OtaPackage; -import org.thingsboard.server.common.data.OtaPackageInfo; -import org.thingsboard.server.common.data.ResourceType; -import org.thingsboard.server.common.data.StringUtils; -import org.thingsboard.server.common.data.TbResource; -import org.thingsboard.server.common.data.TbResourceInfo; -import org.thingsboard.server.common.data.Tenant; -import org.thingsboard.server.common.data.TenantInfo; -import org.thingsboard.server.common.data.TenantProfile; -import org.thingsboard.server.common.data.User; +import org.thingsboard.server.common.data.*; import org.thingsboard.server.common.data.asset.Asset; import org.thingsboard.server.common.data.device.profile.DeviceProfileData; import org.thingsboard.server.common.data.device.profile.MqttDeviceProfileTransportConfiguration; @@ -52,11 +36,24 @@ import org.thingsboard.server.common.data.rpc.RpcStatus; import org.thingsboard.server.common.data.rule.RuleChain; import org.thingsboard.server.common.data.rule.RuleChainType; import org.thingsboard.server.common.data.security.Authority; -import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration; -import org.thingsboard.server.common.data.tenant.profile.TenantProfileData; import org.thingsboard.server.common.data.widget.WidgetsBundle; +import org.thingsboard.server.dao.asset.AssetService; +import org.thingsboard.server.dao.customer.CustomerService; +import org.thingsboard.server.dao.dashboard.DashboardService; +import org.thingsboard.server.dao.device.DeviceProfileService; +import org.thingsboard.server.dao.device.DeviceService; +import org.thingsboard.server.dao.edge.EdgeService; +import org.thingsboard.server.dao.entityview.EntityViewService; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.ota.OtaPackageService; +import org.thingsboard.server.dao.resource.ResourceService; +import org.thingsboard.server.dao.rpc.RpcService; +import org.thingsboard.server.dao.rule.RuleChainService; import org.thingsboard.server.dao.tenant.TenantDao; +import org.thingsboard.server.dao.tenant.TenantProfileService; +import org.thingsboard.server.dao.usagerecord.ApiUsageStateService; +import org.thingsboard.server.dao.user.UserService; +import org.thingsboard.server.dao.widget.WidgetsBundleService; import java.util.ArrayList; import java.util.Collections; @@ -70,16 +67,45 @@ import static org.mockito.Mockito.verify; public abstract class BaseTenantServiceTest extends AbstractServiceTest { - private IdComparator idComparator = new IdComparator<>(); - @SpyBean - protected TenantDao tenantDao; + TenantDao tenantDao; @Autowired - protected TbTransactionalCache cache; - + ApiUsageStateService apiUsageStateService; + @Autowired + AssetService assetService; + @Autowired + CustomerService customerService; + @Autowired + DashboardService dashboardService; + @Autowired + DeviceProfileService deviceProfileService; + @Autowired + DeviceService deviceService; + @Autowired + EdgeService edgeService; + @Autowired + EntityViewService entityViewService; + @Autowired + OtaPackageService otaPackageService; + @Autowired + ResourceService resourceService; + @Autowired + RpcService rpcService; + @Autowired + RuleChainService ruleChainService; @Autowired - protected TbTransactionalCache existsTenantCache; + TbTransactionalCache existsTenantCache; + @Autowired + TbTransactionalCache cache; + @Autowired + TenantProfileService tenantProfileService; + @Autowired + UserService userService; + @Autowired + WidgetsBundleService widgetsBundleService; + + private final IdComparator idComparator = new IdComparator<>(); @Test public void testSaveTenant() { @@ -121,18 +147,22 @@ public abstract class BaseTenantServiceTest extends AbstractServiceTest { tenantService.deleteTenant(savedTenant.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveTenantWithEmptyTitle() { Tenant tenant = new Tenant(); - tenantService.saveTenant(tenant); + Assertions.assertThrows(DataValidationException.class, () -> { + tenantService.saveTenant(tenant); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveTenantWithInvalidEmail() { Tenant tenant = new Tenant(); tenant.setTitle("My tenant"); tenant.setEmail("invalid@mail"); - tenantService.saveTenant(tenant); + Assertions.assertThrows(DataValidationException.class, () -> { + tenantService.saveTenant(tenant); + }); } @Test @@ -147,6 +177,7 @@ public abstract class BaseTenantServiceTest extends AbstractServiceTest { @Test public void testFindTenants() { + tenantService.deleteTenants(); List tenants = new ArrayList<>(); PageLink pageLink = new PageLink(17); PageData pageData = tenantService.findTenants(pageLink); @@ -261,7 +292,7 @@ public abstract class BaseTenantServiceTest extends AbstractServiceTest { @Test public void testFindTenantInfos() { - + tenantService.deleteTenants(); List tenants = new ArrayList<>(); PageLink pageLink = new PageLink(17); PageData pageData = tenantService.findTenantInfos(pageLink); @@ -301,23 +332,6 @@ public abstract class BaseTenantServiceTest extends AbstractServiceTest { } - @Test(expected = DataValidationException.class) - public void testSaveTenantWithIsolatedProfileInMonolithSetup() { - TenantProfile tenantProfile = new TenantProfile(); - tenantProfile.setName("Isolated Tenant Profile"); - TenantProfileData profileData = new TenantProfileData(); - profileData.setConfiguration(new DefaultTenantProfileConfiguration()); - tenantProfile.setProfileData(profileData); - tenantProfile.setDefault(false); - tenantProfile.setIsolatedTbRuleEngine(true); - TenantProfile isolatedTenantProfile = tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile); - - Tenant tenant = new Tenant(); - tenant.setTitle("Tenant"); - tenant.setTenantProfileId(isolatedTenantProfile.getId()); - tenantService.saveTenant(tenant); - } - @Test public void testGettingTenantAddingItToCache() { Tenant tenant = new Tenant(); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java index d7885a1cb2..14917f6807 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java @@ -15,10 +15,11 @@ */ package org.thingsboard.server.dao.service; -import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.StringUtils; @@ -32,7 +33,9 @@ import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.common.data.security.UserCredentials; import org.thingsboard.server.common.data.security.UserSettings; +import org.thingsboard.server.dao.customer.CustomerService; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.user.UserService; import java.util.ArrayList; import java.util.Collections; @@ -40,19 +43,17 @@ import java.util.List; public abstract class BaseUserServiceTest extends AbstractServiceTest { + @Autowired + CustomerService customerService; + @Autowired + UserService userService; + private IdComparator idComparator = new IdComparator<>(); - private TenantId tenantId; private UserSettings userSettings; @Before public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - User tenantAdmin = new User(); tenantAdmin.setAuthority(Authority.TENANT_ADMIN); tenantAdmin.setTenantId(tenantId); @@ -74,11 +75,6 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { userSettings = createUserSettings(customerUser.getId()); } - @After - public void after() { - tenantService.deleteTenant(tenantId); - } - @Test public void testFindUserByEmail() { User user = userService.findUserByEmail(SYSTEM_TENANT_ID, "sysadmin@thingsboard.org"); @@ -142,32 +138,40 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { userService.deleteUser(tenantId, savedUser.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveUserWithSameEmail() { User tenantAdminUser = userService.findUserByEmail(tenantId, "tenant@thingsboard.org"); tenantAdminUser.setEmail("sysadmin@thingsboard.org"); - userService.saveUser(tenantAdminUser); + Assertions.assertThrows(DataValidationException.class, () -> { + userService.saveUser(tenantAdminUser); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveUserWithInvalidEmail() { User tenantAdminUser = userService.findUserByEmail(tenantId, "tenant@thingsboard.org"); tenantAdminUser.setEmail("tenant_thingsboard.org"); - userService.saveUser(tenantAdminUser); + Assertions.assertThrows(DataValidationException.class, () -> { + userService.saveUser(tenantAdminUser); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveUserWithEmptyEmail() { User tenantAdminUser = userService.findUserByEmail(tenantId, "tenant@thingsboard.org"); tenantAdminUser.setEmail(null); - userService.saveUser(tenantAdminUser); + Assertions.assertThrows(DataValidationException.class, () -> { + userService.saveUser(tenantAdminUser); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveUserWithoutTenant() { User tenantAdminUser = userService.findUserByEmail(tenantId, "tenant@thingsboard.org"); tenantAdminUser.setTenantId(null); - userService.saveUser(tenantAdminUser); + Assertions.assertThrows(DataValidationException.class, () -> { + userService.saveUser(tenantAdminUser); + }); } @Test @@ -200,17 +204,13 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { Assert.assertEquals(1, users.size()); Assert.assertEquals(tenantAdminUser, users.get(0)); - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); + TenantId secondTenantId = createTenant(); List tenantAdmins = new ArrayList<>(); for (int i = 0; i < 124; i++) { User user = new User(); user.setAuthority(Authority.TENANT_ADMIN); - user.setTenantId(tenantId); + user.setTenantId(secondTenantId); user.setEmail("testTenant" + i + "@thingsboard.org"); tenantAdmins.add(userService.saveUser(user)); } @@ -218,7 +218,7 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { List loadedTenantAdmins = new ArrayList<>(); PageLink pageLink = new PageLink(33); do { - pageData = userService.findTenantAdmins(tenantId, pageLink); + pageData = userService.findTenantAdmins(secondTenantId, pageLink); loadedTenantAdmins.addAll(pageData.getData()); if (pageData.hasNext()) { pageLink = pageLink.nextPageLink(); @@ -230,10 +230,10 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { Assert.assertEquals(tenantAdmins, loadedTenantAdmins); - tenantService.deleteTenant(tenantId); + tenantService.deleteTenant(secondTenantId); pageLink = new PageLink(33); - pageData = userService.findTenantAdmins(tenantId, pageLink); + pageData = userService.findTenantAdmins(secondTenantId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); @@ -241,12 +241,6 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { @Test public void testFindTenantAdminsByEmail() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - String email1 = "testEmail1"; List tenantAdminsEmail1 = new ArrayList<>(); @@ -323,8 +317,6 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { pageData = userService.findTenantAdmins(tenantId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertEquals(0, pageData.getData().size()); - - tenantService.deleteTenant(tenantId); } @Test @@ -337,12 +329,6 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { Assert.assertEquals(1, users.size()); Assert.assertEquals(customerUser, users.get(0)); - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - Customer customer = new Customer(); customer.setTitle("Test customer"); customer.setTenantId(tenantId); @@ -385,12 +371,6 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { @Test public void testFindCustomerUsersByEmail() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); - Customer customer = new Customer(); customer.setTitle("Test customer"); customer.setTenantId(tenantId); @@ -476,8 +456,6 @@ public abstract class BaseUserServiceTest extends AbstractServiceTest { pageData = userService.findCustomerUsers(tenantId, customerId, pageLink); Assert.assertFalse(pageData.hasNext()); Assert.assertEquals(0, pageData.getData().size()); - - tenantService.deleteTenant(tenantId); } private UserSettings createUserSettings(UserId userId) { diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java index 404e6fe2e1..b04053f6d9 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java @@ -18,17 +18,18 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; -import org.thingsboard.server.common.data.Tenant; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.widget.WidgetType; import org.thingsboard.server.common.data.widget.WidgetTypeDetails; import org.thingsboard.server.common.data.widget.WidgetsBundle; import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.model.ModelConstants; +import org.thingsboard.server.dao.widget.WidgetTypeService; +import org.thingsboard.server.dao.widget.WidgetsBundleService; import java.io.IOException; import java.util.ArrayList; @@ -37,23 +38,12 @@ import java.util.List; public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { - private IdComparator idComparator = new IdComparator<>(); - - private TenantId tenantId; + @Autowired + WidgetsBundleService widgetsBundleService; + @Autowired + WidgetTypeService widgetTypeService; - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } - - @After - public void after() { - tenantService.deleteTenant(tenantId); - } + private IdComparator idComparator = new IdComparator<>(); @Test public void testSaveWidgetType() throws IOException { @@ -88,7 +78,7 @@ public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveWidgetTypeWithEmptyName() throws IOException { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); @@ -100,22 +90,26 @@ public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { widgetType.setBundleAlias(savedWidgetsBundle.getAlias()); widgetType.setDescriptor(new ObjectMapper().readValue("{ \"someKey\": \"someValue\" }", JsonNode.class)); try { - widgetTypeService.saveWidgetType(widgetType); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetTypeService.saveWidgetType(widgetType); + }); } finally { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testSaveWidgetTypeWithEmptyBundleAlias() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type"); widgetType.setDescriptor(new ObjectMapper().readValue("{ \"someKey\": \"someValue\" }", JsonNode.class)); - widgetTypeService.saveWidgetType(widgetType); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetTypeService.saveWidgetType(widgetType); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveWidgetTypeWithEmptyDescriptor() throws IOException { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); @@ -128,13 +122,15 @@ public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { widgetType.setBundleAlias(savedWidgetsBundle.getAlias()); widgetType.setDescriptor(new ObjectMapper().readValue("{}", JsonNode.class)); try { - widgetTypeService.saveWidgetType(widgetType); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetTypeService.saveWidgetType(widgetType); + }); } finally { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testSaveWidgetTypeWithInvalidTenant() throws IOException { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); @@ -147,23 +143,27 @@ public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { widgetType.setName("Widget Type"); widgetType.setDescriptor(new ObjectMapper().readValue("{ \"someKey\": \"someValue\" }", JsonNode.class)); try { - widgetTypeService.saveWidgetType(widgetType); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetTypeService.saveWidgetType(widgetType); + }); } finally { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testSaveWidgetTypeWithInvalidBundleAlias() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setBundleAlias("some_alias"); widgetType.setName("Widget Type"); widgetType.setDescriptor(new ObjectMapper().readValue("{ \"someKey\": \"someValue\" }", JsonNode.class)); - widgetTypeService.saveWidgetType(widgetType); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetTypeService.saveWidgetType(widgetType); + }); } - @Test(expected = DataValidationException.class) + @Test public void testUpdateWidgetTypeTenant() throws IOException { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); @@ -178,13 +178,15 @@ public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { WidgetTypeDetails savedWidgetType = widgetTypeService.saveWidgetType(widgetType); savedWidgetType.setTenantId(TenantId.fromUUID(ModelConstants.NULL_UUID)); try { - widgetTypeService.saveWidgetType(savedWidgetType); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetTypeService.saveWidgetType(savedWidgetType); + }); } finally { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testUpdateWidgetTypeBundleAlias() throws IOException { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); @@ -199,13 +201,15 @@ public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { WidgetTypeDetails savedWidgetType = widgetTypeService.saveWidgetType(widgetType); savedWidgetType.setBundleAlias("some_alias"); try { - widgetTypeService.saveWidgetType(savedWidgetType); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetTypeService.saveWidgetType(savedWidgetType); + }); } finally { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testUpdateWidgetTypeAlias() throws IOException { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); @@ -220,7 +224,9 @@ public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { WidgetTypeDetails savedWidgetType = widgetTypeService.saveWidgetType(widgetType); savedWidgetType.setAlias("some_alias"); try { - widgetTypeService.saveWidgetType(savedWidgetType); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetTypeService.saveWidgetType(savedWidgetType); + }); } finally { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java index ac86572cdb..8f04eaec62 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java @@ -16,17 +16,17 @@ package org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; -import org.thingsboard.server.common.data.Tenant; +import org.junit.jupiter.api.Assertions; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.widget.WidgetsBundle; import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.model.ModelConstants; +import org.thingsboard.server.dao.widget.WidgetsBundleService; import java.io.IOException; import java.util.ArrayList; @@ -35,23 +35,10 @@ import java.util.List; public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { - private IdComparator idComparator = new IdComparator<>(); - - private TenantId tenantId; - - @Before - public void before() { - Tenant tenant = new Tenant(); - tenant.setTitle("My tenant"); - Tenant savedTenant = tenantService.saveTenant(tenant); - Assert.assertNotNull(savedTenant); - tenantId = savedTenant.getId(); - } + @Autowired + WidgetsBundleService widgetsBundleService; - @After - public void after() { - tenantService.deleteTenant(tenantId); - } + private IdComparator idComparator = new IdComparator<>(); @Test public void testSaveWidgetsBundle() throws IOException { @@ -77,22 +64,26 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } - @Test(expected = DataValidationException.class) + @Test public void testSaveWidgetsBundleWithEmptyTitle() { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); - widgetsBundleService.saveWidgetsBundle(widgetsBundle); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetsBundleService.saveWidgetsBundle(widgetsBundle); + }); } - @Test(expected = DataValidationException.class) + @Test public void testSaveWidgetsBundleWithInvalidTenant() { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTitle("My widgets bundle"); widgetsBundle.setTenantId(TenantId.fromUUID(Uuids.timeBased())); - widgetsBundleService.saveWidgetsBundle(widgetsBundle); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetsBundleService.saveWidgetsBundle(widgetsBundle); + }); } - @Test(expected = DataValidationException.class) + @Test public void testUpdateWidgetsBundleTenant() { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTitle("My widgets bundle"); @@ -100,13 +91,15 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { WidgetsBundle savedWidgetsBundle = widgetsBundleService.saveWidgetsBundle(widgetsBundle); savedWidgetsBundle.setTenantId(TenantId.fromUUID(ModelConstants.NULL_UUID)); try { - widgetsBundleService.saveWidgetsBundle(savedWidgetsBundle); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetsBundleService.saveWidgetsBundle(savedWidgetsBundle); + }); } finally { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } } - @Test(expected = DataValidationException.class) + @Test public void testUpdateWidgetsBundleAlias() { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTitle("My widgets bundle"); @@ -114,7 +107,9 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { WidgetsBundle savedWidgetsBundle = widgetsBundleService.saveWidgetsBundle(widgetsBundle); savedWidgetsBundle.setAlias("new_alias"); try { - widgetsBundleService.saveWidgetsBundle(savedWidgetsBundle); + Assertions.assertThrows(DataValidationException.class, () -> { + widgetsBundleService.saveWidgetsBundle(savedWidgetsBundle); + }); } finally { widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } @@ -240,11 +235,6 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { @Test public void testFindTenantWidgetsBundlesByTenantId() { - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); List widgetsBundles = new ArrayList<>(); for (int i=0;i<127;i++) { @@ -277,7 +267,6 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { Assert.assertFalse(pageData.hasNext()); Assert.assertTrue(pageData.getData().isEmpty()); - tenantService.deleteTenant(tenantId); } @Test @@ -285,11 +274,6 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { List systemWidgetsBundles = widgetsBundleService.findSystemWidgetsBundles(tenantId); - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); TenantId systemTenantId = TenantId.fromUUID(ModelConstants.NULL_UUID); List createdWidgetsBundles = new ArrayList<>(); @@ -362,8 +346,6 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { Collections.sort(loadedWidgetsBundles, idComparator); Assert.assertEquals(systemWidgetsBundles, loadedWidgetsBundles); - - tenantService.deleteTenant(tenantId); } @Test @@ -371,11 +353,6 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { List systemWidgetsBundles = widgetsBundleService.findSystemWidgetsBundles(tenantId); - Tenant tenant = new Tenant(); - tenant.setTitle("Test tenant"); - tenant = tenantService.saveTenant(tenant); - - TenantId tenantId = tenant.getId(); TenantId systemTenantId = TenantId.fromUUID(ModelConstants.NULL_UUID); List createdWidgetsBundles = new ArrayList<>(); @@ -423,8 +400,6 @@ public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { Collections.sort(loadedWidgetsBundles, idComparator); Assert.assertEquals(systemWidgetsBundles, loadedWidgetsBundles); - - tenantService.deleteTenant(tenantId); } } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/DataValidatorTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DataValidatorTest.java index 6e195b266c..40262ac2b8 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/DataValidatorTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/DataValidatorTest.java @@ -15,7 +15,8 @@ */ package org.thingsboard.server.dao.service; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.thingsboard.server.dao.exception.DataValidationException; public class DataValidatorTest { @@ -26,38 +27,50 @@ public class DataValidatorTest { DataValidator.validateEmail(email); } - @Test(expected = DataValidationException.class) + @Test public void validateInvalidEmail1() { String email = "test:1@mail.io"; - DataValidator.validateEmail(email); + Assertions.assertThrows(DataValidationException.class, () -> { + DataValidator.validateEmail(email); + }); } - @Test(expected = DataValidationException.class) + @Test public void validateInvalidEmail2() { String email = "test()1@mail.io"; - DataValidator.validateEmail(email); + Assertions.assertThrows(DataValidationException.class, () -> { + DataValidator.validateEmail(email); + }); } - @Test(expected = DataValidationException.class) + @Test public void validateInvalidEmail3() { String email = "test[]1@mail.io"; - DataValidator.validateEmail(email); + Assertions.assertThrows(DataValidationException.class, () -> { + DataValidator.validateEmail(email); + }); } - @Test(expected = DataValidationException.class) + @Test public void validateInvalidEmail4() { String email = "test\\1@mail.io"; - DataValidator.validateEmail(email); + Assertions.assertThrows(DataValidationException.class, () -> { + DataValidator.validateEmail(email); + }); } - @Test(expected = DataValidationException.class) + @Test public void validateInvalidEmail5() { String email = "test\"1@mail.io"; - DataValidator.validateEmail(email); + Assertions.assertThrows(DataValidationException.class, () -> { + DataValidator.validateEmail(email); + }); } - @Test(expected = DataValidationException.class) + @Test public void validateInvalidEmail6() { String email = "test<>1@mail.io"; - DataValidator.validateEmail(email); + Assertions.assertThrows(DataValidationException.class, () -> { + DataValidator.validateEmail(email); + }); } -} \ No newline at end of file +} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/NoXssValidatorTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/NoXssValidatorTest.java index fa1caca815..f2618da6b8 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/NoXssValidatorTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/NoXssValidatorTest.java @@ -16,7 +16,7 @@ package org.thingsboard.server.dao.service; import com.fasterxml.jackson.databind.node.TextNode; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.thingsboard.common.util.JacksonUtil; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/event/BaseEventServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/event/BaseEventServiceTest.java index 4b0cf9a1b1..1b0825aff3 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/event/BaseEventServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/event/BaseEventServiceTest.java @@ -19,6 +19,7 @@ import com.datastax.oss.driver.api.core.uuid.Uuids; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.EventInfo; import org.thingsboard.server.common.data.event.Event; import org.thingsboard.server.common.data.event.EventType; @@ -31,6 +32,7 @@ import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.SortOrder; import org.thingsboard.server.common.data.page.TimePageLink; +import org.thingsboard.server.dao.event.EventService; import org.thingsboard.server.dao.service.AbstractServiceTest; import java.text.ParseException; @@ -39,6 +41,10 @@ import java.util.List; import static org.apache.commons.lang3.time.DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT; public abstract class BaseEventServiceTest extends AbstractServiceTest { + + @Autowired + EventService eventService; + long timeBeforeStartTime; long startTime; long eventTime; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java index 924f515143..962dc7e246 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java @@ -21,6 +21,7 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.server.common.data.EntityView; import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.id.DeviceId; @@ -39,7 +40,9 @@ import org.thingsboard.server.common.data.kv.ReadTsKvQueryResult; import org.thingsboard.server.common.data.kv.StringDataEntry; import org.thingsboard.server.common.data.kv.TsKvEntry; import org.thingsboard.server.common.data.objects.TelemetryEntityView; +import org.thingsboard.server.dao.entityview.EntityViewService; import org.thingsboard.server.dao.service.AbstractServiceTest; +import org.thingsboard.server.dao.timeseries.TimeseriesService; import java.util.ArrayList; import java.util.Arrays; @@ -59,6 +62,13 @@ import static org.junit.Assert.assertNotNull; @Slf4j public abstract class BaseTimeseriesServiceTest extends AbstractServiceTest { + + @Autowired + TimeseriesService tsService; + + @Autowired + EntityViewService entityViewService; + static final int MAX_TIMEOUT = 30; private static final String STRING_KEY = "stringKey"; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java index cd4ca51698..6384e17426 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java @@ -16,7 +16,6 @@ package org.thingsboard.server.msa.ui.base; import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; @@ -34,7 +33,8 @@ import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; -@Slf4j +import static org.assertj.core.api.Assertions.fail; + abstract public class AbstractBasePage { public static final long WAIT_TIMEOUT = TimeUnit.SECONDS.toMillis(30); protected WebDriver driver; @@ -59,8 +59,7 @@ abstract public class AbstractBasePage { try { return wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator))); } catch (WebDriverException e) { - log.error("No visibility element: " + locator); - return null; + return fail("No visibility element: " + locator); } } @@ -68,8 +67,7 @@ abstract public class AbstractBasePage { try { return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(locator))); } catch (WebDriverException e) { - log.error("No presence element: " + locator); - return null; + return fail("No presence element: " + locator); } } @@ -77,8 +75,7 @@ abstract public class AbstractBasePage { try { return wait.until(ExpectedConditions.elementToBeClickable(By.xpath(locator))); } catch (WebDriverException e) { - log.error("No clickable element: " + locator); - return null; + return fail("No clickable element: " + locator); } } @@ -87,8 +84,7 @@ abstract public class AbstractBasePage { wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator))); return driver.findElements(By.xpath(locator)); } catch (WebDriverException e) { - log.error("No visibility elements: " + locator); - return null; + return fail("No visibility elements: " + locator); } } @@ -97,8 +93,7 @@ abstract public class AbstractBasePage { wait.until(ExpectedConditions.elementToBeClickable(By.xpath(locator))); return driver.findElements(By.xpath(locator)); } catch (WebDriverException e) { - log.error("No clickable elements: " + locator); - return null; + return fail("No clickable elements: " + locator); } } @@ -106,7 +101,7 @@ abstract public class AbstractBasePage { try { wait.until(ExpectedConditions.urlContains(urlPath)); } catch (WebDriverException e) { - log.error("This URL path is missing"); + fail("This URL path is missing"); } } @@ -122,7 +117,7 @@ abstract public class AbstractBasePage { try { return wait.until(ExpectedConditions.not(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator)))); } catch (WebDriverException e) { - throw new AssertionError("Element is present"); + return fail("Element is present"); } } @@ -130,7 +125,7 @@ abstract public class AbstractBasePage { try { return wait.until(ExpectedConditions.not(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath(locator)))); } catch (WebDriverException e) { - throw new AssertionError("Elements is present"); + return fail("Elements is present"); } } @@ -138,7 +133,7 @@ abstract public class AbstractBasePage { try { wait.until(ExpectedConditions.numberOfWindowsToBe(tabNumber)); } catch (WebDriverException e) { - log.error("No tabs with this number"); + fail("No tabs with this number: " + tabNumber); } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java index 29574a1942..e88397b781 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java @@ -18,7 +18,6 @@ package org.thingsboard.server.msa.ui.base; import io.github.bonigarcia.wdm.WebDriverManager; import io.qameta.allure.Allure; import lombok.extern.slf4j.Slf4j; -import org.openqa.selenium.By; import org.openqa.selenium.Dimension; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.OutputType; @@ -48,9 +47,9 @@ import java.io.ByteArrayInputStream; import java.net.MalformedURLException; import java.net.URL; import java.time.Duration; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; +import static org.assertj.core.api.Assertions.fail; import static org.thingsboard.server.msa.TestProperties.getBaseUiUrl; import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; @@ -73,6 +72,7 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); ChromeOptions options = new ChromeOptions(); options.setAcceptInsecureCerts(true); + options.addArguments("-remote-allow-origins=*"); //temporary fix after updating google chrome if (instance.isActive()) { RemoteWebDriver remoteWebDriver = new RemoteWebDriver(new URL(REMOTE_WEBDRIVER_HOST), options); remoteWebDriver.setFileDetector(new LocalFileDetector()); @@ -82,12 +82,12 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { driver = new ChromeDriver(options); } driver.manage().window().setSize(dimension); - openLocalhost(); + openBaseUiUrl(); } @BeforeMethod public void open() { - openHomePage(); + openBaseUiUrl(); } @AfterMethod @@ -101,12 +101,13 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { driver.quit(); } - public void openLocalhost() { - driver.get(getBaseUiUrl()); + public String getJwtTokenFromLocalStorage() { + js = (JavascriptExecutor) driver; + return (String) js.executeScript("return window.localStorage.getItem('jwt_token');"); } - public void openHomePage() { - driver.get(getBaseUiUrl() + "/home"); + public void openBaseUiUrl() { + driver.get(getBaseUiUrl()); } public String getUrl() { @@ -122,7 +123,7 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { try { wait.until(ExpectedConditions.urlContains(urlPath)); } catch (WebDriverException e) { - log.error("This URL path is missing"); + return fail("URL not contains " + urlPath); } return driver.getCurrentUrl().contains(urlPath); } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageElements.java index de9e9d5bac..1d69ddd5fc 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageElements.java @@ -31,18 +31,18 @@ public class CustomerPageElements extends OtherPageElementsHelper { private static final String CITY = ENTITY + "/../..//mat-cell[contains(@class,'city')]/span"; private static final String TITLES = "//mat-cell[contains(@class,'cdk-column-title')]/span"; protected static final String EDIT_MENU_DASHBOARD_FIELD = "//input[@formcontrolname='dashboard']"; - private static final String EDIT_MENU_DASHBOARD = "//div[@class='cdk-overlay-pane']//span/span"; - private static final String MANAGE_CUSTOMERS_USERS_BTN = ENTITY + "/../..//mat-icon[contains(text(),' account_circle')]/../.."; - private static final String MANAGE_CUSTOMERS_ASSETS_BTN = ENTITY + "/../..//mat-icon[contains(text(),' domain')]/../.."; - private static final String MANAGE_CUSTOMERS_DEVICES_BTN = ENTITY + "/../..//mat-icon[contains(text(),' devices_other')]/../.."; - private static final String MANAGE_CUSTOMERS_DASHBOARDS_BTN = ENTITY + "/../..//mat-icon[contains(text(),' dashboard')]/../.."; - private static final String MANAGE_CUSTOMERS_EDGE_BTN = ENTITY + "/../..//mat-icon[contains(text(),' router')]/../.."; + private static final String EDIT_MENU_DASHBOARD = "//div[@class='cdk-overlay-pane']//span/span[contains(text(),'%s')]"; + private static final String MANAGE_CUSTOMERS_USERS_BTN = ENTITY + "/ancestor::mat-row//mat-icon[contains(text(),' account_circle')]"; + private static final String MANAGE_CUSTOMERS_ASSETS_BTN = ENTITY + "/ancestor::mat-row//mat-icon[contains(text(),' domain')]/parent::button"; + private static final String MANAGE_CUSTOMERS_DEVICES_BTN = ENTITY + "/ancestor::mat-row//mat-icon[contains(text(),'devices_other')]/parent::button"; + private static final String MANAGE_CUSTOMERS_DASHBOARDS_BTN = ENTITY + "/ancestor::mat-row//mat-icon[contains(text(),'dashboard')]/parent::button"; + private static final String MANAGE_CUSTOMERS_EDGE_BTN = ENTITY + "/ancestor::mat-row//mat-icon[contains(text(),'router')]/parent::button"; private static final String ADD_USER_EMAIL = "//tb-add-user-dialog//input[@formcontrolname='email']"; private static final String ACTIVATE_WINDOW_OK_BTN = "//span[contains(text(),'OK')]"; private static final String USER_LOGIN_BTN = "//mat-icon[@data-mat-icon-name='login']"; private static final String USERS_WIDGET = "//tb-widget"; private static final String SELECT_COUNTRY_MENU = "//mat-form-field//mat-select[@formcontrolname='country']"; - private static final String COUNTRIES = "//span[@class='mat-option-text']"; + private static final String COUNTRIES = "//span[@class='mdc-list-item__primary-text']"; protected static final String INPUT_FIELD = "//input[@formcontrolname='%s']"; protected static final String INPUT_FIELD_NAME_TITLE = "title"; private static final String INPUT_FIELD_NAME_CITY = "city"; @@ -54,7 +54,7 @@ public class CustomerPageElements extends OtherPageElementsHelper { private static final String INPUT_FIELD_NAME_NUMBER = "phoneNumber"; private static final String INPUT_FIELD_NAME_ASSIGNED_LIST = "entity"; private static final String ASSIGNED_BTN = "//button[@type='submit']"; - private static final String HIDE_HOME_DASHBOARD_TOOLBAR = "//mat-checkbox[@formcontrolname='homeDashboardHideToolbar']/label"; + private static final String HIDE_HOME_DASHBOARD_TOOLBAR = "//mat-checkbox[@formcontrolname='homeDashboardHideToolbar']//label"; private static final String FILTER_BTN = "//tb-filters-edit"; private static final String TIME_BTN = "//tb-timewindow"; private static final String CUSTOMER_ICON_HEADER = "//tb-breadcrumb//span[contains(text(),'Customer %s')]"; @@ -104,8 +104,8 @@ public class CustomerPageElements extends OtherPageElementsHelper { return waitUntilVisibilityOfElementLocated(EDIT_MENU_DASHBOARD_FIELD); } - public WebElement editMenuDashboard() { - return waitUntilElementToBeClickable(EDIT_MENU_DASHBOARD); + public WebElement editMenuDashboard(String dashboardName) { + return waitUntilElementToBeClickable(String.format(EDIT_MENU_DASHBOARD, dashboardName)); } public WebElement phoneNumberEntityView() { diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageHelper.java index d657388354..030bf630cb 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageHelper.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageHelper.java @@ -17,6 +17,7 @@ package org.thingsboard.server.msa.ui.pages; import lombok.extern.slf4j.Slf4j; import org.openqa.selenium.By; +import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; @@ -111,11 +112,9 @@ public class CustomerPageHelper extends CustomerPageElements { titleFieldEntityView().sendKeys(newTitle); } - public void chooseDashboard() { + public void chooseDashboard(String dashboardName) { editMenuDashboardField().click(); - sleep(0.5); - editMenuDashboard().click(); - sleep(0.5); + editMenuDashboard(dashboardName).click(); } public void createCustomersUser() { @@ -156,4 +155,9 @@ public class CustomerPageHelper extends CustomerPageElements { public void addCustomerViewEnterName(CharSequence keysToEnter) { enterText(titleFieldAddEntityView(), keysToEnter); } + + public void enterPhoneNumber(String number) { + phoneNumberEntityView().sendKeys(number); + phoneNumberEntityView().sendKeys(Keys.TAB); + } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DashboardPageHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DashboardPageHelper.java index e6ec13fd1f..6449cf0cbb 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DashboardPageHelper.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DashboardPageHelper.java @@ -33,8 +33,8 @@ public class DashboardPageHelper extends DashboardPageElements { } public void assignedCustomer(String title) { - manageAssignedEntityListField().click(); - manageAssignedEntity(title).click(); - manageAssignedUpdateBtn().click(); + jsClick(manageAssignedEntityListField()); + jsClick(manageAssignedEntity(title)); + jsClick(manageAssignedUpdateBtn()); } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OpenRuleChainPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OpenRuleChainPageElements.java index 9a51392690..6fd114ad1d 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OpenRuleChainPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OpenRuleChainPageElements.java @@ -24,8 +24,7 @@ public class OpenRuleChainPageElements extends AbstractBasePage { super(driver); } - private static final String DONE_BTN = "//mat-icon[contains(text(),'done')]/../.."; - private static final String DONE_BTN_DISABLE = "//mat-icon[contains(text(),'done')]/../parent::button[@disabled='true']"; + private static final String DONE_BTN = "//mat-icon[contains(text(),'done')]/parent::button"; private static final String INPUT_NODE = "//div[@class='tb-rule-node tb-input-type']"; private static final String HEAD_RULE_CHAIN_NAME = "//div[@class='tb-breadcrumb']/span[2]"; @@ -37,10 +36,6 @@ public class OpenRuleChainPageElements extends AbstractBasePage { return waitUntilVisibilityOfElementLocated(HEAD_RULE_CHAIN_NAME); } - public String getDoneBtnDisable() { - return DONE_BTN_DISABLE; - } - public WebElement doneBtn() { return waitUntilElementToBeClickable(DONE_BTN); } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OpenRuleChainPageHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OpenRuleChainPageHelper.java index 1a87102687..7bba9586dc 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OpenRuleChainPageHelper.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OpenRuleChainPageHelper.java @@ -16,6 +16,7 @@ package org.thingsboard.server.msa.ui.pages; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; public class OpenRuleChainPageHelper extends OpenRuleChainPageElements { public OpenRuleChainPageHelper(WebDriver driver) { @@ -32,7 +33,7 @@ public class OpenRuleChainPageHelper extends OpenRuleChainPageElements { return headName; } - public void waitUntilDoneBtnDisable() { - waitUntilVisibilityOfElementLocated(getDoneBtnDisable()); + public void waitUntilBtnDisable(WebElement element) { + waitUntilAttributeContains(element, "disabled", "true"); } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java index 99e737dba1..7cb5da3bc6 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java @@ -28,7 +28,7 @@ public class OtherPageElements extends AbstractBasePage { } protected static final String ENTITY = "//mat-row//span[contains(text(),'%s')]"; - protected static final String DELETE_BTN = ENTITY + "/../..//mat-icon[contains(text(),' delete')]/../.."; + protected static final String DELETE_BTN = ENTITY + "/ancestor::mat-row//mat-icon[contains(text(),'delete')]/ancestor::button"; protected static final String DETAILS_BTN = ENTITY + "/../..//mat-icon[contains(text(),'edit')]/../.."; private static final String ENTITY_COUNT = "//div[@class='mat-paginator-range-label']"; private static final String WARNING_DELETE_POPUP_YES = "//tb-confirm-dialog//button[2]"; @@ -37,11 +37,11 @@ public class OtherPageElements extends AbstractBasePage { private static final String HELP_BTN = "//mat-icon[contains(text(),'help')]/ancestor::button"; private static final String CHECKBOX = "//mat-row//span[contains(text(),'%s')]/../..//mat-checkbox"; private static final String CHECKBOXES = "//tbody//mat-checkbox"; - private static final String DELETE_SELECTED_BTN = "//span[contains(text(),'selected')]//..//mat-icon/../.."; + private static final String DELETE_SELECTED_BTN = "//div[@class='mat-toolbar-tools']//mat-icon[contains(text(),'delete')]/parent::button"; private static final String DELETE_BTNS = "//mat-icon[contains(text(),' delete')]/../.."; private static final String MARKS_CHECKBOX = "//mat-row[contains (@class,'mat-selected')]//mat-checkbox[contains(@class, 'checked')]"; private static final String SELECT_ALL_CHECKBOX = "//thead//mat-checkbox"; - private static final String ALL_ENTITY = "//mat-row[@class='mat-row cdk-row mat-row-select ng-star-inserted']"; + private static final String ALL_ENTITY = "//mat-row[@class='mat-mdc-row mdc-data-table__row cdk-row mat-row-select ng-star-inserted']"; private static final String EDIT_PENCIL_BTN = "//tb-details-panel//mat-icon[contains(text(),'edit')]/ancestor::button"; private static final String NAME_FIELD_EDIT_VIEW = "//input[@formcontrolname='name']"; private static final String HEADER_NAME_VIEW = "//header//div[@class='tb-details-title']/span"; @@ -50,14 +50,13 @@ public class OtherPageElements extends AbstractBasePage { private static final String DESCRIPTION_ADD_ENTITY_VIEW = "//tb-add-entity-dialog//textarea"; private static final String DEBUG_CHECKBOX_EDIT = "//mat-checkbox[@formcontrolname='debugMode']"; private static final String DEBUG_CHECKBOX_VIEW = "//mat-checkbox[@formcontrolname='debugMode']//input"; - private static final String CLOSE_ENTITY_VIEW_BTN = "//header//mat-icon[contains(text(),'close')]/../.."; - private static final String SEARCH_BTN = "//mat-toolbar//mat-icon[contains(text(),'search')]/.." + - "/parent::button[@class='mat-focus-indicator mat-tooltip-trigger mat-icon-button mat-button-base ng-star-inserted']"; + private static final String CLOSE_ENTITY_VIEW_BTN = "//header//mat-icon[contains(text(),'close')]/parent::button"; + private static final String SEARCH_BTN = "//mat-toolbar//mat-icon[contains(text(),'search')]/ancestor::button[contains(@class,'ng-star')]"; private static final String SORT_BY_NAME_BTN = "//div[contains(text(),'Name')]"; private static final String SORT_BY_TITLE_BTN = "//div[contains(text(),'Title')]"; private static final String SORT_BY_TIME_BTN = "//div[contains(text(),'Created time')]/.."; private static final String CREATED_TIME = "//tbody[@role='rowgroup']//mat-cell[2]/span"; - private static final String PLUS_BTN = "//mat-icon[contains(text(),'add')]/../parent::button"; + private static final String PLUS_BTN = "//mat-icon[contains(text(),'add')]/ancestor::button"; private static final String CREATE_VIEW_ADD_BTN = "//span[contains(text(),'Add')]/.."; private static final String WARNING_MESSAGE = "//tb-snack-bar-component/div/div"; private static final String ERROR_MESSAGE = "//mat-error"; @@ -66,7 +65,7 @@ public class OtherPageElements extends AbstractBasePage { private static final String ENTITY_FROM_LIST = "//div[@role='listbox']/mat-option//span[contains(text(),'%s')]"; protected static final String ADD_ENTITY_VIEW = "//tb-add-entity-dialog"; protected static final String STATE_CONTROLLER = "//tb-entity-state-controller"; - private static final String SEARCH_FIELD = "//input[contains (@data-placeholder,'Search')]"; + private static final String SEARCH_FIELD = "//input[contains (@placeholder,'Search')]"; private static final String BROWSE_FILE = "//input[@class='file-input']"; private static final String IMPORT_BROWSE_FILE = "//mat-dialog-container//span[contains(text(),'Import')]/.."; private static final String IMPORTING_FILE = "//div[contains(text(),'%s')]"; @@ -158,7 +157,7 @@ public class OtherPageElements extends AbstractBasePage { } public WebElement debugCheckboxView() { - return waitUntilVisibilityOfElementLocated(DEBUG_CHECKBOX_VIEW); + return waitUntilPresenceOfElementLocated(DEBUG_CHECKBOX_VIEW); } public WebElement closeEntityViewBtn() { diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElementsHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElementsHelper.java index 45a0dddc98..815e118a9b 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElementsHelper.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElementsHelper.java @@ -62,48 +62,22 @@ public class OtherPageElementsHelper extends OtherPageElements { } public String deleteRuleChainTrash(String entityName) { - String s = ""; - if (deleteBtn(entityName) != null) { - deleteBtn(entityName).click(); - warningPopUpYesBtn().click(); - return entityName; - } else { - for (int i = 0; i < deleteBtns().size(); i++) { - if (deleteBtns().get(i).isEnabled()) { - deleteBtns().get(i).click(); - warningPopUpYesBtn().click(); - if (elementIsNotPresent(getWarningMessage())) { - s = driver.findElements(By.xpath(getDeleteBtns() - + "/../../../mat-cell/following-sibling::mat-cell/following-sibling::mat-cell[contains(@class,'cdk-column-name')]/span")).get(i).getText(); - break; - } - } - } - return s; - } + deleteBtn(entityName).click(); + warningPopUpYesBtn().click(); + return entityName; } public String deleteSelected(String entityName) { - String s = ""; - if (deleteBtn(entityName) != null) { - checkBox(entityName).click(); - deleteSelectedBtn().click(); - warningPopUpYesBtn().click(); - return entityName; - } else { - for (int i = 0; i < checkBoxes().size(); i++) { - if (checkBoxes().get(i).isDisplayed()) { - s = driver.findElements(By.xpath(getCheckboxes() + "/../../mat-cell/following-sibling::mat-cell/following-sibling::mat-cell[contains(@class,'cdk-column-name')]/span")).get(i).getText(); - checkBox(s).click(); - deleteSelectedBtn().click(); - warningPopUpYesBtn().click(); - if (elementIsNotPresent(getWarningMessage())) { - break; - } - } - } - return s; - } + checkBox(entityName).click(); + jsClick(deleteSelectedBtn()); + warningPopUpYesBtn().click(); + return entityName; + } + + public void deleteSelected(int countOfCheckBoxes) { + clickOnCheckBoxes(countOfCheckBoxes); + jsClick(deleteSelectedBtn()); + warningPopUpYesBtn().click(); } public void searchEntity(String namePath) { diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/RuleChainsPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/RuleChainsPageElements.java index b34c5ccb86..c1b72efbeb 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/RuleChainsPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/RuleChainsPageElements.java @@ -25,7 +25,7 @@ public class RuleChainsPageElements extends OtherPageElementsHelper { super(driver); } - private static final String MAKE_ROOT_BTN = ENTITY + "/../..//mat-icon[contains(text(),' flag')]/../.."; + private static final String MAKE_ROOT_BTN = ENTITY + "/ancestor::mat-row//mat-icon[contains(text(),'flag')]/ancestor::button"; private static final String ROOT = ENTITY + "/../..//mat-icon[text() = 'check_box']"; private static final String ROOT_DISABLE = ENTITY + "/../..//mat-icon[text() = 'check_box_outline_blank']"; private static final String CREATED_TIME = ENTITY + "/../..//mat-cell/span[contains(text(),'%s')]"; @@ -35,7 +35,7 @@ public class RuleChainsPageElements extends OtherPageElementsHelper { private static final String DELETE_RULE_CHAIN_FROM_VIEW_BTN = "//span[contains(text(),' Delete')]"; private static final String IMPORT_RULE_CHAIN_BTN = "//span[contains(text(),'Import rule chain')]"; private static final String OPEN_RULE_CHAIN_FROM_VIEW = "//span[contains(text(),'Open rule chain')]"; - private static final String MAKE_ROOT_FROM_VIEW = "(//span[contains(text(),' Make rule chain root ')]/..)[1]"; + private static final String MAKE_ROOT_FROM_VIEW = "//span[contains(text(),' Make rule chain root ')]/parent::button"; private static final String ROOT_ACTIVE_CHECKBOXES = "//mat-icon[text() = 'check_box']"; private static final String ALL_NAMES = "//mat-icon[contains(text(),'check')]/../../../mat-cell[contains(@class,'name')]/span"; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/AssetProfileEditMenuTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/AssetProfileEditMenuTest.java index 0d02bd9434..d94fb029ad 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/AssetProfileEditMenuTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/AssetProfileEditMenuTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.assetProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.openqa.selenium.Keys; import org.testng.Assert; import org.testng.annotations.AfterMethod; @@ -54,8 +56,10 @@ public class AssetProfileEditMenuTest extends AbstractDriverBaseTest { } } + @Epic("Asset profiles smoke") + @Feature("Edit asset profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Change name by edit menu") public void changeName() { String name = ENTITY_NAME + random(); String newName = "Changed" + getRandomNumber(); @@ -77,8 +81,10 @@ public class AssetProfileEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(nameAfter, newName); } + @Epic("Asset profiles smoke") + @Feature("Edit asset profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Delete name and save") public void deleteName() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); @@ -92,8 +98,10 @@ public class AssetProfileEditMenuTest extends AbstractDriverBaseTest { Assert.assertFalse(profilesPage.doneBtnEditViewVisible().isEnabled()); } + @Epic("Asset profiles smoke") + @Feature("Edit asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Save only with space") public void saveWithOnlySpaceInName() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); @@ -110,8 +118,10 @@ public class AssetProfileEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.warningMessage().getText(), EMPTY_ASSET_PROFILE_MESSAGE); } + @Epic("Asset profiles smoke") + @Feature("Edit asset profile") @Test(priority = 30, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription") - @Description + @Description("Write the description and save the changes/Change the description and save the changes/Delete the description and save the changes") public void editDescription(String description, String newDescription, String finalDescription) { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name, description)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/CreateAssetProfileImportTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/CreateAssetProfileImportTest.java index 275eb866ce..8816f878e7 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/CreateAssetProfileImportTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/CreateAssetProfileImportTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.assetProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -55,8 +57,10 @@ public class CreateAssetProfileImportTest extends AbstractDriverBaseTest { } } + @Epic("Asset profiles smoke") + @Feature("Import asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Import asset profile") public void importAssetProfile() { sideBarMenuView.openAssetProfiles(); profilesPage.openImportAssetProfileView(); @@ -69,8 +73,10 @@ public class CreateAssetProfileImportTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entity(IMPORT_ASSET_PROFILE_NAME).isDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Import asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Import txt file") public void importTxtFile() { sideBarMenuView.openDeviceProfiles(); profilesPage.openImportDeviceProfileView(); @@ -80,8 +86,10 @@ public class CreateAssetProfileImportTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Import asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Drop json file and delete it") public void addFileToImportAndRemove() { sideBarMenuView.openAssetProfiles(); profilesPage.openImportAssetProfileView(); @@ -93,8 +101,10 @@ public class CreateAssetProfileImportTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entityIsNotPresent(IMPORT_ASSET_PROFILE_NAME)); } + @Epic("Asset profiles smoke") + @Feature("Import asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Import asset profile with same name") public void importAssetProfileWithSameName() { String name = IMPORT_ASSET_PROFILE_NAME; testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); @@ -111,8 +121,10 @@ public class CreateAssetProfileImportTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.warningMessage().getText(), SAME_NAME_WARNING_ASSET_PROFILE_MESSAGE); } + @Epic("Asset profiles smoke") + @Feature("Import asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Import asset profile without refresh") public void importAssetProfileWithoutRefresh() { sideBarMenuView.openAssetProfiles(); profilesPage.openImportAssetProfileView(); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/CreateAssetProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/CreateAssetProfileTest.java index cb7d70f33f..bc5b04cd43 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/CreateAssetProfileTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/CreateAssetProfileTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.assetProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -52,8 +54,10 @@ public class CreateAssetProfileTest extends AbstractDriverBaseTest { } } + @Epic("Asset profiles smoke") + @Feature("Create asset profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Add asset profile after specifying the name (text/numbers /special characters)") public void createAssetProfile() { String name = ENTITY_NAME + random(); @@ -68,8 +72,10 @@ public class CreateAssetProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entity(name).isDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Create asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add asset profile after specifying the name with details") public void createAssetProfileWithDetails() { String name = ENTITY_NAME + random(); String ruleChain = "Root Rule Chain"; @@ -103,8 +109,10 @@ public class CreateAssetProfileTest extends AbstractDriverBaseTest { Assert.assertEquals(description, profilesPage.getDescription()); } + @Epic("Asset profiles smoke") + @Feature("Create asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Create asset profile with the same name") public void createAssetProfileWithSameName() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); @@ -122,8 +130,10 @@ public class CreateAssetProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.addAssetProfileView().isDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Create asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add asset profile without the name") public void createAssetProfileWithoutName() { sideBarMenuView.openAssetProfiles(); profilesPage.openCreateAssetProfileView(); @@ -131,8 +141,10 @@ public class CreateAssetProfileTest extends AbstractDriverBaseTest { Assert.assertFalse(profilesPage.addBtnV().isEnabled()); } + @Epic("Asset profiles smoke") + @Feature("Create asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Create asset profile only with spase in name") public void createAssetProfileWithOnlySpaceInName() { sideBarMenuView.openAssetProfiles(); profilesPage.openCreateAssetProfileView(); @@ -146,8 +158,10 @@ public class CreateAssetProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.addAssetProfileView().isDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Create asset profile") @Test(priority = 30, groups = "smoke") - @Description + @Description("Add asset profile after specifying the name (text/numbers /special characters) without refresh") public void createAssetProfileWithoutRefresh() { String name = ENTITY_NAME + random(); @@ -161,15 +175,17 @@ public class CreateAssetProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entity(name).isDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Create asset profile") @Test(priority = 40, groups = "smoke") - @Description + @Description("Go to asset profile documentation page") public void documentation() { String urlPath = "docs/user-guide/asset-profiles/"; sideBarMenuView.openAssetProfiles(); - profilesPage.allEntity().get(0).click(); + profilesPage.profileNames().get(0).click(); profilesPage.goToProfileHelpPage(); - Assert.assertTrue(urlContains(urlPath)); + Assert.assertTrue(urlContains(urlPath), "URL not contains " + urlPath); } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/DeleteAssetProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/DeleteAssetProfileTest.java index 1525849df7..8241685a25 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/DeleteAssetProfileTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/DeleteAssetProfileTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.assetProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -40,8 +42,10 @@ public class DeleteAssetProfileTest extends AbstractDriverBaseTest { profilesPage = new ProfilesPageHelper(driver); } + @Epic("Asset profiles smoke") + @Feature("Delete one asset profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove the asset profile by clicking on the trash icon in the right side of asset profile") public void removeAssetProfile() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); @@ -54,8 +58,10 @@ public class DeleteAssetProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entityIsNotPresent(name)); } + @Epic("Asset profiles smoke") + @Feature("Delete one asset profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove the asset profile by clicking on the 'Delete asset profile' btn in the entity view") public void removeAssetProfileFromView() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); @@ -69,8 +75,10 @@ public class DeleteAssetProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entityIsNotPresent(name)); } + @Epic("Asset profiles smoke") + @Feature("Delete one asset profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove asset profile by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void removeSelectedAssetProfile() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); @@ -84,16 +92,20 @@ public class DeleteAssetProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entityIsNotPresent(name)); } + @Epic("Asset profiles smoke") + @Feature("Delete one asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the default asset profile by clicking on the trash icon in the right side of asset profile") public void removeDefaultAssetProfile() { sideBarMenuView.openAssetProfiles(); Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled()); } + @Epic("Asset profiles smoke") + @Feature("Delete one asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the Default asset profile by clicking on the 'Delete asset profile' btn in the entity view") public void removeDefaultAssetProfileFromView() { sideBarMenuView.openAssetProfiles(); profilesPage.entity("default").click(); @@ -101,8 +113,10 @@ public class DeleteAssetProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.deleteAssetProfileFromViewBtnIsNotDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Delete one asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the default asset profile by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void removeSelectedDefaultAssetProfile() { sideBarMenuView.openAssetProfiles(); @@ -110,8 +124,10 @@ public class DeleteAssetProfileTest extends AbstractDriverBaseTest { Assert.assertFalse(profilesPage.presentCheckBox("default").isDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Delete one asset profile") @Test(priority = 30, groups = "smoke") - @Description + @Description("Remove the asset profile by clicking on the trash icon in the right side of asset profile without refresh") public void removeAssetProfileWithoutRefresh() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/DeleteSeveralAssetProfilesTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/DeleteSeveralAssetProfilesTest.java index 40436c6ea0..ffed0483c0 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/DeleteSeveralAssetProfilesTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/DeleteSeveralAssetProfilesTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.assetProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -39,8 +41,10 @@ public class DeleteSeveralAssetProfilesTest extends AbstractDriverBaseTest { profilesPage = new ProfilesPageHelper(driver); } + @Epic("Asset profiles smoke") + @Feature("Delete several asset profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove several asset profiles by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void canDeleteSeveralAssetProfilesByTopBtn() { String name1 = ENTITY_NAME + random() + "1"; String name2 = ENTITY_NAME + random() + "2"; @@ -57,8 +61,11 @@ public class DeleteSeveralAssetProfilesTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.profileIsNotPresent(name2)); } + @Epic("Asset profiles smoke") + @Feature("Delete several asset profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove several asset profiles by mark all the asset profiles on the page by clicking in the topmost " + + "checkbox and then clicking on the trash icon in the menu that appears") public void selectAllDAssetProfiles() { String name1 = ENTITY_NAME + random() + "1"; String name2 = ENTITY_NAME + random() +"2"; @@ -75,8 +82,11 @@ public class DeleteSeveralAssetProfilesTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.profileIsNotPresent(name2)); } + @Epic("Asset profiles smoke") + @Feature("Delete several asset profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the default asset profile by mark all the asset profiles on the page by clicking in the " + + "topmost checkbox and then clicking on the trash icon in the menu that appears") public void removeDefaultAssetProfile() { sideBarMenuView.openAssetProfiles(); profilesPage.selectAllCheckBox().click(); @@ -85,8 +95,11 @@ public class DeleteSeveralAssetProfilesTest extends AbstractDriverBaseTest { Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled()); } + @Epic("Asset profiles smoke") + @Feature("Delete several asset profile") @Test(priority = 30, groups = "smoke") - @Description + @Description("Remove several asset profiles by mark in the checkbox and then click on the trash can icon in the menu " + + "that appears at the top without refresh") public void deleteSeveralAssetProfilesByTopBtnWithoutRefresh() { String name1 = ENTITY_NAME + random() + "1"; String name2 = ENTITY_NAME + random() + "2"; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/MakeAssetProfileDefaultTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/MakeAssetProfileDefaultTest.java index 761c390338..c7c56d197b 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/MakeAssetProfileDefaultTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/MakeAssetProfileDefaultTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.assetProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -47,8 +49,10 @@ public class MakeAssetProfileDefaultTest extends AbstractDriverBaseTest { testRestClient.deleteAssetProfile(getAssetProfileByName(name).getId()); } + @Epic("Asset profiles smoke") + @Feature("Make asset profile default") @Test(priority = 10, groups = "smoke") - @Description + @Description("Make asset profile default by clicking on the 'Make asset profile default' icon in the right corner") public void makeDeviceProfileDefaultByRightCornerBtn() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); @@ -61,8 +65,10 @@ public class MakeAssetProfileDefaultTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.defaultCheckbox(name).isDisplayed()); } + @Epic("Asset profiles smoke") + @Feature("Make asset profile default") @Test(priority = 10, groups = "smoke") - @Description + @Description("Make asset profile default by clicking on the 'Make asset profile default' button in the entity view") public void makeDeviceProfileDefaultFromView() { String name = ENTITY_NAME + random(); testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/SearchAssetProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/SearchAssetProfileTest.java index 16de1924e7..3197c56d50 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/SearchAssetProfileTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/SearchAssetProfileTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.assetProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -48,8 +50,11 @@ public class SearchAssetProfileTest extends AbstractDriverBaseTest { } } + @Epic("Asset profiles smoke") + @Feature("Search asset profile") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "assetProfileSearch") - @Description + @Description("Search asset profile by first word in the name/Search asset profile by second word in the name/" + + "Search asset profile by symbol in the name/Search asset profile by number in the name") public void searchFirstWord(String name, String namePath) { testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name)); this.name = name; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/SortByNameTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/SortByNameTest.java index 6104e80e80..b5cf7a97d9 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/SortByNameTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/assetProfileSmoke/SortByNameTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.assetProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -48,8 +50,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { } } + @Epic("Asset profiles smoke") + @Feature("Sort by name") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") - @Description + @Description("Sort asset profile 'UP'") public void specialCharacterUp(String name) { testRestClient.postAssetProfile(defaultAssetProfile(name)); this.name = name; @@ -61,8 +65,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.getProfileName(), name); } + @Epic("Asset profiles smoke") + @Feature("Sort by name") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") - @Description + @Description("Sort asset profile 'UP'") public void allSortUp(String assetProfile, String assetProfileSymbol, String assetProfileNumber) { testRestClient.postAssetProfile(defaultAssetProfile(assetProfileSymbol)); testRestClient.postAssetProfile(defaultAssetProfile(assetProfile)); @@ -86,8 +92,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(thirdAssetProfile, assetProfile); } + @Epic("Asset profiles smoke") + @Feature("Sort by name") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") - @Description + @Description("Sort asset profile 'DAWN'") public void specialCharacterDown(String name) { testRestClient.postAssetProfile(defaultAssetProfile(name)); this.name = name; @@ -99,8 +107,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.getProfileName(), name); } + @Epic("Asset profiles smoke") + @Feature("Sort by name") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") - @Description + @Description("Sort asset profile 'DOWN'") public void allSortDown(String assetProfile, String assetProfileSymbol, String assetProfileNumber) { testRestClient.postAssetProfile(defaultAssetProfile(assetProfileSymbol)); testRestClient.postAssetProfile(defaultAssetProfile(assetProfile)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CreateCustomerTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CreateCustomerTest.java index b0659ac328..81fcd6a020 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CreateCustomerTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CreateCustomerTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.openqa.selenium.Keys; import org.testng.Assert; import org.testng.annotations.AfterMethod; @@ -52,8 +54,10 @@ public class CreateCustomerTest extends AbstractDriverBaseTest { } } + @Epic("Customers smoke tests") + @Feature("Create customer") @Test(priority = 10, groups = "smoke") - @Description + @Description("Add customer specifying the name (text/numbers /special characters)") public void createCustomer() { String customerName = ENTITY_NAME + random(); @@ -68,8 +72,10 @@ public class CreateCustomerTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.customer(customerName).isDisplayed()); } + @Epic("Customers smoke tests") + @Feature("Create customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add customer after specifying the name (text/numbers /special characters) with full information") public void createCustomerWithFullInformation() { String customerName = ENTITY_NAME + random(); String text = "Text"; @@ -112,8 +118,10 @@ public class CreateCustomerTest extends AbstractDriverBaseTest { Assert.assertEquals(customerPage.getCustomerCity(), text); } + @Epic("Customers smoke tests") + @Feature("Create customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add customer without the name") public void createCustomerWithoutName() { sideBarMenuView.customerBtn().click(); customerPage.plusBtn().click(); @@ -121,8 +129,10 @@ public class CreateCustomerTest extends AbstractDriverBaseTest { Assert.assertFalse(customerPage.addBtnV().isEnabled()); } + @Epic("Customers smoke tests") + @Feature("Create customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Create customer only with spase in name") public void createCustomerWithOnlySpace() { sideBarMenuView.customerBtn().click(); customerPage.plusBtn().click(); @@ -136,8 +146,10 @@ public class CreateCustomerTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.addEntityView().isDisplayed()); } + @Epic("Customers smoke tests") + @Feature("Create customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Create a customer with the same name") public void createCustomerSameName() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); @@ -153,8 +165,10 @@ public class CreateCustomerTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.addEntityView().isDisplayed()); } + @Epic("Customers smoke tests") + @Feature("Create customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add customer specifying the name (text/numbers /special characters) without refresh") public void createCustomerWithoutRefresh() { String customerName = ENTITY_NAME + random(); @@ -168,8 +182,10 @@ public class CreateCustomerTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.customer(customerName).isDisplayed()); } + @Epic("Customers smoke tests") + @Feature("Create customer") @Test(priority = 40, groups = "smoke") - @Description + @Description("Go to customer documentation page") public void documentation() { String urlPath = "docs/user-guide/ui/customers/"; @@ -178,6 +194,6 @@ public class CreateCustomerTest extends AbstractDriverBaseTest { customerPage.customer(customerPage.getCustomerName()).click(); customerPage.goToHelpPage(); - Assert.assertTrue(urlContains(urlPath)); + Assert.assertTrue(urlContains(urlPath), "URL contains " + urlPath); } } \ No newline at end of file diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CustomerEditMenuTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CustomerEditMenuTest.java index c47ae92468..c07e450bc4 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CustomerEditMenuTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CustomerEditMenuTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -63,13 +65,15 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { @BeforeMethod public void reLogin() { - if (getUrl().contains("/login")) { + if (getJwtTokenFromLocalStorage() == null) { loginPage.authorizationTenant(); } } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 10, groups = "smoke") - @Description + @Description("Change title by edit menu") public void changeTitle() { String customerName = "Changed" + getRandomNumber(); testRestClient.postCustomer(defaultCustomerPrototype(ENTITY_NAME + random())); @@ -89,8 +93,10 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(titleAfter, customerName); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Delete title and save") public void deleteTitle() { sideBarMenuView.customerBtn().click(); customerPage.entityTitles().get(0).click(); @@ -100,8 +106,10 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { Assert.assertFalse(customerPage.doneBtnEditViewVisible().isEnabled()); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Save only with space in title") public void saveOnlyWithSpace() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); @@ -117,8 +125,10 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(customerPage.getCustomerName(), customerPage.getHeaderName()); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription") - @Description + @Description("Write the description and save the changes/Change the description and save the changes/Delete the description and save the changes") public void editDescription(String description, String newDescription, String finalDescription) { String name = ENTITY_NAME + random(); testRestClient.postCustomer(EntityPrototypes.defaultCustomerPrototype(name, description)); @@ -134,8 +144,10 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(customerPage.getDescription(), finalDescription); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Assigned dashboard from dashboards page") public void assignedDashboardFromDashboard() { String customerName = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customerName)); @@ -147,22 +159,24 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { dashboardPage.assignedCustomer(customerName); sideBarMenuView.customerBtn().click(); customerPage.entity(customerName).click(); - customerPage.editPencilBtn().click(); - customerPage.chooseDashboard(); + jsClick(customerPage.editPencilBtn()); + customerPage.chooseDashboard(dashboardPage.getDashboardTitle()); customerPage.doneBtnEditView().click(); customerPage.setDashboardFromView(); customerPage.closeEntityViewBtn().click(); - customerPage.manageCustomersUserBtn(customerName).click(); + jsClick(customerPage.manageCustomersUserBtn(customerName)); customerPage.createCustomersUser(); - customerPage.userLoginBtn().click(); + jsClick(customerPage.userLoginBtn()); Assert.assertNotNull(customerPage.usersWidget()); Assert.assertTrue(customerPage.usersWidget().isDisplayed()); Assert.assertEquals(customerPage.getDashboardFromView(), dashboardPage.getDashboardTitle()); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Assigned dashboard") public void assignedDashboard() { String customerName = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customerName)); @@ -173,22 +187,24 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { customerPage.assignedDashboard(); sideBarMenuView.customerBtn().click(); customerPage.entity(customerName).click(); - customerPage.editPencilBtn().click(); - customerPage.chooseDashboard(); + jsClick(customerPage.editPencilBtn()); + customerPage.chooseDashboard(customerPage.getDashboard()); customerPage.doneBtnEditView().click(); customerPage.setDashboardFromView(); customerPage.closeEntityViewBtn().click(); - customerPage.manageCustomersUserBtn(customerName).click(); + jsClick(customerPage.manageCustomersUserBtn(customerName)); customerPage.createCustomersUser(); - customerPage.userLoginBtn().click(); + jsClick(customerPage.userLoginBtn()); Assert.assertNotNull(customerPage.usersWidget()); Assert.assertTrue(customerPage.usersWidget().isDisplayed()); Assert.assertEquals(customerPage.getDashboard(), customerPage.getDashboardFromView()); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Assigned dashboard without hide") public void assignedDashboardWithoutHide() { String customerName = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customerName)); @@ -199,15 +215,15 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { customerPage.assignedDashboard(); sideBarMenuView.customerBtn().click(); customerPage.entity(customerName).click(); - customerPage.editPencilBtn().click(); - customerPage.chooseDashboard(); + jsClick(customerPage.editPencilBtn()); + customerPage.chooseDashboard(customerPage.getDashboard()); customerPage.hideHomeDashboardToolbarCheckbox().click(); customerPage.doneBtnEditView().click(); customerPage.setDashboardFromView(); customerPage.closeEntityViewBtn().click(); - customerPage.manageCustomersUserBtn(customerName).click(); + jsClick(customerPage.manageCustomersUserBtn(customerName)); customerPage.createCustomersUser(); - customerPage.userLoginBtn().click(); + jsClick(customerPage.userLoginBtn()); Assert.assertNotNull(customerPage.usersWidget()); Assert.assertTrue(customerPage.usersWidget().isDisplayed()); @@ -220,8 +236,10 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.timeBtn().isDisplayed()); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add phone number") public void addPhoneNumber() { String customerName = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customerName)); @@ -237,24 +255,26 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.phoneNumberEntityView().getAttribute("value").contains(number)); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "incorrectPhoneNumber") - @Description + @Description("Add incorrect phone number") public void addIncorrectPhoneNumber(String number) { sideBarMenuView.customerBtn().click(); customerPage.entityTitles().get(0).click(); customerPage.editPencilBtn().click(); - customerPage.phoneNumberEntityView().sendKeys(number); - boolean doneBtnIsEnable = customerPage.doneBtnEditViewVisible().isEnabled(); - customerPage.doneBtnEditViewVisible().click(); + customerPage.enterPhoneNumber(number); - Assert.assertFalse(doneBtnIsEnable); + Assert.assertFalse(customerPage.doneBtnEditViewVisible().isEnabled()); Assert.assertNotNull(customerPage.errorMessage()); Assert.assertTrue(customerPage.errorMessage().isDisplayed()); Assert.assertEquals(customerPage.errorMessage().getText(), PHONE_NUMBER_ERROR_MESSAGE); } + @Epic("Customers smoke tests") + @Feature("Edit customer") @Test(priority = 30, groups = "smoke") - @Description + @Description("Add all information") public void addAllInformation() { String customerName = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customerName)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteCustomerTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteCustomerTest.java index 3f535ce113..6421c30c31 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteCustomerTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteCustomerTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -43,8 +45,10 @@ public class DeleteCustomerTest extends AbstractDriverBaseTest { ruleChainsPage = new RuleChainsPageHelper(driver); } + @Epic("Customers smoke tests") + @Feature("Delete customer") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove the customer by clicking on the trash icon in the right side of refresh") public void removeCustomerByRightSideBtn() { String customer = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customer)); @@ -56,8 +60,10 @@ public class DeleteCustomerTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.entityIsNotPresent(deletedCustomer)); } + @Epic("Customers smoke tests") + @Feature("Delete customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove customer by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void removeSelectedCustomer() { String customerName = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customerName)); @@ -69,23 +75,27 @@ public class DeleteCustomerTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.entityIsNotPresent(deletedCustomer)); } + @Epic("Customers smoke tests") + @Feature("Delete customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the customer by clicking on the 'Delete customer' btn in the entity view") public void removeFromCustomerView() { String customerName = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customerName)); sideBarMenuView.customerBtn().click(); customerPage.entity(customerName).click(); - customerPage.customerViewDeleteBtn().click(); + jsClick(customerPage.customerViewDeleteBtn()); customerPage.warningPopUpYesBtn().click(); - customerPage.refreshBtn().click(); + jsClick(customerPage.refreshBtn()); Assert.assertTrue(customerPage.entityIsNotPresent(customerName)); } + @Epic("Customers smoke tests") + @Feature("Delete customer") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the customer by clicking on the trash icon in the right side of customer without refresh") public void removeCustomerByRightSideBtnWithoutRefresh() { String customer = ENTITY_NAME + random(); testRestClient.postCustomer(defaultCustomerPrototype(customer)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteSeveralCustomerTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteSeveralCustomerTest.java index 635505b64a..be3e9b65ed 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteSeveralCustomerTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteSeveralCustomerTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -40,8 +42,10 @@ public class DeleteSeveralCustomerTest extends AbstractDriverBaseTest { customerPage = new CustomerPageHelper(driver); } + @Epic("Customers smoke tests") + @Feature("Delete several customer") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove several customers by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void canDeleteSeveralCustomersByTopBtn() { String title1 = ENTITY_NAME + random() + "1"; String title2 = ENTITY_NAME + random() + "2"; @@ -49,29 +53,33 @@ public class DeleteSeveralCustomerTest extends AbstractDriverBaseTest { testRestClient.postCustomer(defaultCustomerPrototype(title2)); sideBarMenuView.customerBtn().click(); - customerPage.clickOnCheckBoxes(2); - customerPage.deleteSelectedBtn().click(); - customerPage.warningPopUpYesBtn().click(); + customerPage.deleteSelected(2); customerPage.refreshBtn().click(); Assert.assertTrue(customerPage.customerIsNotPresent(title1)); Assert.assertTrue(customerPage.customerIsNotPresent(title2)); } + @Epic("Customers smoke tests") + @Feature("Delete several customer") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove several customers by mark all the Customers on the page by clicking in the topmost checkbox " + + "and then clicking on the trash icon in the menu that appears") public void selectAllCustomers() { sideBarMenuView.customerBtn().click(); customerPage.selectAllCheckBox().click(); - customerPage.deleteSelectedBtn().click(); + jsClick(customerPage.deleteSelectedBtn()); Assert.assertNotNull(customerPage.warningPopUpTitle()); Assert.assertTrue(customerPage.warningPopUpTitle().isDisplayed()); Assert.assertTrue(customerPage.warningPopUpTitle().getText().contains(String.valueOf(customerPage.markCheckbox().size()))); } + @Epic("Customers smoke tests") + @Feature("Delete several customer") @Test(priority = 30, groups = "smoke") - @Description + @Description("Remove several customers by mark in the checkbox and then click on the trash can icon in the menu " + + "that appears at the top without refresh") public void deleteSeveralCustomersByTopBtnWithoutRefresh() { String title1 = ENTITY_NAME + random() + "1"; String title2 = ENTITY_NAME + random() + "2"; @@ -79,9 +87,7 @@ public class DeleteSeveralCustomerTest extends AbstractDriverBaseTest { testRestClient.postCustomer(defaultCustomerPrototype(title2)); sideBarMenuView.customerBtn().click(); - customerPage.clickOnCheckBoxes(2); - customerPage.deleteSelectedBtn().click(); - customerPage.warningPopUpYesBtn().click(); + customerPage.deleteSelected(2); Assert.assertTrue(customerPage.customerIsNotPresent(title1)); Assert.assertTrue(customerPage.customerIsNotPresent(title2)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersAssetsTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersAssetsTest.java index 405a028a15..13555aad01 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersAssetsTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersAssetsTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -37,8 +39,10 @@ public class ManageCustomersAssetsTest extends AbstractDriverBaseTest { customerPage = new CustomerPageHelper(driver); } + @Epic("Customers smoke tests") + @Feature("Manage customer assets") @Test(groups = "smoke") - @Description + @Description("Open manage window by right corner btn") public void openWindowByRightCornerBtn() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); @@ -50,13 +54,15 @@ public class ManageCustomersAssetsTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.customerManageWindowIconHead().getText().contains(manage)); } + @Epic("Customers smoke tests") + @Feature("Manage customer assets") @Test(groups = "smoke") - @Description + @Description("Open manage window by btn in entity view") public void openWindowByView() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); customerPage.entity(customerPage.getCustomerName()).click(); - customerPage.manageCustomersAssetsBtnView().click(); + jsClick(customerPage.manageCustomersAssetsBtnView()); Assert.assertTrue(urlContains(manage.toLowerCase())); Assert.assertNotNull(customerPage.customerAssetsIconHeader()); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersDashboardsTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersDashboardsTest.java index f1f27c96cf..670fbd941a 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersDashboardsTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersDashboardsTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -36,8 +38,10 @@ public class ManageCustomersDashboardsTest extends AbstractDriverBaseTest { customerPage = new CustomerPageHelper(driver); } + @Epic("Customers smoke tests") + @Feature("Manage customer dashboards") @Test(groups = "smoke") - @Description + @Description("Open manage window by right corner btn") public void openWindowByRightCornerBtn() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); @@ -49,13 +53,15 @@ public class ManageCustomersDashboardsTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.customerManageWindowIconHead().getText().contains(manage)); } + @Epic("Customers smoke tests") + @Feature("Manage customer dashboards") @Test(groups = "smoke") - @Description + @Description("Open manage window by btn in entity view") public void openWindowByView() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); customerPage.entity(customerPage.getCustomerName()).click(); - customerPage.manageCustomersDashboardsBtnView().click(); + jsClick(customerPage.manageCustomersDashboardsBtnView()); Assert.assertTrue(urlContains(manage.toLowerCase())); Assert.assertNotNull(customerPage.customerDashboardIconHeader()); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersDevicesTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersDevicesTest.java index fde5b87e52..bb5fe0d41a 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersDevicesTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersDevicesTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -36,8 +38,10 @@ public class ManageCustomersDevicesTest extends AbstractDriverBaseTest { customerPage = new CustomerPageHelper(driver); } + @Epic("Customers smoke tests") + @Feature("Manage customer devices") @Test(groups = "smoke") - @Description + @Description("Open manage window by right corner btn") public void openWindowByRightCornerBtn() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); @@ -49,13 +53,15 @@ public class ManageCustomersDevicesTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.customerManageWindowIconHead().getText().contains(manage)); } + @Epic("Customers smoke tests") + @Feature("Manage customer devices") @Test(groups = "smoke") - @Description + @Description("Open manage window by btn in entity view") public void openWindowByView() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); customerPage.entity(customerPage.getCustomerName()).click(); - customerPage.manageCustomersDeviceBtnView().click(); + jsClick(customerPage.manageCustomersDeviceBtnView()); Assert.assertTrue(urlContains(manage.toLowerCase())); Assert.assertNotNull(customerPage.customerDevicesIconHeader()); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersEdgesTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersEdgesTest.java index 184f506584..5a34d106c6 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersEdgesTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersEdgesTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -37,8 +39,10 @@ public class ManageCustomersEdgesTest extends AbstractDriverBaseTest { customerPage = new CustomerPageHelper(driver); } + @Epic("Customers smoke tests") + @Feature("Manage customer edges") @Test(groups = "smoke") - @Description + @Description("Open manage window by right corner btn") public void openWindowByRightCornerBtn() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); @@ -50,13 +54,15 @@ public class ManageCustomersEdgesTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.customerManageWindowIconHead().getText().contains(iconText)); } + @Epic("Customers smoke tests") + @Feature("Manage customer edges") @Test(groups = "smoke") - @Description + @Description("Open manage window by btn in entity view") public void openWindowByView() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); customerPage.entity(customerPage.getCustomerName()).click(); - customerPage.manageCustomersEdgeBtnView().click(); + jsClick(customerPage.manageCustomersEdgeBtnView()); Assert.assertTrue(urlContains("edgeInstances")); Assert.assertNotNull(customerPage.customerEdgeIconHeader()); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersUsersTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersUsersTest.java index 9b8a7b8eef..9fe16410ec 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersUsersTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersUsersTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -37,12 +39,14 @@ public class ManageCustomersUsersTest extends AbstractDriverBaseTest { customerPage = new CustomerPageHelper(driver); } + @Epic("Customers smoke tests") + @Feature("Manage customer users") @Test(groups = "smoke") - @Description + @Description("Open manage window by right corner btn") public void openWindowByRightCornerBtn() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); - customerPage.manageCustomersUserBtn(customerPage.getCustomerName()).click(); + jsClick(customerPage.manageCustomersUserBtn(customerPage.getCustomerName())); Assert.assertTrue(urlContains("user")); Assert.assertNotNull(customerPage.customerUserIconHeader()); @@ -50,13 +54,15 @@ public class ManageCustomersUsersTest extends AbstractDriverBaseTest { Assert.assertTrue(customerPage.customerManageWindowIconHead().getText().contains(iconText)); } + @Epic("Customers smoke tests") + @Feature("Manage customer users") @Test(groups = "smoke") - @Description + @Description("Open manage window by btn in entity view") public void openWindowByView() { sideBarMenuView.customerBtn().click(); customerPage.setCustomerName(); customerPage.entity(customerPage.getCustomerName()).click(); - customerPage.manageCustomersUserBtnView().click(); + jsClick(customerPage.manageCustomersUserBtnView()); Assert.assertTrue(urlContains("user")); Assert.assertNotNull(customerPage.customerUserIconHeader()); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/SearchCustomerTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/SearchCustomerTest.java index 2ff2a6fef9..8e317073d0 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/SearchCustomerTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/SearchCustomerTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -39,8 +41,10 @@ public class SearchCustomerTest extends AbstractDriverBaseTest { customerPage = new CustomerPageHelper(driver); } + @Epic("Customers smoke tests") + @Feature("Search customer") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "customerNameForSearchByFirstAndSecondWord") - @Description + @Description("Search customer by first word in the name/*CHANGE TESTCASE*") public void searchFirstWord(String namePath) { sideBarMenuView.customerBtn().click(); customerPage.searchEntity(namePath); @@ -48,8 +52,10 @@ public class SearchCustomerTest extends AbstractDriverBaseTest { customerPage.allEntity().forEach(x -> Assert.assertTrue(x.getText().contains(namePath))); } + @Epic("Customers smoke tests") + @Feature("Search customer") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSearchBySymbolAndNumber") - @Description + @Description("Search customer by symbol in the name/Search customer by number in the name") public void searchNumber(String name, String namePath) { testRestClient.postCustomer(defaultCustomerPrototype(name)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/SortByNameTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/SortByNameTest.java index 296ab2c847..f60e7997a4 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/SortByNameTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/SortByNameTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.customerSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -48,8 +50,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { } } + @Epic("Customers smoke tests") + @Feature("Sort customers by name") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") - @Description + @Description("Sort customers 'UP'") public void specialCharacterUp(String title) { testRestClient.postCustomer(defaultCustomerPrototype(title)); this.customerName = title; @@ -61,8 +65,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(customerPage.getCustomerName(), title); } + @Epic("Customers smoke tests") + @Feature("Sort customers by name") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") - @Description + @Description("Sort customers 'UP'") public void allSortUp(String customer, String customerSymbol, String customerNumber) { testRestClient.postCustomer(defaultCustomerPrototype(customerSymbol)); testRestClient.postCustomer(defaultCustomerPrototype(customer)); @@ -86,8 +92,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(thirdCustomer, customer); } + @Epic("Customers smoke tests") + @Feature("Sort customers by name") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") - @Description + @Description("Sort customers 'DOWN'") public void specialCharacterDown(String title) { testRestClient.postCustomer(defaultCustomerPrototype(title)); customerName = title; @@ -99,8 +107,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(customerPage.getCustomerName(), title); } + @Epic("Customers smoke tests") + @Feature("Sort customers by name") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") - @Description + @Description("Sort customers 'DOWN'") public void allSortDown(String customer, String customerSymbol, String customerNumber) { testRestClient.postCustomer(defaultCustomerPrototype(customerSymbol)); testRestClient.postCustomer(defaultCustomerPrototype(customer)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java index 1c530d33ad..436f19c3d4 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -55,8 +57,10 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest { } } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Import device profile") public void importDeviceProfile() { sideBarMenuView.openDeviceProfiles(); profilesPage.openImportDeviceProfileView(); @@ -69,8 +73,10 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME).isDisplayed()); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Import txt file") public void importTxtFile() { sideBarMenuView.openDeviceProfiles(); profilesPage.openImportDeviceProfileView(); @@ -80,8 +86,10 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed()); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Drop json file and delete it") public void addFileTiImportAndRemove() { sideBarMenuView.openDeviceProfiles(); profilesPage.openImportDeviceProfileView(); @@ -93,8 +101,10 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entityIsNotPresent(IMPORT_DEVICE_PROFILE_NAME)); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Import device profile with same name") public void importDeviceProfileWithSameName() { String name = IMPORT_DEVICE_PROFILE_NAME; testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); @@ -111,8 +121,10 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.warningMessage().getText(), SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 30, groups = "smoke") - @Description + @Description("Import device profile without refresh") public void importDeviceProfileWithoutRefresh() { sideBarMenuView.openDeviceProfiles(); profilesPage.openImportDeviceProfileView(); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java index b983b7fe5f..d5f9791241 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.openqa.selenium.Keys; import org.testng.Assert; import org.testng.annotations.AfterMethod; @@ -54,8 +56,10 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest { } } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Add device profile after specifying the name (text/numbers /special characters)") public void createDeviceProfile() { String name = ENTITY_NAME + random(); @@ -70,8 +74,10 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entity(name).isDisplayed()); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add device profile after specifying the name with details") public void createDeviceProfileWithDetails() { String name = ENTITY_NAME + random(); String ruleChain = "Root Rule Chain"; @@ -105,8 +111,10 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertEquals(description, profilesPage.getDescription()); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Create a device profile with the same name") public void createDeviseProfileWithSameName() { String name = ENTITY_NAME + random(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); @@ -124,8 +132,10 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed()); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add device profile without the name") public void createDeviceProfileWithoutName() { sideBarMenuView.openDeviceProfiles(); profilesPage.openCreateDeviceProfileView(); @@ -137,8 +147,10 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.errorMessage().getText(), NAME_IS_REQUIRED_MESSAGE); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Create device profile only with spase in name") public void createDeviseProfileWithOnlySpaceInName() { sideBarMenuView.openDeviceProfiles(); profilesPage.openCreateDeviceProfileView(); @@ -152,8 +164,10 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed()); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add device profile after specifying the name (text/numbers /special characters) without refresh") public void createDeviceProfileWithoutRefresh() { String name = ENTITY_NAME + random(); @@ -167,16 +181,18 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entity(name).isDisplayed()); } + @Epic("Device profile smoke tests") + @Feature("Create device profile") @Test(priority = 30, groups = "smoke") - @Description + @Description("Go to device profile documentation page") public void documentation() { String urlPath = "docs/user-guide/device-profiles/"; sideBarMenuView.openDeviceProfiles(); - profilesPage.allEntity().get(0).click(); + profilesPage.profileNames().get(0).click(); profilesPage.goToProfileHelpPage(); - Assert.assertTrue(urlContains(urlPath)); + Assert.assertTrue(urlContains(urlPath), "URL contains " + urlPath); } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java index 3dd6c2b28d..ccc97b8c94 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -40,8 +42,10 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest { profilesPage = new ProfilesPageHelper(driver); } + @Epic("Device profile smoke tests") + @Feature("Delete one device profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove the device profile by clicking on the trash icon in the right side of device profile") public void removeDeviceProfile() { String name = ENTITY_NAME + random(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); @@ -54,8 +58,10 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entityIsNotPresent(name)); } + @Epic("Device profile smoke tests") + @Feature("Delete one device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the device profile by clicking on the 'Delete device profile' btn in the entity view") public void removeDeviceProfileFromView() { String name = ENTITY_NAME + random(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); @@ -69,8 +75,10 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entityIsNotPresent(name)); } + @Epic("Device profile smoke tests") + @Feature("Delete one device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove device profile by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void removeSelectedDeviceProfile() { String name = ENTITY_NAME + random(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); @@ -84,16 +92,20 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.entityIsNotPresent(name)); } + @Epic("Device profile smoke tests") + @Feature("Delete one device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the default device profile by clicking on the trash icon in the right side of device profile") public void removeDefaultDeviceProfile() { sideBarMenuView.openDeviceProfiles(); Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled()); } + @Epic("Device profile smoke tests") + @Feature("Delete one device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the Default device profile by clicking on the 'Delete device profile' btn in the entity view") public void removeDefaultDeviceProfileFromView() { sideBarMenuView.openDeviceProfiles(); profilesPage.entity("default").click(); @@ -101,17 +113,20 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.deleteDeviceProfileFromViewBtnIsNotDisplayed()); } + @Epic("Device profile smoke tests") + @Feature("Delete one device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the default device profile by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void removeSelectedDefaultDeviceProfile() { sideBarMenuView.openDeviceProfiles(); Assert.assertNotNull(profilesPage.presentCheckBox("default")); Assert.assertFalse(profilesPage.presentCheckBox("default").isDisplayed()); } - + @Epic("Device profile smoke tests") + @Feature("Delete one device profile") @Test(priority = 30, groups = "smoke") - @Description + @Description("Remove the device profile by clicking on the trash icon in the right side of device profile without refresh") public void removeDeviceProfileWithoutRefresh() { String name = ENTITY_NAME + random(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteSeveralDeviceProfilesTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteSeveralDeviceProfilesTest.java index 8459474c38..a6b0b4e930 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteSeveralDeviceProfilesTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteSeveralDeviceProfilesTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -39,8 +41,10 @@ public class DeleteSeveralDeviceProfilesTest extends AbstractDriverBaseTest { profilesPage = new ProfilesPageHelper(driver); } + @Epic("Device profile smoke tests") + @Feature("Delete several device profiles") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove several device profiles by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void canDeleteSeveralDeviceProfilesByTopBtn() { String name1 = ENTITY_NAME + random() + "1"; String name2 = ENTITY_NAME + random() + "2"; @@ -57,8 +61,10 @@ public class DeleteSeveralDeviceProfilesTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.profileIsNotPresent(name2)); } + @Epic("Device profile smoke tests") + @Feature("Delete several device profiles") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove several device profiles by mark all the device profiles on the page by clicking in the topmost checkbox and then clicking on the trash icon in the menu that appears") public void selectAllDeviceProfiles() { sideBarMenuView.openDeviceProfiles(); profilesPage.selectAllCheckBox().click(); @@ -69,8 +75,10 @@ public class DeleteSeveralDeviceProfilesTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.warningPopUpTitle().getText().contains(String.valueOf(profilesPage.markCheckbox().size()))); } + @Epic("Device profile smoke tests") + @Feature("Delete several device profiles") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the default device profile by mark all the device profiles on the page by clicking in the topmost checkbox and then clicking on the trash icon in the menu that appears") public void removeDefaultDeviceProfile() { sideBarMenuView.openDeviceProfiles(); profilesPage.selectAllCheckBox().click(); @@ -79,8 +87,10 @@ public class DeleteSeveralDeviceProfilesTest extends AbstractDriverBaseTest { Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled()); } + @Epic("Device profile smoke tests") + @Feature("Delete several device profiles") @Test(priority = 30, groups = "smoke") - @Description + @Description("Remove several device profiles by mark in the checkbox and then click on the trash can icon in the menu that appears at the top without refresh") public void deleteSeveralDeviceProfilesByTopBtnWithoutRefresh() { String name1 = ENTITY_NAME + random() + "1"; String name2 = ENTITY_NAME + random() + "2"; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java index 9d889f2e54..12a7ed5616 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.openqa.selenium.Keys; import org.testng.Assert; import org.testng.annotations.AfterMethod; @@ -54,8 +56,10 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest { } } + @Epic("Device profile smoke tests") + @Feature("Edit device profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Change name by edit menu") public void changeName() { String name = ENTITY_NAME + random(); String newName = "Changed" + getRandomNumber(); @@ -77,8 +81,10 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(titleAfter, newName); } + @Epic("Device profile smoke tests") + @Feature("Edit device profile") @Test(priority = 10, groups = "smoke") - @Description + @Description("Delete name and save") public void deleteName() { String name = ENTITY_NAME + random(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); @@ -92,8 +98,10 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest { Assert.assertFalse(profilesPage.doneBtnEditViewVisible().isEnabled()); } + @Epic("Device profile smoke tests") + @Feature("Edit device profile") @Test(priority = 20, groups = "smoke") - @Description + @Description("Save only with space in name") public void saveWithOnlySpaceInName() { String name = ENTITY_NAME + random(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); @@ -110,8 +118,10 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.warningMessage().getText(), EMPTY_DEVICE_PROFILE_MESSAGE); } + @Epic("Device profile smoke tests") + @Feature("Edit device profile") @Test(priority = 30, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription") - @Description + @Description("Write the description and save the changes/Change the description and save the changes/Delete the description and save the changes") public void editDescription(String description, String newDescription, String finalDescription) { String name = ENTITY_NAME + random(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name, description)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/MakeDeviceProfileDefaultTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/MakeDeviceProfileDefaultTest.java index 9ef711eee4..c9b746bdd6 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/MakeDeviceProfileDefaultTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/MakeDeviceProfileDefaultTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -41,8 +43,10 @@ public class MakeDeviceProfileDefaultTest extends AbstractDriverBaseTest { testRestClient.setDefaultDeviceProfile(getDeviceProfileByName("default").getId()); } + @Epic("Device profile smoke tests") + @Feature("Make device profile default") @Test(priority = 10, groups = "smoke") - @Description + @Description("Make device profile default by clicking on the 'Make device profile default' icon in the right corner") public void makeDeviceProfileDefaultByRightCornerBtn() { sideBarMenuView.openDeviceProfiles(); profilesPage.setProfileName(); @@ -53,8 +57,10 @@ public class MakeDeviceProfileDefaultTest extends AbstractDriverBaseTest { Assert.assertTrue(profilesPage.defaultCheckbox(profile).isDisplayed()); } + @Epic("Device profile smoke tests") + @Feature("Make device profile default") @Test(priority = 10, groups = "smoke") - @Description + @Description("Make device profile default by clicking on the 'Make device profile default' button in the entity view") public void makeDeviceProfileDefaultFromView() { sideBarMenuView.openDeviceProfiles(); profilesPage.setProfileName(); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SearchDeviceProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SearchDeviceProfileTest.java index bb6b82b3a9..8482fa6cbc 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SearchDeviceProfileTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SearchDeviceProfileTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -49,8 +51,11 @@ public class SearchDeviceProfileTest extends AbstractDriverBaseTest { } } + @Epic("Device profiles smoke") + @Feature("Search device profile") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "deviceProfileSearch") - @Description + @Description("Search device profile by first word in the name/Search device profile by second word in the name/" + + "Search device profile by symbol in the name/Search asset profile by number in the name") public void searchFirstWord(String name, String namePath) { testRestClient.postDeviceProfile(defaultDeviceProfile(name)); this.name = name; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SortByNameTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SortByNameTest.java index a6c1a7b0cf..93dc659f6e 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SortByNameTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SortByNameTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -48,8 +50,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { } } + @Epic("Device profiles smoke") + @Feature("Sort device profile by name") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") - @Description + @Description("Sort device profile 'UP'") public void specialCharacterUp(String name) { testRestClient.postDeviceProfile(defaultDeviceProfile(name)); this.name = name; @@ -61,8 +65,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.getProfileName(), name); } + @Epic("Device profiles smoke") + @Feature("Sort device profile by name") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") - @Description + @Description("Sort device profile 'UP'") public void allSortUp(String deviceProfile, String deviceProfileSymbol, String deviceProfileNumber) { testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfileSymbol)); testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfile)); @@ -86,8 +92,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(thirdDeviceProfile, deviceProfile); } + @Epic("Device profiles smoke") + @Feature("Sort device profile by name") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") - @Description + @Description("Sort device profile 'DOWN'") public void specialCharacterDown(String name) { testRestClient.postDeviceProfile(defaultDeviceProfile(name)); this.name = name; @@ -99,8 +107,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(profilesPage.getProfileName(), name); } + @Epic("Device profiles smoke") + @Feature("Sort device profile by name") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") - @Description + @Description("Sort device profile 'DOWN'") public void allSortDown(String deviceProfile, String deviceProfileSymbol, String deviceProfileNumber) { testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfileSymbol)); testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfile)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java index 14d3a0a6cd..dd2f8a5895 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java @@ -16,6 +16,9 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; +import org.openqa.selenium.WebElement; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -58,8 +61,10 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest { } } + @Epic("Rule chains smoke tests") + @Feature("Import rule chain") @Test(priority = 10, groups = "smoke") - @Description + @Description("Drop json file") public void importRuleChain() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.openImportRuleChainView(); @@ -69,8 +74,10 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.importingFile(IMPORT_RULE_CHAIN_FILE_NAME).isDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Import rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Drop json file and delete it") public void importRuleChainAndDeleteFile() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.openImportRuleChainView(); @@ -82,8 +89,10 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.entityIsNotPresent(IMPORT_RULE_CHAIN_FILE_NAME)); } + @Epic("Rule chains smoke tests") + @Feature("Import rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Import txt file") public void importTxtFile() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.openImportRuleChainView(); @@ -93,15 +102,17 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Import rule chain") @Test(priority = 30, groups = "smoke") - @Description + @Description("Import rule chain") public void importRuleChainAndSave() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.openImportRuleChainView(); ruleChainsPage.browseFile().sendKeys(absolutePathToFileImportRuleChain); ruleChainsPage.importBrowseFileBtn().click(); - openRuleChainPage.doneBtn().click(); - openRuleChainPage.waitUntilDoneBtnDisable(); + WebElement doneBtn = openRuleChainPage.doneBtn(); + doneBtn.click(); ruleChainName = IMPORT_RULE_CHAIN_NAME; sideBarMenuView.ruleChainsBtn().click(); @@ -109,8 +120,10 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.entity(IMPORT_RULE_CHAIN_NAME).isDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Import rule chain") @Test(priority = 40, groups = "smoke") - @Description + @Description("Import rule chain with same name") public void importRuleChainAndSaveWithSameName() { String ruleChainName = IMPORT_RULE_CHAIN_NAME; testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); @@ -120,8 +133,8 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest { ruleChainsPage.openImportRuleChainView(); ruleChainsPage.browseFile().sendKeys(absolutePathToFileImportRuleChain); ruleChainsPage.importBrowseFileBtn().click(); - openRuleChainPage.doneBtn().click(); - openRuleChainPage.waitUntilDoneBtnDisable(); + WebElement doneBtn = openRuleChainPage.doneBtn(); + doneBtn.click(); sideBarMenuView.ruleChainsBtn().click(); boolean entityNotNull = ruleChainsPage.entity(ruleChainName) != null; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainTest.java index 4e1ec60f10..e8bdaff9da 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -53,8 +55,10 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest { } } + @Epic("Rule chains smoke tests") + @Feature("Create rule chain") @Test(priority = 10, groups = "smoke") - @Description + @Description("Add rule chain after specifying the name (text/numbers /special characters)") public void createRuleChain() { String ruleChainName = ENTITY_NAME + random(); @@ -70,8 +74,10 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.entity(ruleChainName).isDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Create rule chain") @Test(priority = 10, groups = "smoke") - @Description + @Description("Add rule chain after specifying the name and description (text/numbers /special characters)") public void createRuleChainWithDescription() { String ruleChainName = ENTITY_NAME + random(); @@ -89,8 +95,10 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainsPage.descriptionEntityView().getAttribute("value"), ruleChainName); } + @Epic("Rule chains smoke tests") + @Feature("Create rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Add rule chain without the name") public void createRuleChainWithoutName() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.openCreateRuleChainView(); @@ -98,8 +106,10 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest { Assert.assertFalse(ruleChainsPage.addBtnV().isEnabled()); } + @Epic("Rule chains smoke tests") + @Feature("Create rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Create rule chain only with spase in name") public void createRuleChainWithOnlySpace() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.openCreateRuleChainView(); @@ -113,8 +123,10 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.addEntityView().isDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Create rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Create a rule chain with the same name") public void createRuleChainWithSameName() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(EntityPrototypes.defaultRuleChainPrototype(ruleChainName)); @@ -138,8 +150,10 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest { entityIsDisplayed.forEach(Assert::assertTrue); } + @Epic("Rule chains smoke tests") + @Feature("Create rule chain") @Test(priority = 30, groups = "smoke") - @Description + @Description("Add rule chain after specifying the name (text/numbers /special characters) without refresh") public void createRuleChainWithoutRefresh() { String ruleChainName = ENTITY_NAME + random(); @@ -153,8 +167,10 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.entity(ruleChainName).isDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Create rule chain") @Test(priority = 40, groups = "smoke") - @Description + @Description("Go to rule chain documentation page") public void documentation() { String urlPath = "docs/user-guide/ui/rule-chains/"; @@ -163,6 +179,6 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest { ruleChainsPage.detailsBtn(ruleChainsPage.getRuleChainName()).click(); ruleChainsPage.goToHelpPage(); - Assert.assertTrue(urlContains(urlPath)); + Assert.assertTrue(urlContains(urlPath), "URL contains " + urlPath); } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/DeleteRuleChainTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/DeleteRuleChainTest.java index 078a807185..e1f27d7bab 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/DeleteRuleChainTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/DeleteRuleChainTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -41,8 +43,10 @@ public class DeleteRuleChainTest extends AbstractDriverBaseTest { ruleChainsPage = new RuleChainsPageHelper(driver); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove the rule chain by clicking on the trash icon in the right side of rule chain") public void removeRuleChainByRightSideBtn() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); @@ -54,8 +58,10 @@ public class DeleteRuleChainTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.entityIsNotPresent(deletedRuleChain)); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove rule chain by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void removeSelectedRuleChain() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); @@ -67,8 +73,10 @@ public class DeleteRuleChainTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.entityIsNotPresent(deletedRuleChain)); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the rule chain by clicking on the 'Delete rule chain' btn in the entity view") public void removeFromRuleChainView() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); @@ -76,39 +84,46 @@ public class DeleteRuleChainTest extends AbstractDriverBaseTest { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.detailsBtn(ENTITY_NAME).click(); String deletedRuleChain = ruleChainsPage.deleteRuleChainFromView(ruleChainName); - ruleChainsPage.refreshBtn().click(); + jsClick(ruleChainsPage.refreshBtn()); Assert.assertTrue(ruleChainsPage.entityIsNotPresent(deletedRuleChain)); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the root rule chain by clicking on the trash icon in the right side of rule chain") public void removeRootRuleChain() { sideBarMenuView.ruleChainsBtn().click(); Assert.assertFalse(ruleChainsPage.deleteBtn(ROOT_RULE_CHAIN_NAME).isEnabled()); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove root rule chain by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void removeSelectedRootRuleChain() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.assertCheckBoxIsNotDisplayed(ROOT_RULE_CHAIN_NAME); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the root rule chain by clicking on the 'Delete rule chain' btn in the entity view") public void removeFromRootRuleChainView() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.detailsBtn(ROOT_RULE_CHAIN_NAME).click(); - ruleChainsPage.deleteBtnFromView(); Assert.assertTrue(ruleChainsPage.deleteBtnInRootRuleChainIsNotDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove the rule chain with device profile by clicking on the trash icon in the right side of rule chain") public void removeProfileRuleChainByRightSideBtn() { String deletedRuleChain = "Thermostat"; @@ -124,8 +139,10 @@ public class DeleteRuleChainTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainsPage.warningMessage().getText(), DELETE_RULE_CHAIN_WITH_PROFILE_MESSAGE); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the rule chain with device profile by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") public void removeSelectedProfileRuleChain() { sideBarMenuView.ruleChainsBtn().click(); String deletedRuleChain = ruleChainsPage.deleteSelected("Thermostat"); @@ -138,14 +155,16 @@ public class DeleteRuleChainTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainsPage.warningMessage().getText(), DELETE_RULE_CHAIN_WITH_PROFILE_MESSAGE); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the rule chain with device profile by clicking on the 'Delete rule chain' btn in the entity view") public void removeFromProfileRuleChainView() { String deletedRuleChain = "Thermostat"; sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.detailsBtn(deletedRuleChain).click(); - ruleChainsPage.deleteBtnFromView().click(); + jsClick(ruleChainsPage.deleteBtnFromView()); ruleChainsPage.warningPopUpYesBtn().click(); Assert.assertNotNull(ruleChainsPage.entity(deletedRuleChain)); @@ -154,8 +173,10 @@ public class DeleteRuleChainTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainsPage.warningMessage().getText(), DELETE_RULE_CHAIN_WITH_PROFILE_MESSAGE); } + @Epic("Rule chains smoke tests") + @Feature("Delete rule chain") @Test(priority = 30, groups = "smoke") - @Description + @Description("Remove the rule chain by clicking on the trash icon in the right side of rule chain without refresh") public void removeRuleChainByRightSideBtnWithoutRefresh() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/DeleteSeveralRuleChainsTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/DeleteSeveralRuleChainsTest.java index 612efee64c..068fbbf71b 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/DeleteSeveralRuleChainsTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/DeleteSeveralRuleChainsTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -41,24 +43,28 @@ public class DeleteSeveralRuleChainsTest extends AbstractDriverBaseTest { ruleChainsPage = new RuleChainsPageHelper(driver); } + @Epic("Rule chains smoke tests") + @Feature("Delete several rule chains") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove several rule chains by mark in the checkbox and then click on the trash can icon in the menu " + + "that appears at the top") public void canDeleteSeveralRuleChainsByTopBtn() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName + 1)); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); sideBarMenuView.ruleChainsBtn().click(); - ruleChainsPage.clickOnCheckBoxes(2); - ruleChainsPage.deleteSelectedBtn().click(); - ruleChainsPage.warningPopUpYesBtn().click(); + ruleChainsPage.deleteSelected(2); ruleChainsPage.refreshBtn().click(); Assert.assertTrue(ruleChainsPage.ruleChainsIsNotPresent(ruleChainName)); } + @Epic("Rule chains smoke tests") + @Feature("Delete several rule chains") @Test(priority = 10, groups = "smoke") - @Description + @Description("Remove several rule chains by mark all the rule chains on the page by clicking in the topmost checkbox" + + " and then clicking on the trash icon in the menu that appears") public void selectAllRuleChain() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName + 1)); @@ -66,15 +72,18 @@ public class DeleteSeveralRuleChainsTest extends AbstractDriverBaseTest { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.selectAllCheckBox().click(); - ruleChainsPage.deleteSelectedBtn().click(); + jsClick(ruleChainsPage.deleteSelectedBtn()); ruleChainsPage.warningPopUpYesBtn().click(); ruleChainsPage.refreshBtn().click(); Assert.assertTrue(ruleChainsPage.ruleChainsIsNotPresent(ruleChainName)); } + @Epic("Rule chains smoke tests") + @Feature("Delete several rule chains") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the root rule chain by mark in the checkbox and then click on the trash can icon in the menu " + + "that appears at the top") public void removeRootRuleChain() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.selectAllCheckBox().click(); @@ -82,8 +91,11 @@ public class DeleteSeveralRuleChainsTest extends AbstractDriverBaseTest { Assert.assertFalse(ruleChainsPage.deleteBtn(ROOT_RULE_CHAIN_NAME).isEnabled()); } + @Epic("Rule chains smoke tests") + @Feature("Delete several rule chains") @Test(priority = 20, groups = "smoke") - @Description + @Description("Remove the root rule chain by mark all the rule chains on the page by clicking in the topmost checkbox" + + " and then clicking on the trash icon in the menu that appears") public void removeSelectedRootRuleChain() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.selectAllCheckBox().click(); @@ -91,17 +103,18 @@ public class DeleteSeveralRuleChainsTest extends AbstractDriverBaseTest { ruleChainsPage.assertCheckBoxIsNotDisplayed(ROOT_RULE_CHAIN_NAME); } + @Epic("Rule chains smoke tests") + @Feature("Delete several rule chains") @Test(priority = 30, groups = "smoke") - @Description + @Description("Remove several rule chains by mark in the checkbox and then click on the trash can icon in the menu " + + "that appears at the top without refresh") public void deleteSeveralRuleChainsByTopBtnWithoutRefresh() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName + 1)); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); sideBarMenuView.ruleChainsBtn().click(); - ruleChainsPage.clickOnCheckBoxes(2); - ruleChainsPage.deleteSelectedBtn().click(); - ruleChainsPage.warningPopUpYesBtn().click(); + ruleChainsPage.deleteSelected(2); Assert.assertTrue(ruleChainsPage.ruleChainsIsNotPresent(ruleChainName)); } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/MakeRuleChainRootTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/MakeRuleChainRootTest.java index 7ad3fad982..cf252ea22a 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/MakeRuleChainRootTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/MakeRuleChainRootTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -42,8 +44,10 @@ public class MakeRuleChainRootTest extends AbstractDriverBaseTest { testRestClient.setRootRuleChain(getRuleChainByName("Root Rule Chain").getId()); } + @Epic("Rule chains smoke tests") + @Feature("Make rule chain root") @Test(priority = 10, groups = "smoke") - @Description + @Description("Make rule chain root by clicking on the 'Make rule chain root' icon in the right corner") public void makeRuleChainRootByRightCornerBtn() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.setRuleChainNameWithoutRoot(0); @@ -54,8 +58,10 @@ public class MakeRuleChainRootTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.rootCheckBoxEnable(ruleChain).isDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Make rule chain root") @Test(priority = 20, groups = "smoke") - @Description + @Description("Make rule chain root by clicking on the 'Make rule chain root' button in the entity view") public void makeRuleChainRootFromView() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.setRuleChainNameWithoutRoot(0); @@ -68,14 +74,16 @@ public class MakeRuleChainRootTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.rootCheckBoxEnable(ruleChain).isDisplayed()); } + @Epic("Rule chains smoke tests") + @Feature("Make rule chain root") @Test(priority = 30, groups = "smoke") - @Description + @Description("Make multiple root rule chains (only one rule chain can be root)") public void multiplyRoot() { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.setRuleChainNameWithoutRoot(0); String ruleChain = ruleChainsPage.getRuleChainName(); ruleChainsPage.detailsBtn(ruleChain).click(); - ruleChainsPage.makeRootFromViewBtn().click(); + jsClick(ruleChainsPage.makeRootFromViewBtn()); ruleChainsPage.warningPopUpYesBtn().click(); ruleChainsPage.closeEntityViewBtn().click(); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/OpenRuleChainTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/OpenRuleChainTest.java index 05c59b0d7d..220b718ae8 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/OpenRuleChainTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/OpenRuleChainTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -53,8 +55,10 @@ public class OpenRuleChainTest extends AbstractDriverBaseTest { } } + @Epic("Rule chains smoke tests") + @Feature("Open rule chain") @Test(priority = 10, groups = "smoke") - @Description + @Description("Open the rule chain by clicking on its name") public void openRuleChainByRightCornerBtn() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(EntityPrototypes.defaultRuleChainPrototype(ruleChainName)); @@ -70,8 +74,10 @@ public class OpenRuleChainTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainName, openRuleChainPage.getHeadName()); } + @Epic("Rule chains smoke tests") + @Feature("Open rule chain") @Test(priority = 10, groups = "smoke") - @Description + @Description("Open the rule chain by clicking on the 'Open rule chain' button in the entity view") public void openRuleChainByViewBtn() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(EntityPrototypes.defaultRuleChainPrototype(ruleChainName)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/RuleChainEditMenuTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/RuleChainEditMenuTest.java index 144ca0e836..5b380221b6 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/RuleChainEditMenuTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/RuleChainEditMenuTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -54,8 +56,10 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest { } } + @Epic("Rule chains smoke tests") + @Feature("Edit rule chain") @Test(priority = 10, groups = "smoke") - @Description + @Description("Change name by edit menu") public void changeName() { String newRuleChainName = "Changed" + getRandomNumber(); String ruleChainName = ENTITY_NAME + random(); @@ -77,8 +81,10 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(newRuleChainName, nameAfter); } + @Epic("Rule chains smoke tests") + @Feature("Edit rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Delete name and save") public void deleteName() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); @@ -92,8 +98,10 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest { Assert.assertFalse(ruleChainsPage.doneBtnEditViewVisible().isEnabled()); } + @Epic("Rule chains smoke tests") + @Feature("Edit rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Save only with space") public void saveOnlyWithSpace() { String ruleChainName = ENTITY_NAME +random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); @@ -110,8 +118,10 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainsPage.warningMessage().getText(), EMPTY_RULE_CHAIN_MESSAGE); } + @Epic("Rule chains smoke tests") + @Feature("Edit rule chain") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription") - @Description + @Description("Write the description and save the changes/Change the description and save the changes/Delete the description and save the changes") public void editDescription(String description, String newDescription, String finalDescription) { String name = ENTITY_NAME + random(); testRestClient.postRuleChain(EntityPrototypes.defaultRuleChainPrototype(name, description)); @@ -127,8 +137,10 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainsPage.getDescription(), finalDescription); } + @Epic("Rule chains smoke tests") + @Feature("Edit rule chain") @Test(priority = 20, groups = "smoke") - @Description + @Description("Enable debug mode/Disable debug mode") public void debugMode() { String ruleChainName = ENTITY_NAME + random(); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SearchRuleChainTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SearchRuleChainTest.java index 29c5b21556..b34f59d420 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SearchRuleChainTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SearchRuleChainTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -39,8 +41,10 @@ public class SearchRuleChainTest extends AbstractDriverBaseTest { ruleChainsPage = new RuleChainsPageHelper(driver); } + @Epic("Rule chains smoke tests") + @Feature("Search rule chain") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "ruleChainNameForSearchByFirstAndSecondWord") - @Description + @Description("Search rule chain by first word in the name/Search rule chain by second word in the name") public void searchFirstWord(String namePath) { sideBarMenuView.ruleChainsBtn().click(); ruleChainsPage.searchEntity(namePath); @@ -49,8 +53,10 @@ public class SearchRuleChainTest extends AbstractDriverBaseTest { Assert.assertTrue(ruleChainsPage.getRuleChainName().contains(namePath)); } + @Epic("Rule chains smoke tests") + @Feature("Search rule chain") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSearchBySymbolAndNumber") - @Description + @Description("Search rule chain by symbol in the name/Search rule chain by number in the name") public void searchNumber(String name, String namePath) { testRestClient.postRuleChain(defaultRuleChainPrototype(name)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SortByNameTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SortByNameTest.java index 84cd1028e8..3a5f02d61d 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SortByNameTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SortByNameTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -49,8 +51,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { } } + @Epic("Rule chains smoke tests") + @Feature("Sort rule chain by name") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") - @Description + @Description("Sort rule chain 'UP'") public void specialCharacterUp(String ruleChainName) { testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); this.ruleChainName = ruleChainName; @@ -62,8 +66,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainsPage.getRuleChainName(), ruleChainName); } + @Epic("Rule chains smoke tests") + @Feature("Sort rule chain by name") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") - @Description + @Description("Sort rule chain 'UP'") public void allSortUp(String ruleChain, String ruleChainSymbol, String ruleChainNumber) { testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainSymbol)); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChain)); @@ -87,8 +93,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(thirdRuleChain, ruleChain); } + @Epic("Rule chains smoke tests") + @Feature("Sort rule chain by name") @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") - @Description + @Description("Sort rule chain 'DOWN'") public void specialCharacterDown(String ruleChainName) { testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName)); this.ruleChainName = ruleChainName; @@ -100,8 +108,10 @@ public class SortByNameTest extends AbstractDriverBaseTest { Assert.assertEquals(ruleChainsPage.getRuleChainName(), ruleChainName); } + @Epic("Rule chains smoke tests") + @Feature("Sort rule chain by name") @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") - @Description + @Description("Sort rule chain 'DOWN'") public void allSortDown(String ruleChain, String ruleChainSymbol, String ruleChainNumber) { testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainSymbol)); testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChain)); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SortByTimeTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SortByTimeTest.java index 4654654fb5..6c8a912526 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SortByTimeTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/SortByTimeTest.java @@ -16,6 +16,8 @@ package org.thingsboard.server.msa.ui.tests.ruleChainsSmoke; import io.qameta.allure.Description; +import io.qameta.allure.Epic; +import io.qameta.allure.Feature; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -49,8 +51,10 @@ public class SortByTimeTest extends AbstractDriverBaseTest { } } + @Epic("Rule chains smoke tests") + @Feature("Sort rule chain by time") @Test(priority = 10, groups = "smoke") - @Description + @Description("Sort rule chain 'DOWN'") public void sortByTimeDown() { String ruleChain = ENTITY_NAME; testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChain)); @@ -65,8 +69,10 @@ public class SortByTimeTest extends AbstractDriverBaseTest { Assert.assertNotNull(ruleChainsPage.createdTimeEntity(ruleChain, lastCreated)); } + @Epic("Rule chains smoke tests") + @Feature("Sort rule chain by time") @Test(priority = 10, groups = "smoke") - @Description + @Description("Sort rule chain 'UP'") public void sortByTimeUp() { String ruleChain = ENTITY_NAME; testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChain)); diff --git a/pom.xml b/pom.xml index 49f30df835..adc1d9906d 100755 --- a/pom.xml +++ b/pom.xml @@ -67,6 +67,7 @@ 2.13.4 2.13.4.2 1.3.4 + 4.2.1 2.2.6 3.0.0 2.0.0-M5 @@ -826,6 +827,7 @@ **/apache/cassandra/io/** .run/** **/NetworkReceive.java + **/lwm2m-registry/** JAVADOC_STYLE @@ -1429,6 +1431,11 @@ classmate ${fasterxml-classmate.version} + + com.auth0 + java-jwt + ${auth0-jwt.version} + com.github.fge json-schema-validator diff --git a/rest-client/pom.xml b/rest-client/pom.xml index cb85c2134e..1bf93e4dc4 100644 --- a/rest-client/pom.xml +++ b/rest-client/pom.xml @@ -47,6 +47,10 @@ org.thingsboard.common util + + com.auth0 + java-jwt + diff --git a/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java b/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java index c2c0a6d794..8dcdb86eab 100644 --- a/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java +++ b/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java @@ -15,6 +15,7 @@ */ package org.thingsboard.rest.client; +import com.auth0.jwt.JWT; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -28,9 +29,6 @@ import org.springframework.http.HttpRequest; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.http.client.ClientHttpRequestExecution; -import org.springframework.http.client.ClientHttpRequestInterceptor; -import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.client.support.HttpRequestWrapper; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -161,7 +159,6 @@ import org.thingsboard.server.common.data.widget.WidgetTypeInfo; import org.thingsboard.server.common.data.widget.WidgetsBundle; import java.io.Closeable; -import java.io.IOException; import java.net.URI; import java.util.Collections; import java.util.HashMap; @@ -171,6 +168,7 @@ import java.util.Optional; import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import static org.thingsboard.server.common.data.StringUtils.isEmpty; @@ -178,16 +176,24 @@ import static org.thingsboard.server.common.data.StringUtils.isEmpty; /** * @author Andrew Shvayka */ -public class RestClient implements ClientHttpRequestInterceptor, Closeable { +public class RestClient implements Closeable { private static final String JWT_TOKEN_HEADER_PARAM = "X-Authorization"; + private static final long AVG_REQUEST_TIMEOUT = TimeUnit.SECONDS.toMillis(30); + protected static final String ACTIVATE_TOKEN_REGEX = "/api/noauth/activate?activateToken="; + + private final ObjectMapper objectMapper = new ObjectMapper(); + private final ExecutorService service = ThingsBoardExecutors.newWorkStealingPool(10, getClass()); protected final RestTemplate restTemplate; + protected final RestTemplate loginRestTemplate; protected final String baseURL; - private String token; - private String refreshToken; - private final ObjectMapper objectMapper = new ObjectMapper(); - private ExecutorService service = ThingsBoardExecutors.newWorkStealingPool(10, getClass()); - protected static final String ACTIVATE_TOKEN_REGEX = "/api/noauth/activate?activateToken="; + private String username; + private String password; + private String mainToken; + private String refreshToken; + private long mainTokenExpTs; + private long refreshTokenExpTs; + private long clientServerTimeDiff; public RestClient(String baseURL) { this(new RestTemplate(), baseURL); @@ -195,23 +201,25 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { public RestClient(RestTemplate restTemplate, String baseURL) { this.restTemplate = restTemplate; + this.loginRestTemplate = new RestTemplate(restTemplate.getRequestFactory()); this.baseURL = baseURL; - } - - @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] bytes, ClientHttpRequestExecution execution) throws IOException { - HttpRequest wrapper = new HttpRequestWrapper(request); - wrapper.getHeaders().set(JWT_TOKEN_HEADER_PARAM, "Bearer " + token); - ClientHttpResponse response = execution.execute(wrapper, bytes); - if (response.getStatusCode() == HttpStatus.UNAUTHORIZED) { - synchronized (this) { - restTemplate.getInterceptors().remove(this); - refreshToken(); - wrapper.getHeaders().set(JWT_TOKEN_HEADER_PARAM, "Bearer " + token); - return execution.execute(wrapper, bytes); + this.restTemplate.getInterceptors().add((request, bytes, execution) -> { + HttpRequest wrapper = new HttpRequestWrapper(request); + long calculatedTs = System.currentTimeMillis() + clientServerTimeDiff + AVG_REQUEST_TIMEOUT; + if (calculatedTs > mainTokenExpTs) { + synchronized (RestClient.this) { + if (calculatedTs > mainTokenExpTs) { + if (calculatedTs < refreshTokenExpTs) { + refreshToken(); + } else { + doLogin(); + } + } + } } - } - return response; + wrapper.getHeaders().set(JWT_TOKEN_HEADER_PARAM, "Bearer " + mainToken); + return execution.execute(wrapper, bytes); + }); } public RestTemplate getRestTemplate() { @@ -219,7 +227,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { } public String getToken() { - return token; + return mainToken; } public String getRefreshToken() { @@ -229,22 +237,32 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { public void refreshToken() { Map refreshTokenRequest = new HashMap<>(); refreshTokenRequest.put("refreshToken", refreshToken); - ResponseEntity tokenInfo = restTemplate.postForEntity(baseURL + "/api/auth/token", refreshTokenRequest, JsonNode.class); - setTokenInfo(tokenInfo.getBody()); + long ts = System.currentTimeMillis(); + ResponseEntity tokenInfo = loginRestTemplate.postForEntity(baseURL + "/api/auth/token", refreshTokenRequest, JsonNode.class); + setTokenInfo(ts, tokenInfo.getBody()); } public void login(String username, String password) { + this.username = username; + this.password = password; + doLogin(); + } + + private void doLogin() { + long ts = System.currentTimeMillis(); Map loginRequest = new HashMap<>(); loginRequest.put("username", username); loginRequest.put("password", password); - ResponseEntity tokenInfo = restTemplate.postForEntity(baseURL + "/api/auth/login", loginRequest, JsonNode.class); - setTokenInfo(tokenInfo.getBody()); + ResponseEntity tokenInfo = loginRestTemplate.postForEntity(baseURL + "/api/auth/login", loginRequest, JsonNode.class); + setTokenInfo(ts, tokenInfo.getBody()); } - private void setTokenInfo(JsonNode tokenInfo) { - this.token = tokenInfo.get("token").asText(); + private synchronized void setTokenInfo(long ts, JsonNode tokenInfo) { + this.mainToken = tokenInfo.get("token").asText(); this.refreshToken = tokenInfo.get("refreshToken").asText(); - restTemplate.getInterceptors().add(this); + this.mainTokenExpTs = JWT.decode(this.mainToken).getExpiresAtAsInstant().toEpochMilli(); + this.refreshTokenExpTs = JWT.decode(refreshToken).getExpiresAtAsInstant().toEpochMilli(); + this.clientServerTimeDiff = JWT.decode(this.mainToken).getIssuedAtAsInstant().toEpochMilli() - ts; } public Optional getAdminSettings(String key) { @@ -3553,9 +3571,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { @Override public void close() { - if (service != null) { - service.shutdown(); - } + service.shutdown(); } } diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/action/TbLogNode.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/action/TbLogNode.java index 851d285e0e..6c3d80dade 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/action/TbLogNode.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/action/TbLogNode.java @@ -32,6 +32,8 @@ import org.thingsboard.server.common.data.plugin.ComponentType; import org.thingsboard.server.common.data.script.ScriptLanguage; import org.thingsboard.server.common.msg.TbMsg; +import java.util.Objects; + @Slf4j @RuleNode( type = ComponentType.ACTION, @@ -54,8 +56,12 @@ public class TbLogNode implements TbNode { @Override public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException { this.config = TbNodeUtils.convert(configuration, TbLogNodeConfiguration.class); - this.standard = new TbLogNodeConfiguration().defaultConfiguration().getJsScript().equals(config.getJsScript()); - this.scriptEngine = this.standard ? null : ctx.createScriptEngine(config.getScriptLang(), + this.standard = isStandard(config); + this.scriptEngine = this.standard ? null : createScriptEngine(ctx, config); + } + + ScriptEngine createScriptEngine(TbContext ctx, TbLogNodeConfiguration config) { + return ctx.createScriptEngine(config.getScriptLang(), ScriptLanguage.TBEL.equals(config.getScriptLang()) ? config.getTbelScript() : config.getJsScript()); } @@ -83,6 +89,18 @@ public class TbLogNode implements TbNode { }, MoreExecutors.directExecutor()); //usually js responses runs on js callback executor } + boolean isStandard(TbLogNodeConfiguration conf) { + Objects.requireNonNull(conf, "node config is null"); + final TbLogNodeConfiguration defaultConfig = new TbLogNodeConfiguration().defaultConfiguration(); + switch (conf.getScriptLang()) { + case JS: return defaultConfig.getJsScript().equals(conf.getJsScript()); + case TBEL: return defaultConfig.getTbelScript().equals(conf.getTbelScript()); + default: + log.warn("No rule to define isStandard script for script language [{}], assuming that is non-standard", conf.getScriptLang()); + return false; + } + } + void logStandard(TbContext ctx, TbMsg msg) { log.info(toLogMessage(msg)); ctx.tellSuccess(msg); diff --git a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/action/TbLogNodeTest.java b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/action/TbLogNodeTest.java index 0df5921d4d..21e99af819 100644 --- a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/action/TbLogNodeTest.java +++ b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/action/TbLogNodeTest.java @@ -17,14 +17,29 @@ package org.thingsboard.rule.engine.action; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; +import org.thingsboard.common.util.JacksonUtil; +import org.thingsboard.rule.engine.api.TbContext; +import org.thingsboard.rule.engine.api.TbNodeConfiguration; +import org.thingsboard.rule.engine.api.TbNodeException; import org.thingsboard.server.common.data.id.TenantId; +import org.thingsboard.server.common.data.script.ScriptLanguage; import org.thingsboard.server.common.msg.TbMsg; import org.thingsboard.server.common.msg.TbMsgMetaData; import java.util.Collections; import java.util.Map; +import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; @Slf4j public class TbLogNodeTest { @@ -61,6 +76,7 @@ public class TbLogNodeTest { "Incoming metadata:\n" + "{}"); } + @Test void givenNullDataMsg_whenToLog_thenReturnString() { TbLogNode node = new TbLogNode(); @@ -77,4 +93,50 @@ public class TbLogNodeTest { "{}"); } + @ParameterizedTest + @EnumSource(ScriptLanguage.class) + void givenDefaultConfig_whenIsStandardForEachScriptLanguage_thenTrue(ScriptLanguage scriptLanguage) throws TbNodeException { + + TbLogNodeConfiguration config = new TbLogNodeConfiguration().defaultConfiguration(); + config.setScriptLang(scriptLanguage); + TbLogNode node = spy(new TbLogNode()); + TbNodeConfiguration tbNodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config)); + TbContext ctx = mock(TbContext.class); + node.init(ctx, tbNodeConfiguration); + + assertThat(node.isStandard(config)).as("Script is standard for language " + scriptLanguage).isTrue(); + verify(node, never()).createScriptEngine(any(), any()); + verify(ctx, never()).createScriptEngine(any(), anyString()); + + } + + @Test + void givenScriptEngineEnum_whenNewAdded_thenFailed() { + assertThat(ScriptLanguage.values().length).as("only two ScriptLanguage supported").isEqualTo(2); + } + + @Test + void givenScriptEngineLangJs_whenCreateScriptEngine_thenSupplyJsScript(){ + TbLogNodeConfiguration configJs = new TbLogNodeConfiguration().defaultConfiguration(); + configJs.setScriptLang(ScriptLanguage.JS); + configJs.setJsScript(configJs.getJsScript() + " // This is JS script " + UUID.randomUUID()); + TbLogNode node = new TbLogNode(); + TbContext ctx = mock(TbContext.class); + node.createScriptEngine(ctx, configJs); + verify(ctx).createScriptEngine(ScriptLanguage.JS, configJs.getJsScript()); + verifyNoMoreInteractions(ctx); + } + + @Test + void givenScriptEngineLangTbel_whenCreateScriptEngine_thenSupplyTbelScript(){ + TbLogNodeConfiguration configTbel = new TbLogNodeConfiguration().defaultConfiguration(); + configTbel.setScriptLang(ScriptLanguage.TBEL); + configTbel.setTbelScript(configTbel.getTbelScript() + " // This is TBEL script " + UUID.randomUUID()); + TbLogNode node = new TbLogNode(); + TbContext ctx = mock(TbContext.class); + node.createScriptEngine(ctx, configTbel); + verify(ctx).createScriptEngine(ScriptLanguage.TBEL, configTbel.getTbelScript()); + verifyNoMoreInteractions(ctx); + } + } diff --git a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/metadata/TbGetTelemetryNodeTest.java b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/metadata/TbGetTelemetryNodeTest.java index 3d8652a7a0..bd761a084c 100644 --- a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/metadata/TbGetTelemetryNodeTest.java +++ b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/metadata/TbGetTelemetryNodeTest.java @@ -18,6 +18,7 @@ package org.thingsboard.rule.engine.metadata; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Before; import org.junit.Test; +import org.junit.jupiter.api.Assertions; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.rule.engine.api.TbContext; import org.thingsboard.rule.engine.api.TbNodeConfiguration; @@ -70,14 +71,18 @@ public class TbGetTelemetryNodeTest { } } - @Test(expected = IllegalArgumentException.class) + @Test public void givenAggregationWhiteSpace_whenParseAggregation_thenException() { - node.parseAggregationConfig(" "); + Assertions.assertThrows(IllegalArgumentException.class, () -> { + node.parseAggregationConfig(" "); + }); } - @Test(expected = IllegalArgumentException.class) + @Test public void givenAggregationIncorrect_whenParseAggregation_thenException() { - node.parseAggregationConfig("TOP"); + Assertions.assertThrows(IllegalArgumentException.class, () -> { + node.parseAggregationConfig("TOP"); + }); } }