2020-09-02 18:32:57 +03:00
|
|
|
///
|
2021-01-11 13:42:16 +02:00
|
|
|
/// Copyright © 2016-2021 The Thingsboard Authors
|
2020-09-02 18:32:57 +03:00
|
|
|
///
|
|
|
|
|
/// 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.
|
|
|
|
|
///
|
|
|
|
|
|
2021-06-02 19:03:31 +03:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
|
import { PageLink } from '@shared/models/page/page-link';
|
|
|
|
|
import { defaultHttpOptionsFromConfig, RequestConfig } from './http-utils';
|
2021-06-11 17:28:54 +03:00
|
|
|
import { Observable, of, throwError } from 'rxjs';
|
2021-06-02 19:03:31 +03:00
|
|
|
import { PageData } from '@shared/models/page/page-data';
|
|
|
|
|
import { DeviceProfile, DeviceProfileInfo, DeviceTransportType } from '@shared/models/device.models';
|
|
|
|
|
import { isDefinedAndNotNull, isEmptyStr } from '@core/utils';
|
|
|
|
|
import { ObjectLwM2M, ServerSecurityConfig } from '@home/components/profile/device/lwm2m/lwm2m-profile-config.models';
|
|
|
|
|
import { SortOrder } from '@shared/models/page/sort-order';
|
|
|
|
|
import { OtaPackageService } from '@core/http/ota-package.service';
|
2021-06-11 17:28:54 +03:00
|
|
|
import { mergeMap, tap } from 'rxjs/operators';
|
2020-09-02 18:32:57 +03:00
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
|
providedIn: 'root'
|
|
|
|
|
})
|
|
|
|
|
export class DeviceProfileService {
|
|
|
|
|
|
2021-06-11 17:28:54 +03:00
|
|
|
private lwm2mBootstrapSecurityInfoInMemoryCache = new Map<boolean, ServerSecurityConfig>();
|
|
|
|
|
|
2020-09-02 18:32:57 +03:00
|
|
|
constructor(
|
2021-06-02 19:03:31 +03:00
|
|
|
private http: HttpClient,
|
2021-06-08 14:41:33 +03:00
|
|
|
private otaPackageService: OtaPackageService
|
2021-01-22 14:46:55 +02:00
|
|
|
) {
|
|
|
|
|
}
|
2020-09-02 18:32:57 +03:00
|
|
|
|
|
|
|
|
public getDeviceProfiles(pageLink: PageLink, config?: RequestConfig): Observable<PageData<DeviceProfile>> {
|
|
|
|
|
return this.http.get<PageData<DeviceProfile>>(`/api/deviceProfiles${pageLink.toQuery()}`, defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getDeviceProfile(deviceProfileId: string, config?: RequestConfig): Observable<DeviceProfile> {
|
|
|
|
|
return this.http.get<DeviceProfile>(`/api/deviceProfile/${deviceProfileId}`, defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-18 20:54:17 +02:00
|
|
|
public getLwm2mObjects(sortOrder: SortOrder, objectIds?: string[], searchText?: string, config?: RequestConfig):
|
2021-01-22 14:46:55 +02:00
|
|
|
Observable<Array<ObjectLwM2M>> {
|
2021-03-18 20:54:17 +02:00
|
|
|
let url = `/api/resource/lwm2m/?sortProperty=${sortOrder.property}&sortOrder=${sortOrder.direction}`;
|
2021-01-25 15:57:09 +02:00
|
|
|
if (isDefinedAndNotNull(objectIds) && objectIds.length > 0) {
|
|
|
|
|
url += `&objectIds=${objectIds}`;
|
2021-01-22 16:14:39 +02:00
|
|
|
}
|
2021-01-25 15:57:09 +02:00
|
|
|
if (isDefinedAndNotNull(searchText) && !isEmptyStr(searchText)) {
|
|
|
|
|
url += `&searchText=${searchText}`;
|
2021-01-22 16:14:39 +02:00
|
|
|
}
|
|
|
|
|
return this.http.get<Array<ObjectLwM2M>>(url, defaultHttpOptionsFromConfig(config));
|
Develop/lwm2m (#3826)
* LwM2M - Start transport
* LwM2M - Test endpoint
* LwM2M - Test endpoint
* LwM2M - Test add xml
* LwM2M device registration
* LwM2M - add get from client, add attributes and telemetry upgrade from registration client
* LwM2M - add get from client, add attributes and telemetry upgrade from registration client
* LwM2M implementation
* LwM2M - add to service telemetry and attribute
* LwM2M add to service attribute and telemetry
* LwM2M - add LWM2M_CREDENTIALS to DeviceCredentialsType
* LwM2M - add LWM2M_CREDENTIALS to DeviceCredentialsType
* LwM2M - add transport.process
* LwM2M - delete from yml tenantid, PSK -ok
* LwM2M - yml del tenantId
* LwM2M - add RPK
* LwM2M - add connect only x509 certificate. Crate certificates in serverKeyStore.jks and clientKeyStore.jks
* LwM2M - add no_sec
* LwM2M - add RPK & PSK integration test with app Client
* LwM2M - add RPK & PSK integration test with app Client
* LwM2M - add read JKS from file
* LwM2M - add read JKS from file
* LwM2M - add bootstrap cert
* LwM2M - add bootstrap RPK
* LwM2M - add bootstrap No_sec
* LwM2M - cleaned the code
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - fix bug CoAP transport
* LwM2M: UI - add Json to credentials
* LwM2M: Back - add command "/3/0/5" - trigger client
* LwM2M: fix bug Json edit dialog
* LwM2M: fix bug Json edit dialog
* lwm2m: fix bug Json edit dialog: add validate
* lwm2m: UI add tabs
* lwm2m: UI add tabs (cleaner)
* lwm2m: add interface SecurityConfigModels
* lwm2m: add interface SecurityConfigModels2
* lwm2m: change html
* lwm2m: UI add bootstrap component
* lwm2m: UI add bootstrap component with FormControl
* lwm2m: UI add start Observe
* lwm2m: UI - correct
* lwm2m: UI - correct
* lwm2m: UI - add Validator: BS RPK, X509
* lwm2m: UI - add Observe
* lwm2m: UI - finish Observe
* lwm2m: UI - fix bug config-service update identity
* lwm2m: Bootstarp&Sewrver All config secure
* lwm2m: Bootstarp&Sewrver All config secure for new Front format
* lwm2m: Bootstarp&Sewrver Different config secure for new Front format
* lwm2m: Add attributes Gui and Backend
* lwm2m: Add attributes Gui and Backend final
* lwm2m: Add telemetrys to Gui
* lwm2m: Add Attribute & telemetry in Gui to instance
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry for mobile
* lwm2m: Model folder
* lwm2m: Ok on AWS: NoSec, PSK, X509
bad registration - RPK
* lwm2m: KeyStore start only one
* lwm2m: Server observe ok
* lwm2m: Server fix bug finish session without remove
* lwm2m: Server add function installValue
* lwm2m: Server add function getAttrTelemetry to tingsboard
* lwm2m: Server add function installValue
* lwm2m: Server add function update Telemetry, Attr from observe
* lwm2m: Server add comments
* lwm2m: Server add session listener
* lwm2m: Server add onGetChangeCredentials with analyze
* lwm2m: Server add onGetChangeCredentials with analyze Onserve add
* lwm2m: Server: updated algorithm for analyzing dynamic changes in attributes / telemetry / observation
* lwm2m: fix bug: "ngx-flowchart" compile
* lwm2m: get value resource OPAQUE - byte [] to HexString
* lwm2m: change path to base
* lwm2m: fix bug COAP & lwm2m
* Lwm2m_3_2: back: cleaner, test bootstrap-ok front: restore
* Lwm2m_3_2: back: del SynchronousRegistrationListener.java
* Lwm2m_3_2: front: start profile lwm2m UI
* Lwm2m_3_2: front&back: add to profile lwm2m (api, getModels...)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (2)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (3)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (4)
* Lwm2m_3_2: front: add update change bootstrapConfig and save to config json
* Lwm2m_3_2: update after merge master
* lwm2m: fix bug proto
* lwm2m: fix bug in yml keyStore.jks
* lwm2m: fix bug tests
* lwm2m: front: add nameThingsboard
* lwm2m: fix bug Autowired lwm2mContext, caseCamel
* lwm2m: back-end^ start api /lwm2m/deviceProfile/bootstrap
* lwm2m: back-end: add method read models from resources
* lwm2m: back-end/front: add and finish api bootstrapConfig
* lwm2m: back-end: add decode profile
* lwm2m: back-end: add new bin in transport api
* lwm2m: add microservice lwm2m and docker lwm2m.
* lwm2m: add microservice lwm2m and docker lwm2m (fix bug)
* lwm2m: front: start fix bug disabled resources
* lwm2m: master to lwm2m merge, front add change attribute, telemetry
* lwm2m: front PR
* lwm2m: front add sort keyName to Json on the start
* lwm2m: front add instances
* lwm2m: front add/del instances FormGrp Value
* lwm2m: Merge remote-tracking branch 'origin/master' into develop/lwm2m
# Conflicts:
# common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java
# common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/SessionMsgListener.java
# ui-ngx/src/app/modules/home/components/home-components.module.ts
* lwm2m: Merge remote-tracking branch 'origin/master' into develop/lwm2m
* lwm2m: Front: del sort after add/del instance
* lwm2m: Front: fix bug reindex FormArray after update
* Lwm2m: Front fix bug add/del instans
* Lwm2m: Front finish1 profile
* Lwm2m: Back add profile to ModelClient
* Lwm2m: Back add form profile sent thingsboard: attr/tel/observe
* Lwm2m: Back -> fix bug: serverKeyStore.jks] Unable to load KeyStore files server
* Lwm2m: Back -> fix bug: onRegistered an unReg
* Lwm2m: Back -> add updateProfiles
* Lwm2m: Back -> add updateDevice and updateProfile dynamic
* Lwm2m: Back -> error if CoapCode not access
* Lwm2m: Front -> clear credential
* Lwm2m: Front -> credential fix bug button "save"
* Lwm2m: Back -> add telemetry logLwm2m
Co-authored-by: nickAS21 <nick@avalr.com.ua>
2020-12-09 17:13:11 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-11 17:28:54 +03:00
|
|
|
public getLwm2mBootstrapSecurityInfo(isBootstrapServer: boolean, config?: RequestConfig): Observable<ServerSecurityConfig> {
|
|
|
|
|
const securityConfig = this.lwm2mBootstrapSecurityInfoInMemoryCache.get(isBootstrapServer);
|
|
|
|
|
if (securityConfig) {
|
|
|
|
|
return of(securityConfig);
|
|
|
|
|
} else {
|
|
|
|
|
return this.http.get<ServerSecurityConfig>(
|
|
|
|
|
`/api/lwm2m/deviceProfile/bootstrap/${isBootstrapServer}`,
|
|
|
|
|
defaultHttpOptionsFromConfig(config)
|
|
|
|
|
).pipe(
|
|
|
|
|
tap(serverConfig => this.lwm2mBootstrapSecurityInfoInMemoryCache.set(isBootstrapServer, serverConfig))
|
|
|
|
|
);
|
|
|
|
|
}
|
Develop/lwm2m (#3826)
* LwM2M - Start transport
* LwM2M - Test endpoint
* LwM2M - Test endpoint
* LwM2M - Test add xml
* LwM2M device registration
* LwM2M - add get from client, add attributes and telemetry upgrade from registration client
* LwM2M - add get from client, add attributes and telemetry upgrade from registration client
* LwM2M implementation
* LwM2M - add to service telemetry and attribute
* LwM2M add to service attribute and telemetry
* LwM2M - add LWM2M_CREDENTIALS to DeviceCredentialsType
* LwM2M - add LWM2M_CREDENTIALS to DeviceCredentialsType
* LwM2M - add transport.process
* LwM2M - delete from yml tenantid, PSK -ok
* LwM2M - yml del tenantId
* LwM2M - add RPK
* LwM2M - add connect only x509 certificate. Crate certificates in serverKeyStore.jks and clientKeyStore.jks
* LwM2M - add no_sec
* LwM2M - add RPK & PSK integration test with app Client
* LwM2M - add RPK & PSK integration test with app Client
* LwM2M - add read JKS from file
* LwM2M - add read JKS from file
* LwM2M - add bootstrap cert
* LwM2M - add bootstrap RPK
* LwM2M - add bootstrap No_sec
* LwM2M - cleaned the code
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - fix bug CoAP transport
* LwM2M: UI - add Json to credentials
* LwM2M: Back - add command "/3/0/5" - trigger client
* LwM2M: fix bug Json edit dialog
* LwM2M: fix bug Json edit dialog
* lwm2m: fix bug Json edit dialog: add validate
* lwm2m: UI add tabs
* lwm2m: UI add tabs (cleaner)
* lwm2m: add interface SecurityConfigModels
* lwm2m: add interface SecurityConfigModels2
* lwm2m: change html
* lwm2m: UI add bootstrap component
* lwm2m: UI add bootstrap component with FormControl
* lwm2m: UI add start Observe
* lwm2m: UI - correct
* lwm2m: UI - correct
* lwm2m: UI - add Validator: BS RPK, X509
* lwm2m: UI - add Observe
* lwm2m: UI - finish Observe
* lwm2m: UI - fix bug config-service update identity
* lwm2m: Bootstarp&Sewrver All config secure
* lwm2m: Bootstarp&Sewrver All config secure for new Front format
* lwm2m: Bootstarp&Sewrver Different config secure for new Front format
* lwm2m: Add attributes Gui and Backend
* lwm2m: Add attributes Gui and Backend final
* lwm2m: Add telemetrys to Gui
* lwm2m: Add Attribute & telemetry in Gui to instance
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry for mobile
* lwm2m: Model folder
* lwm2m: Ok on AWS: NoSec, PSK, X509
bad registration - RPK
* lwm2m: KeyStore start only one
* lwm2m: Server observe ok
* lwm2m: Server fix bug finish session without remove
* lwm2m: Server add function installValue
* lwm2m: Server add function getAttrTelemetry to tingsboard
* lwm2m: Server add function installValue
* lwm2m: Server add function update Telemetry, Attr from observe
* lwm2m: Server add comments
* lwm2m: Server add session listener
* lwm2m: Server add onGetChangeCredentials with analyze
* lwm2m: Server add onGetChangeCredentials with analyze Onserve add
* lwm2m: Server: updated algorithm for analyzing dynamic changes in attributes / telemetry / observation
* lwm2m: fix bug: "ngx-flowchart" compile
* lwm2m: get value resource OPAQUE - byte [] to HexString
* lwm2m: change path to base
* lwm2m: fix bug COAP & lwm2m
* Lwm2m_3_2: back: cleaner, test bootstrap-ok front: restore
* Lwm2m_3_2: back: del SynchronousRegistrationListener.java
* Lwm2m_3_2: front: start profile lwm2m UI
* Lwm2m_3_2: front&back: add to profile lwm2m (api, getModels...)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (2)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (3)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (4)
* Lwm2m_3_2: front: add update change bootstrapConfig and save to config json
* Lwm2m_3_2: update after merge master
* lwm2m: fix bug proto
* lwm2m: fix bug in yml keyStore.jks
* lwm2m: fix bug tests
* lwm2m: front: add nameThingsboard
* lwm2m: fix bug Autowired lwm2mContext, caseCamel
* lwm2m: back-end^ start api /lwm2m/deviceProfile/bootstrap
* lwm2m: back-end: add method read models from resources
* lwm2m: back-end/front: add and finish api bootstrapConfig
* lwm2m: back-end: add decode profile
* lwm2m: back-end: add new bin in transport api
* lwm2m: add microservice lwm2m and docker lwm2m.
* lwm2m: add microservice lwm2m and docker lwm2m (fix bug)
* lwm2m: front: start fix bug disabled resources
* lwm2m: master to lwm2m merge, front add change attribute, telemetry
* lwm2m: front PR
* lwm2m: front add sort keyName to Json on the start
* lwm2m: front add instances
* lwm2m: front add/del instances FormGrp Value
* lwm2m: Merge remote-tracking branch 'origin/master' into develop/lwm2m
# Conflicts:
# common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java
# common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/SessionMsgListener.java
# ui-ngx/src/app/modules/home/components/home-components.module.ts
* lwm2m: Merge remote-tracking branch 'origin/master' into develop/lwm2m
* lwm2m: Front: del sort after add/del instance
* lwm2m: Front: fix bug reindex FormArray after update
* Lwm2m: Front fix bug add/del instans
* Lwm2m: Front finish1 profile
* Lwm2m: Back add profile to ModelClient
* Lwm2m: Back add form profile sent thingsboard: attr/tel/observe
* Lwm2m: Back -> fix bug: serverKeyStore.jks] Unable to load KeyStore files server
* Lwm2m: Back -> fix bug: onRegistered an unReg
* Lwm2m: Back -> add updateProfiles
* Lwm2m: Back -> add updateDevice and updateProfile dynamic
* Lwm2m: Back -> error if CoapCode not access
* Lwm2m: Front -> clear credential
* Lwm2m: Front -> credential fix bug button "save"
* Lwm2m: Back -> add telemetry logLwm2m
Co-authored-by: nickAS21 <nick@avalr.com.ua>
2020-12-09 17:13:11 +02:00
|
|
|
}
|
|
|
|
|
|
2021-03-18 20:54:17 +02:00
|
|
|
public getLwm2mObjectsPage(pageLink: PageLink, config?: RequestConfig): Observable<Array<ObjectLwM2M>> {
|
|
|
|
|
return this.http.get<Array<ObjectLwM2M>>(
|
|
|
|
|
`/api/resource/lwm2m/page${pageLink.toQuery()}`,
|
2021-01-15 13:06:39 +02:00
|
|
|
defaultHttpOptionsFromConfig(config)
|
|
|
|
|
);
|
Develop/lwm2m (#3826)
* LwM2M - Start transport
* LwM2M - Test endpoint
* LwM2M - Test endpoint
* LwM2M - Test add xml
* LwM2M device registration
* LwM2M - add get from client, add attributes and telemetry upgrade from registration client
* LwM2M - add get from client, add attributes and telemetry upgrade from registration client
* LwM2M implementation
* LwM2M - add to service telemetry and attribute
* LwM2M add to service attribute and telemetry
* LwM2M - add LWM2M_CREDENTIALS to DeviceCredentialsType
* LwM2M - add LWM2M_CREDENTIALS to DeviceCredentialsType
* LwM2M - add transport.process
* LwM2M - delete from yml tenantid, PSK -ok
* LwM2M - yml del tenantId
* LwM2M - add RPK
* LwM2M - add connect only x509 certificate. Crate certificates in serverKeyStore.jks and clientKeyStore.jks
* LwM2M - add no_sec
* LwM2M - add RPK & PSK integration test with app Client
* LwM2M - add RPK & PSK integration test with app Client
* LwM2M - add read JKS from file
* LwM2M - add read JKS from file
* LwM2M - add bootstrap cert
* LwM2M - add bootstrap RPK
* LwM2M - add bootstrap No_sec
* LwM2M - cleaned the code
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - add to 3.0 in UI credentials lwm2m
* LwM2M - fix bug CoAP transport
* LwM2M: UI - add Json to credentials
* LwM2M: Back - add command "/3/0/5" - trigger client
* LwM2M: fix bug Json edit dialog
* LwM2M: fix bug Json edit dialog
* lwm2m: fix bug Json edit dialog: add validate
* lwm2m: UI add tabs
* lwm2m: UI add tabs (cleaner)
* lwm2m: add interface SecurityConfigModels
* lwm2m: add interface SecurityConfigModels2
* lwm2m: change html
* lwm2m: UI add bootstrap component
* lwm2m: UI add bootstrap component with FormControl
* lwm2m: UI add start Observe
* lwm2m: UI - correct
* lwm2m: UI - correct
* lwm2m: UI - add Validator: BS RPK, X509
* lwm2m: UI - add Observe
* lwm2m: UI - finish Observe
* lwm2m: UI - fix bug config-service update identity
* lwm2m: Bootstarp&Sewrver All config secure
* lwm2m: Bootstarp&Sewrver All config secure for new Front format
* lwm2m: Bootstarp&Sewrver Different config secure for new Front format
* lwm2m: Add attributes Gui and Backend
* lwm2m: Add attributes Gui and Backend final
* lwm2m: Add telemetrys to Gui
* lwm2m: Add Attribute & telemetry in Gui to instance
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry
* lwm2m: Optimize Attr/Telemetry for mobile
* lwm2m: Model folder
* lwm2m: Ok on AWS: NoSec, PSK, X509
bad registration - RPK
* lwm2m: KeyStore start only one
* lwm2m: Server observe ok
* lwm2m: Server fix bug finish session without remove
* lwm2m: Server add function installValue
* lwm2m: Server add function getAttrTelemetry to tingsboard
* lwm2m: Server add function installValue
* lwm2m: Server add function update Telemetry, Attr from observe
* lwm2m: Server add comments
* lwm2m: Server add session listener
* lwm2m: Server add onGetChangeCredentials with analyze
* lwm2m: Server add onGetChangeCredentials with analyze Onserve add
* lwm2m: Server: updated algorithm for analyzing dynamic changes in attributes / telemetry / observation
* lwm2m: fix bug: "ngx-flowchart" compile
* lwm2m: get value resource OPAQUE - byte [] to HexString
* lwm2m: change path to base
* lwm2m: fix bug COAP & lwm2m
* Lwm2m_3_2: back: cleaner, test bootstrap-ok front: restore
* Lwm2m_3_2: back: del SynchronousRegistrationListener.java
* Lwm2m_3_2: front: start profile lwm2m UI
* Lwm2m_3_2: front&back: add to profile lwm2m (api, getModels...)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (2)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (3)
* Lwm2m_3_2: back: fix bug from commented front: add update change observe/attribute/telemetry to config json (4)
* Lwm2m_3_2: front: add update change bootstrapConfig and save to config json
* Lwm2m_3_2: update after merge master
* lwm2m: fix bug proto
* lwm2m: fix bug in yml keyStore.jks
* lwm2m: fix bug tests
* lwm2m: front: add nameThingsboard
* lwm2m: fix bug Autowired lwm2mContext, caseCamel
* lwm2m: back-end^ start api /lwm2m/deviceProfile/bootstrap
* lwm2m: back-end: add method read models from resources
* lwm2m: back-end/front: add and finish api bootstrapConfig
* lwm2m: back-end: add decode profile
* lwm2m: back-end: add new bin in transport api
* lwm2m: add microservice lwm2m and docker lwm2m.
* lwm2m: add microservice lwm2m and docker lwm2m (fix bug)
* lwm2m: front: start fix bug disabled resources
* lwm2m: master to lwm2m merge, front add change attribute, telemetry
* lwm2m: front PR
* lwm2m: front add sort keyName to Json on the start
* lwm2m: front add instances
* lwm2m: front add/del instances FormGrp Value
* lwm2m: Merge remote-tracking branch 'origin/master' into develop/lwm2m
# Conflicts:
# common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java
# common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/SessionMsgListener.java
# ui-ngx/src/app/modules/home/components/home-components.module.ts
* lwm2m: Merge remote-tracking branch 'origin/master' into develop/lwm2m
* lwm2m: Front: del sort after add/del instance
* lwm2m: Front: fix bug reindex FormArray after update
* Lwm2m: Front fix bug add/del instans
* Lwm2m: Front finish1 profile
* Lwm2m: Back add profile to ModelClient
* Lwm2m: Back add form profile sent thingsboard: attr/tel/observe
* Lwm2m: Back -> fix bug: serverKeyStore.jks] Unable to load KeyStore files server
* Lwm2m: Back -> fix bug: onRegistered an unReg
* Lwm2m: Back -> add updateProfiles
* Lwm2m: Back -> add updateDevice and updateProfile dynamic
* Lwm2m: Back -> error if CoapCode not access
* Lwm2m: Front -> clear credential
* Lwm2m: Front -> credential fix bug button "save"
* Lwm2m: Back -> add telemetry logLwm2m
Co-authored-by: nickAS21 <nick@avalr.com.ua>
2020-12-09 17:13:11 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-02 19:03:31 +03:00
|
|
|
public saveDeviceProfileAndConfirmOtaChange(originDeviceProfile: DeviceProfile, deviceProfile: DeviceProfile,
|
|
|
|
|
config?: RequestConfig): Observable<DeviceProfile> {
|
2021-06-08 14:41:33 +03:00
|
|
|
return this.otaPackageService.confirmDialogUpdatePackage(deviceProfile, originDeviceProfile).pipe(
|
|
|
|
|
mergeMap((update) => update ? this.saveDeviceProfile(deviceProfile, config) : throwError('Canceled saving device profiles'))
|
|
|
|
|
);
|
2021-06-02 19:03:31 +03:00
|
|
|
}
|
|
|
|
|
|
2020-09-02 18:32:57 +03:00
|
|
|
public saveDeviceProfile(deviceProfile: DeviceProfile, config?: RequestConfig): Observable<DeviceProfile> {
|
|
|
|
|
return this.http.post<DeviceProfile>('/api/deviceProfile', deviceProfile, defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public deleteDeviceProfile(deviceProfileId: string, config?: RequestConfig) {
|
|
|
|
|
return this.http.delete(`/api/deviceProfile/${deviceProfileId}`, defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public setDefaultDeviceProfile(deviceProfileId: string, config?: RequestConfig): Observable<DeviceProfile> {
|
|
|
|
|
return this.http.post<DeviceProfile>(`/api/deviceProfile/${deviceProfileId}/default`, defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getDefaultDeviceProfileInfo(config?: RequestConfig): Observable<DeviceProfileInfo> {
|
|
|
|
|
return this.http.get<DeviceProfileInfo>('/api/deviceProfileInfo/default', defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getDeviceProfileInfo(deviceProfileId: string, config?: RequestConfig): Observable<DeviceProfileInfo> {
|
|
|
|
|
return this.http.get<DeviceProfileInfo>(`/api/deviceProfileInfo/${deviceProfileId}`, defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-29 15:47:17 +03:00
|
|
|
public getDeviceProfileInfos(pageLink: PageLink, transportType?: DeviceTransportType,
|
|
|
|
|
config?: RequestConfig): Observable<PageData<DeviceProfileInfo>> {
|
|
|
|
|
let url = `/api/deviceProfileInfos${pageLink.toQuery()}`;
|
|
|
|
|
if (isDefinedAndNotNull(transportType)) {
|
|
|
|
|
url += `&transportType=${transportType}`;
|
|
|
|
|
}
|
|
|
|
|
return this.http.get<PageData<DeviceProfileInfo>>(url, defaultHttpOptionsFromConfig(config));
|
2020-09-02 18:32:57 +03:00
|
|
|
}
|
|
|
|
|
|
2020-12-08 18:01:17 +02:00
|
|
|
public getDeviceProfileDevicesAttributesKeys(deviceProfileId?: string, config?: RequestConfig): Observable<Array<string>> {
|
|
|
|
|
let url = `/api/deviceProfile/devices/keys/attributes`;
|
|
|
|
|
if (isDefinedAndNotNull(deviceProfileId)) {
|
|
|
|
|
url += `?deviceProfileId=${deviceProfileId}`;
|
|
|
|
|
}
|
|
|
|
|
return this.http.get<Array<string>>(url, defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getDeviceProfileDevicesTimeseriesKeys(deviceProfileId?: string, config?: RequestConfig): Observable<Array<string>> {
|
|
|
|
|
let url = `/api/deviceProfile/devices/keys/timeseries`;
|
|
|
|
|
if (isDefinedAndNotNull(deviceProfileId)) {
|
|
|
|
|
url += `?deviceProfileId=${deviceProfileId}`;
|
|
|
|
|
}
|
|
|
|
|
return this.http.get<Array<string>>(url, defaultHttpOptionsFromConfig(config));
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-02 18:32:57 +03:00
|
|
|
}
|