@@ -32,6 +32,19 @@ struct EmbeddedCliConfig;
3232namespace cms {
3333namespace EmbeddedCLI { // note, all caps CLI needed to avoid conflicts
3434
35+ // used for proper alignment of cli buffer, below
36+ // matches with embedded cli itself
37+ #if UINTPTR_MAX == 0xFFFF
38+ using CliUint = uint16_t ;
39+ #elif UINTPTR_MAX == 0xFFFFFFFF
40+ using CliUint = uint32_t ;
41+ #elif UINTPTR_MAX == 0xFFFFFFFFFFFFFFFFu
42+ using CliUint = uint64_t ;
43+ #else
44+ #error unsupported pointer size
45+ #endif
46+
47+
3548/* *
3649 * The EmbeddedCLI::Service creates a command line interface
3750 * using a provided character device.
@@ -52,7 +65,7 @@ class Service final : public QP::QActive {
5265 * @param customInvitation - a custom string for the CLI prompt.
5366 * Set to nullptr for the internal default prompt
5467 */
55- explicit Service (uint64_t * buffer, size_t bufferElementCount, uint16_t maxBindingCount, const char * customInvitation = nullptr );
68+ explicit Service (CliUint * buffer, size_t bufferElementCount, uint16_t maxBindingCount, const char * customInvitation = nullptr );
5669 ~Service ();
5770
5871 Service (const Service&) = delete ;
@@ -67,15 +80,6 @@ class Service final : public QP::QActive {
6780 * to the AO to get the CLI up and running.
6881 *
6982 * @param charDevice - the character device to use
70- * @param buffer - pointer to a statically allocated buffer using
71- * uint64. Must be aligned to uint64 boundaries too.
72- * @param bufferElementCount - the number of uint64 elements
73- * available at 'buffer'
74- *
75- * @note: If 'buffer' is nullptr, will use the embedded-cli's default configuration
76- * which will allocate memory via malloc.
77- * @note: Using uint64 to ensure all embedded-cli alignment requirements
78- * are met, regardless of environment.
7983 */
8084 void BeginCliAsync (cms::interfaces::CharacterDevice* charDevice);
8185
0 commit comments