Skip to content

Commit

Permalink
initial AWS IoT Support
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Anson committed May 5, 2016
1 parent e4f2ae2 commit 0b2e329
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ public class AWSIoTMQTTProcessor extends GenericMQTTProcessor implements Transpo

private String m_aws_iot_gw_observe_notification_topic = null;
private String m_aws_iot_gw_coap_cmd_topic_base = null;

private String m_aws_iot_gw_name = null;
private String m_aws_iot_gw_password_template = null;


private HashMap<String,Object> m_aws_iot_gw_endpoints = null;
private HashMap<String,TransportReceiveThread> m_mqtt_thread_list = null;

Expand All @@ -78,13 +75,8 @@ public AWSIoTMQTTProcessor(Orchestrator manager,MQTTTransport mqtt,String suffix

// initialize the listener thread map
this.m_mqtt_thread_list = new HashMap<>();

// get our defaults
this.m_aws_iot_gw_name = this.orchestrator().preferences().valueOf("aws_iot_gw_name",this.m_suffix);
this.m_mqtt_host = this.orchestrator().preferences().valueOf("aws_iot_gw_mqtt_ip_address",this.m_suffix).replace("__IOT_EVENT_HUB__",this.m_aws_iot_gw_name);


// XXX
this.m_aws_iot_gw_name = "";
this.m_mqtt_host = "AKCJTSNETHCZY.iot.us-east-1.amazonaws.com";

// Observation notification topic
Expand All @@ -95,10 +87,7 @@ public AWSIoTMQTTProcessor(Orchestrator manager,MQTTTransport mqtt,String suffix

// AWSIoT Device Manager - will initialize and update our AWSIoT bindings/metadata
this.m_aws_iot_gw_device_manager = new AWSIoTDeviceManager(this.orchestrator().errorLogger(),this.orchestrator().preferences(),this.m_suffix,http,this.orchestrator());

// set the MQTT password template
this.m_aws_iot_gw_password_template = this.orchestrator().preferences().valueOf("aws_iot_gw_mqtt_password",this.m_suffix).replace("__IOT_EVENT_HUB__",this.m_aws_iot_gw_name);


// initialize our MQTT transport list
this.initMQTTTransportList();
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/WEB-INF/classes/gateway.properties
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,6 @@ iot_event_hub_add_device_json={ deviceId:"__EPNAME__",status:"enabled",statusRea
enable_aws_iot_gw_addon=false
aws_iot_policy_name=mbed-connector-bridge-policy
aws_iot_policy_document={\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":[\"iot:*\"],\"Resource\":[\"*\"],\"Effect\":\"Allow\"}]}

aws_iot_gw_observe_notification_topic=devices/__EPNAME__/messages/events/
aws_iot_gw_coap_cmd_topic=devices/__EPNAME__/messages/devicebound/#

0 comments on commit 0b2e329

Please sign in to comment.