NuMaker connection with AWS IoT thru MQTT/HTTPS

Dependencies:   MQTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dispatch_host_command.cpp Source File

dispatch_host_command.cpp

00001 /* 
00002  * Copyright (c) 2019 Nuvoton Technology Corporation
00003  *
00004  * SPDX-License-Identifier: Apache-2.0
00005  *
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  *
00010  *     http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 
00019 #include "mbed.h"
00020 
00021 /* Dispatch host command communicating via USB VCOM
00022  *
00023  * WARNING: For mass production, remove this file.
00024  */
00025 
00026 /* Check weak reference/definition at the link:
00027  * http://www.keil.com/support/man/docs/ARMLINK/armlink_pge1362065917715.htm */
00028 
00029 extern "C" {
00030     MBED_USED void dispatch_host_command(int);
00031     MBED_WEAK void print_heap_stats(void);
00032     MBED_WEAK void print_stack_statistics(void);
00033 }
00034 
00035 void dispatch_host_command(int c)
00036 {
00037     switch (c) {
00038         case 'h':
00039             print_heap_stats();
00040             break;
00041                 
00042         case 's':
00043             print_stack_statistics();
00044             break;
00045     }
00046 }