diff --git a/app/nano_shell_command.c b/app/nano_shell_command.c index 5bbfa9a..11d4d5a 100644 --- a/app/nano_shell_command.c +++ b/app/nano_shell_command.c @@ -450,13 +450,13 @@ int _bluetooth(const shell_cmd_t *pcmd, int argc, char *const argv[]) { if(strcmp(argv[1], "enable") == 0) { - //shell_printf("Enabling bluetooth : %d"NEW_LINE, demo_bt_enable()); - shell_printf("Enabling bluetooth test"NEW_LINE); + shell_printf("Enabling bluetooth : %d"NEW_LINE, demo_bt_enable()); + //shell_printf("Enabling bluetooth test"NEW_LINE); } else if(strcmp(argv[1], "disable") == 0) { - //shell_printf("Disabling bluetooth : %d"NEW_LINE, demo_bt_destroy()); - shell_printf("Disabling bluetooth test"NEW_LINE); + shell_printf("Disabling bluetooth : %d"NEW_LINE, demo_bt_destroy()); + //shell_printf("Disabling bluetooth test"NEW_LINE); } else if(strcmp(argv[1], "start_demo") == 0) { @@ -478,6 +478,22 @@ int _bluetooth(const shell_cmd_t *pcmd, int argc, char *const argv[]) return 0; } +int _telnet(const shell_cmd_t *pcmd, int argc, char *const argv[]) +{ + if(argc > 1) + { + if(strcmp(argv[1], "dont_echo") == 0) + { + shell_printf("Disabling client echo"NEW_LINE"%c%c%c"NEW_LINE, 0xFF, 0xFB, 0x01); + } + } + else + { + shell_printf("List of %s actions :"NEW_LINE"dont_echo"NEW_LINE, argv[0]); + } + return 0; +} + NANO_SHELL_ADD_CMD(system, _system, "Query system information", @@ -518,3 +534,7 @@ NANO_SHELL_ADD_CMD(bluetooth, _bluetooth, "Command to control bluetooth functionality", " Use this command to interact use bluetooth"NEW_LINE); +NANO_SHELL_ADD_CMD(telnet, + _telnet, + "Command to set the telnet session up", + " USe this command to set telnet session parameters"NEW_LINE); diff --git a/app/nano_shell_server_task.c b/app/nano_shell_server_task.c index 4d5c826..256f7ff 100644 --- a/app/nano_shell_server_task.c +++ b/app/nano_shell_server_task.c @@ -29,7 +29,8 @@ void network_write(char c) { if(send(client_sock, &c, 1, 0) < 0) { - shell_printf("Failed to send data to client - errno(%d)."NEW_LINE, errno); + // Failed to send data to client because he probably disconnected + // or the connection got broken } } } diff --git a/src/os/rtos/include/rtostimers.h b/src/os/rtos/include/rtostimers.h index 1ba85ef..0e593fe 100644 --- a/src/os/rtos/include/rtostimers.h +++ b/src/os/rtos/include/rtostimers.h @@ -514,6 +514,18 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ); * @endverbatim */ #define xTimerChangePeriod( xTimer, xNewPeriod, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xTicksToWait ) ) + /** + * Returns the time in ticks at which the timer will expire. If this is less + * than the current tick count then the expiry time has overflowed from the + * current time. + * + * @param xTimer The handle of the timer being queried. + * + * @return If the timer is running then the time in ticks at which the timer + * will next expire is returned. If the timer is not running then the return + * value is undefined. + */ + TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /** * BaseType_t xTimerDelete( TimerHandle_t xTimer, TickType_t xTicksToWait ); diff --git a/src/os/rtos/source/rtostimers.c b/src/os/rtos/source/rtostimers.c index 78c1968..e103e81 100644 --- a/src/os/rtos/source/rtostimers.c +++ b/src/os/rtos/source/rtostimers.c @@ -350,6 +350,19 @@ TimerHandle_t xTimerCreateExt( const signed char *pcTimerName, portTickType xTim return ( TimerHandle_t ) pxNewTimer; } + +/*-----------------------------------------------------------*/ + +TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) +{ + Timer_t * pxTimer = ( xTIMER * ) xTimer; + TickType_t xReturn; + + configASSERT( xTimer ); + xReturn = listGET_LIST_ITEM_VALUE( &( pxTimer->xTimerListItem ) ); + return xReturn; +} + /*-----------------------------------------------------------*/ BaseType_t xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait )