mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Providing a client ID to the agent
This commit is contained in:
parent
d1b0dac723
commit
239487d30a
@ -112,8 +112,8 @@ public class RaspberryPiServiceImpl implements RaspberryPiService {
|
||||
@QueryParam("from") long from, @QueryParam("to") long to) {
|
||||
String fromDate = String.valueOf(from);
|
||||
String toDate = String.valueOf(to);
|
||||
String query = "deviceId:" + deviceId + " AND deviceType:" +
|
||||
RaspberrypiConstants.DEVICE_TYPE + " AND time : [" + fromDate + " TO " + toDate + "]";
|
||||
String query = "meta_deviceId:" + deviceId + " AND meta_deviceType:" +
|
||||
RaspberrypiConstants.DEVICE_TYPE + " AND meta_time : [" + fromDate + " TO " + toDate + "]";
|
||||
String sensorTableName = RaspberrypiConstants.TEMPERATURE_EVENT_TABLE;
|
||||
try {
|
||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||
|
||||
@ -26,7 +26,7 @@ public class RaspberrypiConstants {
|
||||
|
||||
public static final String BULB_CONTEXT = "BULB";
|
||||
//sensor events summerized table name
|
||||
public static final String TEMPERATURE_EVENT_TABLE = "DEVICE_TEMPERATURE_SUMMARY";
|
||||
public static final String TEMPERATURE_EVENT_TABLE = "IOT_PER_DEVICE_STREAM_RASPBERRYPI_TEMPERATURE";
|
||||
|
||||
//mqtt tranport related constants
|
||||
public static final String MQTT_ADAPTER_TOPIC_PROPERTY_NAME = "mqtt.adapter.topic";
|
||||
|
||||
@ -101,7 +101,7 @@ def main():
|
||||
print ("MQTT_LISTENER: MQTT_TOPIC is " + TOPIC_TO_SUBSCRIBE)
|
||||
|
||||
global mqttClient
|
||||
mqttClient = mqtt.Client()
|
||||
mqttClient = mqtt.Client(client_id="RaspberryPi Agent")
|
||||
mqttClient.on_connect = on_connect
|
||||
mqttClient.on_message = on_message
|
||||
mqttClient.on_publish = on_publish
|
||||
|
||||
Loading…
Reference in New Issue
Block a user