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.
share/commandline.h@16:31c387e94b6d, 2017-05-11 (annotated)
- Committer:
- terencez
- Date:
- Thu May 11 12:40:25 2017 +0000
- Revision:
- 16:31c387e94b6d
- Parent:
- 14:ec9e195830ff
Added a demo temperature object based on sensor LM75B.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
terencez | 14:ec9e195830ff | 1 | /******************************************************************************* |
terencez | 14:ec9e195830ff | 2 | * |
terencez | 14:ec9e195830ff | 3 | * Copyright (c) 2013 Intel Corporation and others. |
terencez | 14:ec9e195830ff | 4 | * All rights reserved. This program and the accompanying materials |
terencez | 14:ec9e195830ff | 5 | * are made available under the terms of the Eclipse Public License v1.0 |
terencez | 14:ec9e195830ff | 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. |
terencez | 14:ec9e195830ff | 7 | * |
terencez | 14:ec9e195830ff | 8 | * The Eclipse Public License is available at |
terencez | 14:ec9e195830ff | 9 | * http://www.eclipse.org/legal/epl-v10.html |
terencez | 14:ec9e195830ff | 10 | * The Eclipse Distribution License is available at |
terencez | 14:ec9e195830ff | 11 | * http://www.eclipse.org/org/documents/edl-v10.php. |
terencez | 14:ec9e195830ff | 12 | * |
terencez | 14:ec9e195830ff | 13 | * Contributors: |
terencez | 14:ec9e195830ff | 14 | * David Navarro, Intel Corporation - initial API and implementation |
terencez | 14:ec9e195830ff | 15 | * |
terencez | 14:ec9e195830ff | 16 | *******************************************************************************/ |
terencez | 14:ec9e195830ff | 17 | |
terencez | 14:ec9e195830ff | 18 | #include <stdio.h> |
terencez | 14:ec9e195830ff | 19 | |
terencez | 14:ec9e195830ff | 20 | #define COMMAND_END_LIST {NULL, NULL, NULL, NULL, NULL} |
terencez | 14:ec9e195830ff | 21 | |
terencez | 14:ec9e195830ff | 22 | typedef void (*command_handler_t) (char * args, void * user_data); |
terencez | 14:ec9e195830ff | 23 | |
terencez | 14:ec9e195830ff | 24 | typedef struct |
terencez | 14:ec9e195830ff | 25 | { |
terencez | 14:ec9e195830ff | 26 | char * name; |
terencez | 14:ec9e195830ff | 27 | char * shortDesc; |
terencez | 14:ec9e195830ff | 28 | char * longDesc; |
terencez | 14:ec9e195830ff | 29 | command_handler_t callback; |
terencez | 14:ec9e195830ff | 30 | void * userData; |
terencez | 14:ec9e195830ff | 31 | } command_desc_t; |
terencez | 14:ec9e195830ff | 32 | |
terencez | 14:ec9e195830ff | 33 | |
terencez | 14:ec9e195830ff | 34 | void handle_command(command_desc_t * commandArray, char * buffer); |
terencez | 14:ec9e195830ff | 35 | char* get_end_of_arg(char* buffer); |
terencez | 14:ec9e195830ff | 36 | char * get_next_arg(char * buffer, char **end); |
terencez | 14:ec9e195830ff | 37 | int check_end_of_args(char* buffer); |
terencez | 14:ec9e195830ff | 38 | |
terencez | 14:ec9e195830ff | 39 | void output_buffer(FILE * stream, uint8_t * buffer, int length, int indent); |
terencez | 14:ec9e195830ff | 40 | void output_tlv(FILE * stream, uint8_t * buffer, size_t buffer_len, int indent); |
terencez | 14:ec9e195830ff | 41 | void dump_tlv(FILE * stream, int size, lwm2m_data_t * dataP, int indent); |
terencez | 14:ec9e195830ff | 42 | void output_data(FILE * stream, lwm2m_media_type_t format, uint8_t * buffer, int length, int indent); |
terencez | 14:ec9e195830ff | 43 | void print_status(FILE * stream, uint8_t status); |