shellmatta.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. /*
  2. * Copyright (c) 2019 - 2024 Stefan Strobel <stefan.strobel@shimatta.net>
  3. *
  4. * This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file shellmatta.h
  10. * @brief API definition of the Shellmatta terminal implementation
  11. * @author Stefan Strobel <stefan.strobel@shimatta.net>
  12. */
  13. /**
  14. * @addtogroup shellmatta_api Shellmatta API description
  15. * @{
  16. */
  17. #ifndef _SHELLMATTA_H_
  18. #define _SHELLMATTA_H_
  19. #include <stdint.h>
  20. #include <stdbool.h>
  21. /* global defines */
  22. /*
  23. * Define the printf format specifier for all GCC versions > 3.3
  24. * This will let the compiler know that shellmatta_printf() is a function taking printf-like format specifiers.
  25. */
  26. #ifndef SHELLMATTA_ATTR_FORMAT
  27. # if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
  28. # define SHELLMATTA_ATTR_FORMAT(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
  29. # else
  30. # define SHELLMATTA_ATTR_FORMAT(fmt, args)
  31. # endif
  32. #else
  33. # define SHELLMATTA_ATTR_FORMAT(fmt, args)
  34. #endif
  35. /**
  36. * @brief definition of a shellmatta handle
  37. */
  38. typedef void* shellmatta_handle_t;
  39. /**
  40. * @brief definition of shellmatta return codes
  41. */
  42. typedef enum
  43. {
  44. SHELLMATTA_OK = 0u, /**< everything is OK */
  45. SHELLMATTA_ERROR , /**< error occured */
  46. SHELLMATTA_CONTINUE , /**< the function is not over */
  47. SHELLMATTA_USE_FAULT , /**< parameter error - wrong usage */
  48. SHELLMATTA_DUPLICATE , /**< duplicate command */
  49. SHELLMATTA_BUSY /**< command is busy keep calling */
  50. } shellmatta_retCode_t;
  51. /**
  52. * @brief definition of shellmatta insert mode
  53. */
  54. typedef enum
  55. {
  56. SHELLMATTA_MODE_INSERT = 0u, /**< insert mode */
  57. SHELLMATTA_MODE_OVERWRITE , /**< overwrite mode */
  58. } shellmatta_mode_t;
  59. /**
  60. * @brief definition of shellmatta optionparser agument type
  61. */
  62. typedef enum
  63. {
  64. SHELLMATTA_OPT_ARG_NONE = 0u, /**< no argument expected */
  65. SHELLMATTA_OPT_ARG_REQUIRED, /**< argument is required */
  66. SHELLMATTA_OPT_ARG_OPTIONAL, /**< argument is optional */
  67. } shellmatta_opt_argtype_t;
  68. /**
  69. * @brief definition of shellmatta optionparser agument type
  70. */
  71. typedef struct
  72. {
  73. const char *paramLong; /**< long parameter string */
  74. const char paramShort; /**< short parameter char */
  75. shellmatta_opt_argtype_t argtype; /**< argument type expected */
  76. } shellmatta_opt_long_t;
  77. /**
  78. * @brief definition of shellmatta optionparser structure
  79. */
  80. typedef struct
  81. {
  82. uint32_t argStart; /**< start of the arguments of the command */
  83. uint32_t offset; /**< current offset of the option parser */
  84. uint32_t nextOffset; /**< offset of the next hunk */
  85. uint32_t len; /**< length of the current hunk */
  86. } shellmatta_opt_t;
  87. /**
  88. * @brief shellmatta command function definition
  89. * @param[in] handle pointer to the instance which is calling the cmd
  90. * @param[in] arguments argument string called to run this command beginning
  91. * with the command itself
  92. * @param[in] length length of the argument string
  93. */
  94. typedef shellmatta_retCode_t (*shellmatta_cmdFct_t)(const shellmatta_handle_t handle,
  95. const char *arguments,
  96. uint32_t length);
  97. /**
  98. * @brief shellmatta write function definition
  99. * @param[in] data data to be written to the output
  100. * @param[in] length length of the data to be written
  101. */
  102. typedef shellmatta_retCode_t (*shellmatta_write_t)(const char* data, uint32_t length);
  103. #ifdef SHELLMATTA_AUTHENTICATION
  104. /**
  105. * @brief user role matrix
  106. */
  107. typedef struct
  108. {
  109. uint32_t userId; /**< id of the user (!= 0) */
  110. bool superuser; /**< allow the user to access all commands */
  111. const char *username; /**< name of the user role */
  112. const char *password; /**< password of the user role or NULL (custom auth) */
  113. } shellmatta_auth_user_t;
  114. /**
  115. * @brief typedefinition of one line of the authentication table
  116. */
  117. typedef struct
  118. {
  119. const char* cmd; /**< command to grand access to */
  120. const uint32_t *userIds; /**< list of user ids with access to the cmd */
  121. const uint32_t userIdslength; /**< length of the user list */
  122. } shellmatta_auth_perm_t;
  123. /**
  124. * @brief login states
  125. */
  126. typedef enum
  127. {
  128. SHELLMATTA_AUTH_IDLE, /**< authentication system waits */
  129. SHELLMATTA_AUTH_USERNAME, /**< input of username */
  130. SHELLMATTA_AUTH_PASSWORD /**< input of password */
  131. } shellmatta_auth_state_t;
  132. /**
  133. * @brief log actions - passed to the log function
  134. */
  135. typedef enum
  136. {
  137. SHELLMATTA_AUTH_EVENT_NONE, /**< no event (init value) */
  138. SHELLMATTA_AUTH_EVENT_LOGIN, /**< successful login event */
  139. SHELLMATTA_AUTH_EVENT_LOGIN_FAILED, /**< failed login event */
  140. SHELLMATTA_AUTH_EVENT_LOGOUT, /**< succesful logout event */
  141. } shellmatta_auth_log_event_t;
  142. /**
  143. * @brief custom shellmatta authentication method
  144. * @param[in] userId user id to log in (name of the user role)
  145. * @param[in] password password for the login
  146. * @return userId if password was correct - otherwise 0
  147. */
  148. typedef shellmatta_retCode_t (*shellmatta_auth_check_t)(const uint32_t userId, const char* password);
  149. /**
  150. * @brief shellmatta authentication log method - will be called whenever a login attempt is done
  151. * @param[in] userId userId to be logged in (0 on unknown user)
  152. * @param[in] event event type to be logged (e.g. successful login)
  153. */
  154. typedef void (*shellmatta_auth_log_t)(const uint32_t userId, shellmatta_auth_log_event_t event);
  155. #endif
  156. /**
  157. * @brief structure of one shellmatta command
  158. */
  159. typedef struct shellmatta_cmd
  160. {
  161. char *cmd; /**< command name */
  162. char *cmdAlias; /**< command alias */
  163. char *helpText; /**< help text to print in "help" command */
  164. char *usageText; /**< usage text - printed on "help cmd" */
  165. shellmatta_cmdFct_t cmdFct; /**< pointer to the cmd callack function */
  166. #ifdef SHELLMATTA_AUTHENTICATION
  167. shellmatta_auth_perm_t *authLink; /**< internally used - pointer to perm list */
  168. #endif
  169. struct shellmatta_cmd *next; /**< pointer to next command or NULL */
  170. } shellmatta_cmd_t;
  171. /**
  172. * @brief shellmatta ymodem cancel callback definition
  173. * @param[in] handle pointer to the instance which is calling the callback
  174. */
  175. typedef void (*shellmatta_ymodem_cancel_t)(const shellmatta_handle_t handle);
  176. /**
  177. * @brief shellmatta ymodem header receive callback definition
  178. * @param[in] handle pointer to the instance which is calling the callback
  179. * @param[in] fileSize file size of the file to be received
  180. * @param[in] fileName file name of the file to be received
  181. */
  182. typedef void (*shellmatta_ymodem_recvHeader_t)(const shellmatta_handle_t handle,
  183. uint32_t fileSize,
  184. char* fileName);
  185. /**
  186. * @brief shellmatta ymodem packet receive callback definition
  187. * @param[in] handle pointer to the instance which is calling the callback
  188. * @param[in] data received data
  189. * @param[in] packetSize size of the data in the packet
  190. * @param[in] packetNum number of the received packet
  191. */
  192. typedef void (*shellmatta_ymodem_recvPacket_t)(const shellmatta_handle_t handle,
  193. uint8_t *data,
  194. uint32_t packetSize,
  195. uint32_t packetNum);
  196. /**
  197. * @brief shellmatta ymodem transmission complete callback definition
  198. * @param[in] handle pointer to the instance which is calling the callback
  199. * @param[in] result #SHELLMATTA_OK
  200. * #SHELLMATTA_ERROR - missing data
  201. */
  202. typedef void (*shellmatta_ymodem_complete_t)(const shellmatta_handle_t handle,
  203. shellmatta_retCode_t result);
  204. /**
  205. * @brief state enumeration for ymodem receive state machine
  206. */
  207. typedef enum
  208. {
  209. SHELLMATTA_YMODEM_INACTIVE, /**< YModem module not initialised */
  210. SHELLMATTA_YMODEM_WAIT_FOR_START, /**< waiting for start of header */
  211. SHELLMATTA_YMODEM_RECEIVE_HEADER, /**< reading header data */
  212. SHELLMATTA_YMODEM_RECEIVE_DATA, /**< reading payload */
  213. SHELLMATTA_YMODEM_RECEIVE_CRC, /**< reading crc */
  214. SHELLMATTA_YMODEM_WAIT_FOR_END /**< wait until EOTs stop */
  215. } shellmatta_ymodem_state_t;
  216. /** @brief packet structure that holds several information about its content */
  217. typedef struct
  218. {
  219. uint16_t size; /**< site of the packet (128 or 1024) */
  220. uint8_t packetNumber; /**< packet number in this packet */
  221. uint8_t* packetData; /**< pointer to the data of this packet */
  222. uint16_t crc; /**< crc checksum in this packet */
  223. } shellmatta_ymodem_packet_t;
  224. /**
  225. * @brief definition of shellmatta ymodem instance
  226. */
  227. typedef struct
  228. {
  229. shellmatta_ymodem_state_t state; /**< current stat of the ymodem module */
  230. uint32_t byteCounter; /**< internal counter for processing input data */
  231. uint32_t packetCounter; /**< counter of the totally received packets */
  232. uint32_t totalBytesReceived; /**< counter of the totally received bytes */
  233. uint32_t fileSize; /**< size of the file received in packet 0 */
  234. bool pauseRequested; /**< pause requested from the application */
  235. uint32_t pollCyclesLeft; /**< number of poll cycles left before ending */
  236. shellmatta_ymodem_packet_t packet; /**< currently processed packet */
  237. shellmatta_ymodem_cancel_t cancelCallback; /**< callback to pass cancel events */
  238. shellmatta_ymodem_recvHeader_t recvHeaderCallback; /**< callback to pass received header data */
  239. shellmatta_ymodem_recvPacket_t recvPacketCallback; /**< callback to pass received data */
  240. shellmatta_ymodem_complete_t transmissionCompleteCallback; /**< callback to be called on a complete transfer */
  241. } shellmatta_ymodem_t;
  242. #ifdef SHELLMATTA_TRANSPORT
  243. /**
  244. * @brief definition of shellmatta transport layer states
  245. */
  246. typedef enum
  247. {
  248. SHELLMATTA_TRANSPORT_STATE_WAIT = 0u , /**< wait for start of header */
  249. SHELLMATTA_TRANSPORT_STATE_GET_HEADER , /**< read in header */
  250. SHELLMATTA_TRANSPORT_STATE_GET_PAYLOAD , /**< read in payload */
  251. SHELLMATTA_TRANSPORT_STATE_GET_CRC , /**< read crc and process data */
  252. } shellmatta_transport_state_t;
  253. /** @brief max length of a plain data payload */
  254. #define SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH ((uint8_t)(255))
  255. /** @brief size of the shellmatta transport uuid */
  256. #define SHELLMATTA_TRANPORT_UUID_LENGTH ((uint8_t)(16))
  257. /**
  258. * @brief shellmatta transport crc function definition for custom crcs
  259. * @param[in] data data to calculate the crc of
  260. * @param[in] size size of the data in bytes
  261. */
  262. typedef uint32_t (*shellmatta_transport_crc_t)(const char* data, const uint32_t size);
  263. /**
  264. * @brief structure of one shellmatta transport header
  265. */
  266. typedef struct __attribute__((__packed__))
  267. {
  268. uint8_t startOfHeader; /** start of header field */
  269. uint8_t protocolVersion; /** protocol version of the packet */
  270. uint8_t packetType; /** type of the packet */
  271. uint8_t payloadLength; /** length of the payload */
  272. uint8_t source; /** source of the packet */
  273. uint8_t destination; /** destination of the packet */
  274. uint8_t sequenceH2S; /** sequence counter host to shellmatta */
  275. uint8_t sequenceS2H; /** sequence counter shellmatta to host */
  276. } shellmatta_transport_header_t;
  277. /**
  278. * @brief structure of one shellmatta transport packet
  279. */
  280. typedef struct __attribute__((__packed__))
  281. {
  282. shellmatta_transport_header_t header; /**< header of the packet */
  283. char payload[SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH]; /**< payload of the packet */
  284. uint32_t crc; /**< crc of the packet */
  285. } shellmatta_transport_packet_t;
  286. /**
  287. * @brief structure of one shellmatta transport layer instance
  288. */
  289. typedef struct
  290. {
  291. shellmatta_transport_state_t state; /**< current state of the transport layer reception */
  292. bool active; /**< is transport layer communication active */
  293. bool disableAutoFlush; /**< enforce manual flushing */
  294. bool mandatory; /**< is the transport layer enforced */
  295. bool suspendOptional; /**< forces the transport layer to not run optional */
  296. uint8_t sequenceH2S; /**< sequence counter host to shellmatta */
  297. uint8_t sequenceS2H; /**< sequenc counter shellmatta to host */
  298. uint32_t headerIndex; /**< read index of the header */
  299. uint32_t payloadIndex; /**< read index of the payload */
  300. uint32_t crcIndex; /**< read index of the checksum */
  301. uint8_t hostBufferSize; /**< buffersize of the host */
  302. uint8_t address; /**< address of the shellmatta */
  303. uint8_t uuid[SHELLMATTA_TRANPORT_UUID_LENGTH]; /**< uuid if the shellmatta */
  304. shellmatta_transport_packet_t inPacket; /**< buffer for the received packets */
  305. shellmatta_transport_packet_t outPacket; /**< buffer for the sent packets */
  306. shellmatta_write_t writeFct; /**< shellmatta write function */
  307. shellmatta_transport_crc_t customCrcFct; /**< use this function to calculate crcs */
  308. } shellmatta_transport_layer_t;
  309. #endif
  310. /**
  311. * @brief structure of one shellmatta instance
  312. */
  313. typedef struct
  314. {
  315. uint32_t magic; /**< magic number to check if initialized */
  316. char *buffer; /**< input buffer */
  317. uint32_t bufferSize; /**< size of the input buffer */
  318. uint32_t inputCount; /**< offset of the current write operation */
  319. uint32_t byteCounter; /**< counter used to loop over input data */
  320. uint32_t lastNewlineIdx; /**< index of the lest newline */
  321. uint32_t cursor; /**< offset where the cursor is at */
  322. uint32_t stdinIdx; /**< start index of stdin in buffer */
  323. uint32_t stdinLength; /**< length of the stdin data */
  324. char *historyBuffer; /**< buffer to store the last commands */
  325. uint32_t historyBufferSize; /**< size of the history buffer */
  326. uint32_t historyStart; /**< index of the oldest stored command */
  327. uint32_t historyEnd; /**< index of the newest stored command */
  328. uint32_t historyRead; /**< index of the current search */
  329. bool historyReadUp; /**< flag to show the last history dir */
  330. uint32_t tabCounter; /**< counts the tabulator key presses */
  331. uint32_t escapeCounter; /**< counts the characters of an escape seq */
  332. char escapeChars[4u]; /**< buffer to save the escape characters */
  333. uint32_t hereStartIdx; /**< heredoc start of "<<" */
  334. uint32_t hereDelimiterIdx; /**< heredoc delimiter index in input */
  335. uint32_t hereLength; /**< length of the heredoc delimiter */
  336. bool echoEnabled; /**< if true the input is printed */
  337. bool dirty; /**< dirty flag to show changes */
  338. const char *prompt; /**< prompt is printed after every command */
  339. char delimiter; /**< delimiter (return) to terminate a cmd */
  340. shellmatta_mode_t mode; /**< mode of the shell */
  341. shellmatta_write_t write; /**< pointer to write function */
  342. shellmatta_cmd_t helpCmd; /**< help command structure */
  343. shellmatta_cmd_t *cmdList; /**< pointer to the first command */
  344. shellmatta_cmd_t *continuousCmd; /**< command to be called continuously */
  345. shellmatta_cmd_t *busyCmd; /**< command to be polled (busy mode) */
  346. bool cmdListIsConst; /**< true if the #cmdList was passed during
  347. initialization */
  348. shellmatta_opt_t optionParser; /**< option parser sructure */
  349. shellmatta_ymodem_t ymodem; /**< ymodem instance */
  350. #ifdef SHELLMATTA_AUTHENTICATION
  351. shellmatta_auth_state_t loginState; /**< state variable of the login cmd */
  352. shellmatta_cmd_t loginCmd; /**< login command structure */
  353. shellmatta_cmd_t logoutCmd; /**< logout command structure */
  354. uint32_t userId; /**< user ID of the current session */
  355. uint32_t tmpUserId; /**< remporary user ID during input */
  356. shellmatta_auth_user_t *userPointer; /**< pointer to the user in the user list */
  357. shellmatta_auth_user_t *userList; /**< user list */
  358. uint32_t userListLength; /**< length of the user list */
  359. shellmatta_auth_perm_t *permList; /**< permission list */
  360. uint32_t permListLength; /**< length of the permission list */
  361. shellmatta_auth_check_t checkFct; /**< custom credential check function */
  362. shellmatta_auth_log_t logFct; /**< auth log function */
  363. #endif
  364. #ifdef SHELLMATTA_TRANSPORT
  365. uint32_t transportBusyMark; /**< transport processing position during
  366. busy cmd execution */
  367. shellmatta_transport_layer_t transportLayer; /**< transport layer instance */
  368. #endif
  369. } shellmatta_instance_t;
  370. /**
  371. * @brief helper macro for the send function
  372. */
  373. #ifdef SHELLMATTA_TRANSPORT
  374. #define SHELLMATTA_WRITE(data, length) inst->transportLayer.active == true ? \
  375. shellmatta_transport_write((shellmatta_transport_layer_t*)&inst->transportLayer, (data), (length)) : \
  376. inst->write((data), (length))
  377. #else
  378. #define SHELLMATTA_WRITE(data, length) inst->write((data), (length))
  379. #endif
  380. shellmatta_retCode_t shellmatta_doInit( shellmatta_instance_t *inst,
  381. shellmatta_handle_t *handle,
  382. char *buffer,
  383. uint32_t bufferSize,
  384. char *historyBuffer,
  385. uint32_t historyBufferSize,
  386. const char *prompt,
  387. const shellmatta_cmd_t *cmdList,
  388. shellmatta_write_t writeFct);
  389. shellmatta_retCode_t shellmatta_resetShell( shellmatta_handle_t handle,
  390. bool printPrompt);
  391. shellmatta_retCode_t shellmatta_addCmd( shellmatta_handle_t handle,
  392. shellmatta_cmd_t *cmd);
  393. shellmatta_retCode_t shellmatta_removeCmd( shellmatta_handle_t handle,
  394. const shellmatta_cmd_t *cmd);
  395. shellmatta_retCode_t shellmatta_configure( shellmatta_handle_t handle,
  396. shellmatta_mode_t mode,
  397. bool echoEnabled,
  398. char delimiter);
  399. shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t handle,
  400. char *data,
  401. uint32_t size);
  402. shellmatta_retCode_t shellmatta_write( shellmatta_handle_t handle,
  403. char *data,
  404. uint32_t length);
  405. shellmatta_retCode_t shellmatta_read( shellmatta_handle_t handle,
  406. char **data,
  407. uint32_t *length);
  408. shellmatta_retCode_t shellmatta_opt( shellmatta_handle_t handle,
  409. const char *optionString,
  410. char *option,
  411. char **argument,
  412. uint32_t *argLen);
  413. shellmatta_retCode_t shellmatta_opt_long( shellmatta_handle_t handle,
  414. const shellmatta_opt_long_t *longOptions,
  415. char *option,
  416. char **argument,
  417. uint32_t *argLen);
  418. #ifdef SHELLMATTA_TRANSPORT
  419. shellmatta_retCode_t shellmatta_transport_configure(shellmatta_handle_t handle,
  420. bool mandatory,
  421. bool disableAutoFlush,
  422. uint8_t uuid[SHELLMATTA_TRANPORT_UUID_LENGTH],
  423. shellmatta_transport_crc_t customCrcFct);
  424. shellmatta_retCode_t shellmatta_transport_reset(shellmatta_handle_t handle);
  425. shellmatta_retCode_t shellmatta_transport_flush(shellmatta_handle_t handle);
  426. #endif
  427. #ifndef SHELLMATTA_STRIP_PRINTF
  428. shellmatta_retCode_t shellmatta_printf( shellmatta_handle_t handle,
  429. const char *fmt,
  430. ...)
  431. SHELLMATTA_ATTR_FORMAT(2, 3);
  432. #endif
  433. #ifdef SHELLMATTA_AUTHENTICATION
  434. shellmatta_retCode_t shellmatta_auth_init( shellmatta_handle_t handle,
  435. shellmatta_auth_user_t *userList,
  436. uint32_t userListLength,
  437. shellmatta_auth_perm_t *permList,
  438. uint32_t permListLength,
  439. bool customLogin,
  440. shellmatta_auth_check_t checkFct,
  441. shellmatta_auth_log_t logFct);
  442. shellmatta_retCode_t shellmatta_auth_login( shellmatta_handle_t handle,
  443. uint32_t userId);
  444. shellmatta_retCode_t shellmatta_auth_logout( shellmatta_handle_t handle);
  445. uint32_t shellmatta_auth_getLoggedInUserId( shellmatta_handle_t handle);
  446. shellmatta_retCode_t shellmatta_auth_getLoggedInUserName( shellmatta_handle_t handle,
  447. char *data,
  448. uint32_t *length);
  449. shellmatta_retCode_t shellmatta_auth_chpasswd( shellmatta_handle_t handle,
  450. const char *username,
  451. const char *password);
  452. #endif
  453. shellmatta_retCode_t shellmatta_ymodem_init( shellmatta_handle_t handle,
  454. uint8_t* recvBuffer,
  455. shellmatta_ymodem_cancel_t cancelCallback,
  456. shellmatta_ymodem_recvHeader_t recvHeaderCallback,
  457. shellmatta_ymodem_recvPacket_t recvPacketCallback,
  458. shellmatta_ymodem_complete_t transmissionCompleteCallback);
  459. shellmatta_retCode_t shellmatta_ymodem_pause( shellmatta_handle_t handle);
  460. shellmatta_retCode_t shellmatta_ymodem_resume( shellmatta_handle_t handle);
  461. shellmatta_retCode_t shellmatta_ymodem_cancel( shellmatta_handle_t handle,
  462. bool doCancel);
  463. #endif
  464. /** @} */