| 120 | } |
| 121 | |
| 122 | static bool handle_message(acl::mqtt_client& conn, acl::mqtt_message& message) { |
| 123 | acl::mqtt_type_t type = message.get_header().get_type(); |
| 124 | switch (type) { |
| 125 | case acl::MQTT_CONNACK: |
| 126 | return handle_connack(conn, message); |
| 127 | case acl::MQTT_PINGREQ: |
| 128 | return handle_pingreq(conn); |
| 129 | case acl::MQTT_PINGRESP: |
| 130 | return handle_pingresp(); |
| 131 | case acl::MQTT_DISCONNECT: |
| 132 | return handle_disconnect(message); |
| 133 | case acl::MQTT_SUBACK: |
| 134 | return handle_suback(conn, message); |
| 135 | case acl::MQTT_PUBLISH: |
| 136 | return handle_publish(conn, message); |
| 137 | default: |
| 138 | printf("unknown type=%d\r\n", (int) type); |
| 139 | return false; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | static void usage(const char* procname) { |
| 144 | printf("usage: %s -h [help] \r\n" |
no test coverage detected
searching dependent graphs…