Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
src/CommandParser/cmd.cpp@11:0695c1091129, 2016-09-07 (annotated)
- Committer:
- jmarkel44
- Date:
- Wed Sep 07 12:06:02 2016 +0000
- Revision:
- 11:0695c1091129
- Parent:
- 5:5e77a1db4d45
basic timer & setpoint controls (via classes) operating;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmarkel44 | 0:65cfa4873284 | 1 | /* |
jmarkel44 | 0:65cfa4873284 | 2 | * =============================================================== |
jmarkel44 | 0:65cfa4873284 | 3 | * Natural Tiny Shell (NT-Shell) Application example. |
jmarkel44 | 0:65cfa4873284 | 4 | * Version 0.0.6 |
jmarkel44 | 0:65cfa4873284 | 5 | * =============================================================== |
jmarkel44 | 0:65cfa4873284 | 6 | * Copyright (c) 2010-2011 Shinichiro Nakamura |
jmarkel44 | 0:65cfa4873284 | 7 | * |
jmarkel44 | 0:65cfa4873284 | 8 | * Permission is hereby granted, free of charge, to any person |
jmarkel44 | 0:65cfa4873284 | 9 | * obtaining a copy of this software and associated documentation |
jmarkel44 | 0:65cfa4873284 | 10 | * files (the "Software"), to deal in the Software without |
jmarkel44 | 0:65cfa4873284 | 11 | * restriction, including without limitation the rights to use, |
jmarkel44 | 0:65cfa4873284 | 12 | * copy, modify, merge, publish, distribute, sublicense, and/or |
jmarkel44 | 0:65cfa4873284 | 13 | * sell copies of the Software, and to permit persons to whom the |
jmarkel44 | 0:65cfa4873284 | 14 | * Software is furnished to do so, subject to the following |
jmarkel44 | 0:65cfa4873284 | 15 | * conditions: |
jmarkel44 | 0:65cfa4873284 | 16 | * |
jmarkel44 | 0:65cfa4873284 | 17 | * The above copyright notice and this permission notice shall be |
jmarkel44 | 0:65cfa4873284 | 18 | * included in all copies or substantial portions of the Software. |
jmarkel44 | 0:65cfa4873284 | 19 | * |
jmarkel44 | 0:65cfa4873284 | 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
jmarkel44 | 0:65cfa4873284 | 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
jmarkel44 | 0:65cfa4873284 | 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
jmarkel44 | 0:65cfa4873284 | 23 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
jmarkel44 | 0:65cfa4873284 | 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
jmarkel44 | 0:65cfa4873284 | 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
jmarkel44 | 0:65cfa4873284 | 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
jmarkel44 | 0:65cfa4873284 | 27 | * OTHER DEALINGS IN THE SOFTWARE. |
jmarkel44 | 0:65cfa4873284 | 28 | * =============================================================== |
jmarkel44 | 0:65cfa4873284 | 29 | */ |
jmarkel44 | 0:65cfa4873284 | 30 | |
jmarkel44 | 0:65cfa4873284 | 31 | #include "cmd.h" |
jmarkel44 | 0:65cfa4873284 | 32 | #include <mbed.h> |
jmarkel44 | 0:65cfa4873284 | 33 | #include "ntshell.h" |
jmarkel44 | 0:65cfa4873284 | 34 | #include "ntopt.h" |
jmarkel44 | 0:65cfa4873284 | 35 | #include "global.h" |
jmarkel44 | 0:65cfa4873284 | 36 | #include "ConfigurationHandler.h" |
jmarkel44 | 3:8ea4db957749 | 37 | #include "mDot.h" |
jmarkel44 | 0:65cfa4873284 | 38 | |
jmarkel44 | 0:65cfa4873284 | 39 | Serial serial(USBTX, USBRX); |
jmarkel44 | 0:65cfa4873284 | 40 | ntshell_t ntshell; |
jmarkel44 | 0:65cfa4873284 | 41 | |
jmarkel44 | 0:65cfa4873284 | 42 | typedef struct { |
jmarkel44 | 0:65cfa4873284 | 43 | char *command; // command (from shell) |
jmarkel44 | 0:65cfa4873284 | 44 | char *description; // descrption |
jmarkel44 | 0:65cfa4873284 | 45 | void (*func)(int argc, char **argv); // callback function |
jmarkel44 | 0:65cfa4873284 | 46 | } command_table_t; |
jmarkel44 | 0:65cfa4873284 | 47 | |
jmarkel44 | 0:65cfa4873284 | 48 | // see cmd.h |
jmarkel44 | 0:65cfa4873284 | 49 | const command_table_t cmdlist[] = { |
jmarkel44 | 0:65cfa4873284 | 50 | {"?", "help command", cmd_help }, |
jmarkel44 | 0:65cfa4873284 | 51 | {"create", "create a control", cmd_create }, |
jmarkel44 | 0:65cfa4873284 | 52 | {"destroy", "destroy a control", cmd_destroy }, |
jmarkel44 | 0:65cfa4873284 | 53 | {"heap", "show heap statistics", cmd_heap }, |
jmarkel44 | 0:65cfa4873284 | 54 | {"help", "help command", cmd_help }, |
jmarkel44 | 0:65cfa4873284 | 55 | {"modify", "modify a control", cmd_modify }, |
jmarkel44 | 0:65cfa4873284 | 56 | {"reset", "reset the controller", cmd_reset }, |
jmarkel44 | 0:65cfa4873284 | 57 | {"showControls", "display active controls", cmd_ShowControls }, |
jmarkel44 | 0:65cfa4873284 | 58 | {"stress", "test utility to stress control creation/deletion", cmd_stress }, |
jmarkel44 | 0:65cfa4873284 | 59 | {NULL, NULL, NULL} |
jmarkel44 | 0:65cfa4873284 | 60 | }; |
jmarkel44 | 0:65cfa4873284 | 61 | |
jmarkel44 | 0:65cfa4873284 | 62 | int func_read(char *buf, int cnt); |
jmarkel44 | 0:65cfa4873284 | 63 | int func_write(const char *buf, int cnt); |
jmarkel44 | 0:65cfa4873284 | 64 | int func_cb_ntshell(const char *text); |
jmarkel44 | 0:65cfa4873284 | 65 | void func_cb_ntopt(int argc, char **argv); |
jmarkel44 | 0:65cfa4873284 | 66 | |
jmarkel44 | 0:65cfa4873284 | 67 | // stress test private functions |
jmarkel44 | 0:65cfa4873284 | 68 | static void create ( const char *controlFile, Control_t controlType ); |
jmarkel44 | 0:65cfa4873284 | 69 | static void destroy ( const char *controlFile ); |
jmarkel44 | 0:65cfa4873284 | 70 | |
jmarkel44 | 0:65cfa4873284 | 71 | /** |
jmarkel44 | 0:65cfa4873284 | 72 | * Serial read function. |
jmarkel44 | 0:65cfa4873284 | 73 | */ |
jmarkel44 | 0:65cfa4873284 | 74 | int func_read(char *buf, int cnt) |
jmarkel44 | 0:65cfa4873284 | 75 | { |
jmarkel44 | 0:65cfa4873284 | 76 | for (int i = 0; i < cnt; i++) { |
jmarkel44 | 0:65cfa4873284 | 77 | buf[i] = serial.getc(); |
jmarkel44 | 0:65cfa4873284 | 78 | } |
jmarkel44 | 0:65cfa4873284 | 79 | return 0; |
jmarkel44 | 0:65cfa4873284 | 80 | } |
jmarkel44 | 0:65cfa4873284 | 81 | |
jmarkel44 | 0:65cfa4873284 | 82 | /** |
jmarkel44 | 0:65cfa4873284 | 83 | * Serial write function. |
jmarkel44 | 0:65cfa4873284 | 84 | */ |
jmarkel44 | 0:65cfa4873284 | 85 | int func_write(const char *buf, int cnt) |
jmarkel44 | 0:65cfa4873284 | 86 | { |
jmarkel44 | 0:65cfa4873284 | 87 | for (int i = 0; i < cnt; i++) { |
jmarkel44 | 0:65cfa4873284 | 88 | serial.putc(buf[i]); |
jmarkel44 | 0:65cfa4873284 | 89 | } |
jmarkel44 | 0:65cfa4873284 | 90 | return 0; |
jmarkel44 | 0:65cfa4873284 | 91 | } |
jmarkel44 | 0:65cfa4873284 | 92 | |
jmarkel44 | 0:65cfa4873284 | 93 | /** |
jmarkel44 | 0:65cfa4873284 | 94 | * Callback function for ntshell module. |
jmarkel44 | 0:65cfa4873284 | 95 | */ |
jmarkel44 | 0:65cfa4873284 | 96 | int func_cb_ntshell(const char *text) |
jmarkel44 | 0:65cfa4873284 | 97 | { |
jmarkel44 | 0:65cfa4873284 | 98 | return ntopt_parse(text, func_cb_ntopt); |
jmarkel44 | 0:65cfa4873284 | 99 | } |
jmarkel44 | 0:65cfa4873284 | 100 | |
jmarkel44 | 0:65cfa4873284 | 101 | /** |
jmarkel44 | 0:65cfa4873284 | 102 | * Callback function for ntopt module. |
jmarkel44 | 0:65cfa4873284 | 103 | */ |
jmarkel44 | 0:65cfa4873284 | 104 | void func_cb_ntopt(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 105 | { |
jmarkel44 | 0:65cfa4873284 | 106 | if (argc == 0) { |
jmarkel44 | 0:65cfa4873284 | 107 | return; |
jmarkel44 | 0:65cfa4873284 | 108 | } |
jmarkel44 | 0:65cfa4873284 | 109 | int execnt = 0; |
jmarkel44 | 0:65cfa4873284 | 110 | const command_table_t *p = &cmdlist[0]; |
jmarkel44 | 0:65cfa4873284 | 111 | while (p->command != NULL) { |
jmarkel44 | 0:65cfa4873284 | 112 | if (strcmp(argv[0], p->command) == 0) { |
jmarkel44 | 0:65cfa4873284 | 113 | p->func(argc, argv); |
jmarkel44 | 0:65cfa4873284 | 114 | execnt++; |
jmarkel44 | 0:65cfa4873284 | 115 | } |
jmarkel44 | 0:65cfa4873284 | 116 | p++; |
jmarkel44 | 0:65cfa4873284 | 117 | } |
jmarkel44 | 0:65cfa4873284 | 118 | if (execnt == 0) { |
jmarkel44 | 0:65cfa4873284 | 119 | printf("Command not found.\r\n"); |
jmarkel44 | 0:65cfa4873284 | 120 | } |
jmarkel44 | 0:65cfa4873284 | 121 | wait_ms(250); |
jmarkel44 | 0:65cfa4873284 | 122 | } |
jmarkel44 | 0:65cfa4873284 | 123 | |
jmarkel44 | 0:65cfa4873284 | 124 | /************************* callback functions *******************************/ |
jmarkel44 | 0:65cfa4873284 | 125 | void cmd_help(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 126 | { |
jmarkel44 | 0:65cfa4873284 | 127 | UNUSED(argc); |
jmarkel44 | 0:65cfa4873284 | 128 | UNUSED(argv); |
jmarkel44 | 0:65cfa4873284 | 129 | |
jmarkel44 | 0:65cfa4873284 | 130 | const command_table_t *tblPtr = cmdlist; |
jmarkel44 | 0:65cfa4873284 | 131 | |
jmarkel44 | 0:65cfa4873284 | 132 | while (tblPtr->command) { |
jmarkel44 | 0:65cfa4873284 | 133 | printf("\r%-32s:\t%s\n", tblPtr->command, tblPtr->description); |
jmarkel44 | 0:65cfa4873284 | 134 | tblPtr++; |
jmarkel44 | 0:65cfa4873284 | 135 | } |
jmarkel44 | 0:65cfa4873284 | 136 | printf("\r\n"); |
jmarkel44 | 0:65cfa4873284 | 137 | } |
jmarkel44 | 0:65cfa4873284 | 138 | |
jmarkel44 | 0:65cfa4873284 | 139 | |
jmarkel44 | 0:65cfa4873284 | 140 | void cmd_ShowControls(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 141 | { |
jmarkel44 | 0:65cfa4873284 | 142 | UNUSED(argc); |
jmarkel44 | 0:65cfa4873284 | 143 | UNUSED(argv); |
jmarkel44 | 11:0695c1091129 | 144 | DisplayControlLists(); |
jmarkel44 | 0:65cfa4873284 | 145 | } |
jmarkel44 | 0:65cfa4873284 | 146 | |
jmarkel44 | 0:65cfa4873284 | 147 | void cmd_reset(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 148 | { |
jmarkel44 | 0:65cfa4873284 | 149 | UNUSED(argc); |
jmarkel44 | 0:65cfa4873284 | 150 | UNUSED(argv); |
jmarkel44 | 0:65cfa4873284 | 151 | NVIC_SystemReset(); |
jmarkel44 | 0:65cfa4873284 | 152 | } |
jmarkel44 | 0:65cfa4873284 | 153 | |
jmarkel44 | 0:65cfa4873284 | 154 | void cmd_create(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 155 | { |
jmarkel44 | 0:65cfa4873284 | 156 | if ( argc != 3 ) { |
jmarkel44 | 0:65cfa4873284 | 157 | printf("\r\nusage: create [controlName] [controlType]\n"); |
jmarkel44 | 0:65cfa4873284 | 158 | printf("\rcontrolType-> 0=timer, 1=PID, 2=setpoint, 3=composite, 4=manual\n"); |
jmarkel44 | 0:65cfa4873284 | 159 | return; |
jmarkel44 | 0:65cfa4873284 | 160 | } |
jmarkel44 | 0:65cfa4873284 | 161 | // send a message to the configuration handler to create the control |
jmarkel44 | 0:65cfa4873284 | 162 | Message_t *msg = MailBox.alloc(); |
jmarkel44 | 0:65cfa4873284 | 163 | memset(msg, 0, sizeof(Message_t)); |
jmarkel44 | 0:65cfa4873284 | 164 | msg->action = ACTION_CREATE; |
jmarkel44 | 0:65cfa4873284 | 165 | msg->control = (Control_t) atoi(argv[2]); |
jmarkel44 | 0:65cfa4873284 | 166 | strncpy(msg->controlFile, argv[1], sizeof(msg->controlFile)-1); |
jmarkel44 | 0:65cfa4873284 | 167 | |
jmarkel44 | 0:65cfa4873284 | 168 | printf("%s: Sending a create request for control %s type = %u\r\n", |
jmarkel44 | 0:65cfa4873284 | 169 | __func__, msg->controlFile, msg->control); |
jmarkel44 | 0:65cfa4873284 | 170 | |
jmarkel44 | 0:65cfa4873284 | 171 | MailBox.put(msg); |
jmarkel44 | 0:65cfa4873284 | 172 | return; |
jmarkel44 | 0:65cfa4873284 | 173 | } |
jmarkel44 | 0:65cfa4873284 | 174 | |
jmarkel44 | 0:65cfa4873284 | 175 | void cmd_destroy(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 176 | { |
jmarkel44 | 11:0695c1091129 | 177 | if ( argc != 3 ) { |
jmarkel44 | 0:65cfa4873284 | 178 | printf("\r\nusage: destroy [threadName]\r\n"); |
jmarkel44 | 0:65cfa4873284 | 179 | return; |
jmarkel44 | 0:65cfa4873284 | 180 | } |
jmarkel44 | 0:65cfa4873284 | 181 | |
jmarkel44 | 0:65cfa4873284 | 182 | // send a message to the configuration handler to destroy the control |
jmarkel44 | 0:65cfa4873284 | 183 | Message_t *msg = MailBox.alloc(); |
jmarkel44 | 0:65cfa4873284 | 184 | memset(msg, 0, sizeof(Message_t)); |
jmarkel44 | 0:65cfa4873284 | 185 | msg->action = ACTION_DESTROY; |
jmarkel44 | 0:65cfa4873284 | 186 | strncpy(msg->controlFile, argv[1], sizeof(msg->controlFile)-1); |
jmarkel44 | 0:65cfa4873284 | 187 | |
jmarkel44 | 0:65cfa4873284 | 188 | printf("%s: Sending a destroy request for control %s\r\n", |
jmarkel44 | 0:65cfa4873284 | 189 | __func__, msg->controlFile); |
jmarkel44 | 0:65cfa4873284 | 190 | |
jmarkel44 | 0:65cfa4873284 | 191 | MailBox.put(msg); |
jmarkel44 | 0:65cfa4873284 | 192 | return; |
jmarkel44 | 0:65cfa4873284 | 193 | } |
jmarkel44 | 0:65cfa4873284 | 194 | |
jmarkel44 | 0:65cfa4873284 | 195 | void cmd_heap(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 196 | { |
jmarkel44 | 0:65cfa4873284 | 197 | UNUSED(argc), UNUSED(argv); |
jmarkel44 | 0:65cfa4873284 | 198 | __heapstats((__heapprt)fprintf,stderr); // print initial free heap size |
jmarkel44 | 0:65cfa4873284 | 199 | } |
jmarkel44 | 0:65cfa4873284 | 200 | |
jmarkel44 | 0:65cfa4873284 | 201 | void cmd_modify(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 202 | { |
jmarkel44 | 0:65cfa4873284 | 203 | // stubbed |
jmarkel44 | 3:8ea4db957749 | 204 | printf("\rNot yet implemented.\n"); |
jmarkel44 | 0:65cfa4873284 | 205 | return; |
jmarkel44 | 0:65cfa4873284 | 206 | } |
jmarkel44 | 0:65cfa4873284 | 207 | |
jmarkel44 | 0:65cfa4873284 | 208 | |
jmarkel44 | 0:65cfa4873284 | 209 | void cmd_stress(int argc, char **argv) |
jmarkel44 | 0:65cfa4873284 | 210 | { |
jmarkel44 | 0:65cfa4873284 | 211 | UNUSED(argc), UNUSED(argv); |
jmarkel44 | 0:65cfa4873284 | 212 | static int counter = 0; |
jmarkel44 | 0:65cfa4873284 | 213 | const unsigned int delay = 1.0; |
jmarkel44 | 3:8ea4db957749 | 214 | |
jmarkel44 | 2:da28f21b72a1 | 215 | cmd_heap(0, 0); |
jmarkel44 | 0:65cfa4873284 | 216 | |
jmarkel44 | 0:65cfa4873284 | 217 | // let's just run forever to see what happens |
jmarkel44 | 2:da28f21b72a1 | 218 | while ( ++ counter < 100 ) { |
jmarkel44 | 0:65cfa4873284 | 219 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 220 | create("TimerControl00.json", CONTROL_TIMER); |
jmarkel44 | 0:65cfa4873284 | 221 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 222 | create("PIDControl00.json", CONTROL_PID); |
jmarkel44 | 0:65cfa4873284 | 223 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 224 | create("SetpointControl00.json", CONTROL_SETPOINT); |
jmarkel44 | 0:65cfa4873284 | 225 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 226 | create("CompositeControl00.json", CONTROL_COMPOSITE); |
jmarkel44 | 0:65cfa4873284 | 227 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 228 | create("ManualControl00.json", CONTROL_MANUAL); |
jmarkel44 | 0:65cfa4873284 | 229 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 230 | |
jmarkel44 | 0:65cfa4873284 | 231 | cmd_heap(0, 0); |
jmarkel44 | 0:65cfa4873284 | 232 | |
jmarkel44 | 0:65cfa4873284 | 233 | wait(2.5); |
jmarkel44 | 0:65cfa4873284 | 234 | |
jmarkel44 | 0:65cfa4873284 | 235 | // now delete everything |
jmarkel44 | 0:65cfa4873284 | 236 | destroy("TimerControl00.json"); |
jmarkel44 | 0:65cfa4873284 | 237 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 238 | destroy("PIDControl00.json"); |
jmarkel44 | 0:65cfa4873284 | 239 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 240 | destroy("SetpointControl00.json"); |
jmarkel44 | 0:65cfa4873284 | 241 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 242 | destroy("CompositeControl00.json"); |
jmarkel44 | 0:65cfa4873284 | 243 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 244 | destroy("ManualControl00.json"); |
jmarkel44 | 0:65cfa4873284 | 245 | wait(delay); |
jmarkel44 | 0:65cfa4873284 | 246 | printf("\rInterval => %u\n", ++counter); |
jmarkel44 | 0:65cfa4873284 | 247 | cmd_heap(0, 0); |
jmarkel44 | 0:65cfa4873284 | 248 | wait(2.5); |
jmarkel44 | 0:65cfa4873284 | 249 | } |
jmarkel44 | 0:65cfa4873284 | 250 | } |
jmarkel44 | 0:65cfa4873284 | 251 | |
jmarkel44 | 0:65cfa4873284 | 252 | static void create(const char *controlFile, Control_t controlType) |
jmarkel44 | 0:65cfa4873284 | 253 | { |
jmarkel44 | 0:65cfa4873284 | 254 | Message_t *msg = MailBox.alloc(); |
jmarkel44 | 0:65cfa4873284 | 255 | memset(msg, 0, sizeof(Message_t)); |
jmarkel44 | 0:65cfa4873284 | 256 | msg->action = ACTION_CREATE; |
jmarkel44 | 0:65cfa4873284 | 257 | msg->control = controlType; |
jmarkel44 | 0:65cfa4873284 | 258 | strncpy(msg->controlFile, controlFile, sizeof(msg->controlFile)-1); |
jmarkel44 | 0:65cfa4873284 | 259 | |
jmarkel44 | 0:65cfa4873284 | 260 | printf("\r%s: Sending a create request for control %s\r\n", |
jmarkel44 | 0:65cfa4873284 | 261 | __func__, msg->controlFile); |
jmarkel44 | 0:65cfa4873284 | 262 | |
jmarkel44 | 0:65cfa4873284 | 263 | MailBox.put(msg); |
jmarkel44 | 0:65cfa4873284 | 264 | } |
jmarkel44 | 0:65cfa4873284 | 265 | |
jmarkel44 | 0:65cfa4873284 | 266 | static void destroy(const char *controlFile) |
jmarkel44 | 0:65cfa4873284 | 267 | { |
jmarkel44 | 0:65cfa4873284 | 268 | Message_t *msg = MailBox.alloc(); |
jmarkel44 | 0:65cfa4873284 | 269 | memset(msg, 0, sizeof(Message_t)); |
jmarkel44 | 0:65cfa4873284 | 270 | msg->action = ACTION_DESTROY; |
jmarkel44 | 0:65cfa4873284 | 271 | strncpy(msg->controlFile, controlFile, sizeof(msg->controlFile)-1); |
jmarkel44 | 0:65cfa4873284 | 272 | |
jmarkel44 | 0:65cfa4873284 | 273 | printf("\r%s: Sending a destroy request for control %s\r\n", |
jmarkel44 | 0:65cfa4873284 | 274 | __func__, msg->controlFile); |
jmarkel44 | 0:65cfa4873284 | 275 | |
jmarkel44 | 0:65cfa4873284 | 276 | MailBox.put(msg); |
jmarkel44 | 0:65cfa4873284 | 277 | } |
jmarkel44 | 0:65cfa4873284 | 278 |