USE YHTANG AWS ACCOUNT TO TEST MQTT
Dependents: NuMaker-mbed-AWS-IoT-example
MQTTPubSub.h@0:fe461e4d7afe, 2014-02-20 (annotated)
- Committer:
- sam_grove
- Date:
- Thu Feb 20 22:12:19 2014 +0000
- Revision:
- 0:fe461e4d7afe
Initial draft. Working out an API skeleton
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sam_grove | 0:fe461e4d7afe | 1 | /** |
sam_grove | 0:fe461e4d7afe | 2 | * @file MQTTPubSub.h |
sam_grove | 0:fe461e4d7afe | 3 | * @brief API - for MQTT |
sam_grove | 0:fe461e4d7afe | 4 | * @author |
sam_grove | 0:fe461e4d7afe | 5 | * @version 1.0 |
sam_grove | 0:fe461e4d7afe | 6 | * @see |
sam_grove | 0:fe461e4d7afe | 7 | * |
sam_grove | 0:fe461e4d7afe | 8 | * Copyright (c) 2014 |
sam_grove | 0:fe461e4d7afe | 9 | * |
sam_grove | 0:fe461e4d7afe | 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
sam_grove | 0:fe461e4d7afe | 11 | * you may not use this file except in compliance with the License. |
sam_grove | 0:fe461e4d7afe | 12 | * You may obtain a copy of the License at |
sam_grove | 0:fe461e4d7afe | 13 | * |
sam_grove | 0:fe461e4d7afe | 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
sam_grove | 0:fe461e4d7afe | 15 | * |
sam_grove | 0:fe461e4d7afe | 16 | * Unless required by applicable law or agreed to in writing, software |
sam_grove | 0:fe461e4d7afe | 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
sam_grove | 0:fe461e4d7afe | 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
sam_grove | 0:fe461e4d7afe | 19 | * See the License for the specific language governing permissions and |
sam_grove | 0:fe461e4d7afe | 20 | * limitations under the License. |
sam_grove | 0:fe461e4d7afe | 21 | */ |
sam_grove | 0:fe461e4d7afe | 22 | |
sam_grove | 0:fe461e4d7afe | 23 | #ifndef MQTTPUBSUB_H |
sam_grove | 0:fe461e4d7afe | 24 | #define MQTTPUBSUB_H |
sam_grove | 0:fe461e4d7afe | 25 | |
sam_grove | 0:fe461e4d7afe | 26 | #include "MQTTConnection.h" |
sam_grove | 0:fe461e4d7afe | 27 | |
sam_grove | 0:fe461e4d7afe | 28 | class MQTTTopic |
sam_grove | 0:fe461e4d7afe | 29 | { |
sam_grove | 0:fe461e4d7afe | 30 | MQTTString topic; |
sam_grove | 0:fe461e4d7afe | 31 | char *msg_buffer; |
sam_grove | 0:fe461e4d7afe | 32 | int msg_size; |
sam_grove | 0:fe461e4d7afe | 33 | }; |
sam_grove | 0:fe461e4d7afe | 34 | |
sam_grove | 0:fe461e4d7afe | 35 | class MQTTPubSub : private MQTTConnect |
sam_grove | 0:fe461e4d7afe | 36 | { |
sam_grove | 0:fe461e4d7afe | 37 | private: |
sam_grove | 0:fe461e4d7afe | 38 | MQTTTopic topic; |
sam_grove | 0:fe461e4d7afe | 39 | |
sam_grove | 0:fe461e4d7afe | 40 | public: |
sam_grove | 0:fe461e4d7afe | 41 | enum { |
sam_grove | 0:fe461e4d7afe | 42 | TOPIC_PUBLISH, TOPIC_SUBSCRIBE |
sam_grove | 0:fe461e4d7afe | 43 | }Message; |
sam_grove | 0:fe461e4d7afe | 44 | |
sam_grove | 0:fe461e4d7afe | 45 | MQTTPubSub(){} |
sam_grove | 0:fe461e4d7afe | 46 | |
sam_grove | 0:fe461e4d7afe | 47 | void publish(){} |
sam_grove | 0:fe461e4d7afe | 48 | void subscribe(){} |
sam_grove | 0:fe461e4d7afe | 49 | }; |
sam_grove | 0:fe461e4d7afe | 50 | |
sam_grove | 0:fe461e4d7afe | 51 | #endif |