Merge branch 'IoTS-1.0.0-M1' of https://github.com/wso2/carbon-device-mgt-plugins into IoTS-1.0.0-M1

Menaka Madushanka 9 years ago
commit 2f7a480864

@ -85,8 +85,7 @@ public class RaspberryPiService {
/**
* @param raspberryPiMQTTSubscriber
*/
public void setRaspberryPiMQTTSubscriber(
final RaspberryPiMQTTSubscriber raspberryPiMQTTSubscriber) {
public void setRaspberryPiMQTTSubscriber(final RaspberryPiMQTTSubscriber raspberryPiMQTTSubscriber) {
this.raspberryPiMQTTSubscriber = raspberryPiMQTTSubscriber;
/*if (MqttConfig.getInstance().isEnabled()) {
Runnable xmppStarter = new Runnable() {
@ -254,12 +253,9 @@ public class RaspberryPiService {
}
String temperatureValue = RaspberrypiServiceUtils.sendCommandViaHTTP(deviceHTTPEndpoint,
RaspberrypiConstants
.TEMPERATURE_CONTEXT,
false);
RaspberrypiConstants.TEMPERATURE_CONTEXT, false);
SensorDataManager.getInstance().setSensorRecord(deviceId, RaspberrypiConstants.SENSOR_TEMPERATURE,
temperatureValue,
Calendar.getInstance().getTimeInMillis());
temperatureValue, Calendar.getInstance().getTimeInMillis());
sensorRecord = SensorDataManager.getInstance().getSensorRecord(deviceId,
RaspberrypiConstants.SENSOR_TEMPERATURE);
} catch (DeviceManagementException | DeviceControllerException e) {

@ -144,7 +144,10 @@ def configureLogger(loggerName):
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def registerDeviceIP():
ssl.wrap_socket = sslwrap(ssl.wrap_socket) # using the overridden sslwrap that uses TLSv1
if sys.version_info<(2,7,9):
dcConncection = httplib.HTTPSConnection(host=DC_IP, port=DC_PORT)
else:
dcConncection = httplib.HTTPSConnection(host=DC_IP, port=DC_PORT, context=ssl._create_unverified_context())
#TODO need to get server certificate when initializing https connection
dcConncection.set_debuglevel(1)
dcConncection.connect()
@ -172,7 +175,11 @@ def registerDeviceIP():
# This method connects to the Device-Cloud and pushes data
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def connectAndPushData():
if sys.version_info<(2,7,9):
dcConnection = httplib.HTTPSConnection(host=DC_IP, port=DC_PORT)
else:
dcConnection = httplib.HTTPSConnection(host=DC_IP, port=DC_PORT, context=ssl._create_unverified_context())
dcConnection.set_debuglevel(1)
dcConnection.connect()
request = dcConnection.putrequest('POST', PUSH_ENDPOINT)

Loading…
Cancel
Save