Mbed Cloud example program for workshop in W27 2018.

Dependencies:   MMA7660 LM75B

Committer:
MACRUM
Date:
Sat Jun 30 01:40:30 2018 +0000
Revision:
0:119624335925
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 0:119624335925 1 /** @file fsfat_test.h
MACRUM 0:119624335925 2 *
MACRUM 0:119624335925 3 * mbed Microcontroller Library
MACRUM 0:119624335925 4 * Copyright (c) 2006-2016 ARM Limited
MACRUM 0:119624335925 5 *
MACRUM 0:119624335925 6 * Licensed under the Apache License, Version 2.0 (the "License");
MACRUM 0:119624335925 7 * you may not use this file except in compliance with the License.
MACRUM 0:119624335925 8 * You may obtain a copy of the License at
MACRUM 0:119624335925 9 *
MACRUM 0:119624335925 10 * http://www.apache.org/licenses/LICENSE-2.0
MACRUM 0:119624335925 11 *
MACRUM 0:119624335925 12 * Unless required by applicable law or agreed to in writing, software
MACRUM 0:119624335925 13 * distributed under the License is distributed on an "AS IS" BASIS,
MACRUM 0:119624335925 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
MACRUM 0:119624335925 15 * See the License for the specific language governing permissions and
MACRUM 0:119624335925 16 * limitations under the License.
MACRUM 0:119624335925 17 *
MACRUM 0:119624335925 18 * Header file for test support data structures and function API.
MACRUM 0:119624335925 19 */
MACRUM 0:119624335925 20 #ifndef __FSFAT_TEST_H
MACRUM 0:119624335925 21 #define __FSFAT_TEST_H
MACRUM 0:119624335925 22
MACRUM 0:119624335925 23 #include <stdint.h>
MACRUM 0:119624335925 24 #include <stdlib.h>
MACRUM 0:119624335925 25 #include <stdbool.h>
MACRUM 0:119624335925 26
MACRUM 0:119624335925 27 #ifdef __cplusplus
MACRUM 0:119624335925 28 extern "C" {
MACRUM 0:119624335925 29 #endif
MACRUM 0:119624335925 30
MACRUM 0:119624335925 31 /* Defines */
MACRUM 0:119624335925 32 //#define FSFAT_INIT_1_TABLE_HEAD { "a", ""}
MACRUM 0:119624335925 33 #define FSFAT_INIT_1_TABLE_MID_NODE { "/sd/01234567.txt", "abcdefghijklmnopqrstuvwxyz"}
MACRUM 0:119624335925 34 //#define FSFAT_INIT_1_TABLE_TAIL { "/sd/fopentst/hello/world/animal/wobbly/dog/foot/backrght.txt", "present"}
MACRUM 0:119624335925 35 #define FSFAT_TEST_RW_TABLE_SENTINEL 0xffffffff
MACRUM 0:119624335925 36 #define FSFAT_TEST_BYTE_DATA_TABLE_SIZE 256
MACRUM 0:119624335925 37 #define FSFAT_UTEST_MSG_BUF_SIZE 256
MACRUM 0:119624335925 38 #define FSFAT_UTEST_DEFAULT_TIMEOUT_MS 10000
MACRUM 0:119624335925 39 #define FSFAT_MBED_HOSTTEST_TIMEOUT 60
MACRUM 0:119624335925 40 #define FSFAT_MAX_FILE_BASENAME 8
MACRUM 0:119624335925 41 #define FSFAT_MAX_FILE_EXTNAME 3
MACRUM 0:119624335925 42 #define FSFAT_BUF_MAX_LENGTH 64
MACRUM 0:119624335925 43 #define FSFAT_FILENAME_MAX_LENGTH 255
MACRUM 0:119624335925 44
MACRUM 0:119624335925 45
MACRUM 0:119624335925 46 /* support macro for make string for utest _MESSAGE macros, which dont support formatted output */
MACRUM 0:119624335925 47 #define FSFAT_TEST_UTEST_MESSAGE(_buf, _max_len, _fmt, ...) \
MACRUM 0:119624335925 48 do \
MACRUM 0:119624335925 49 { \
MACRUM 0:119624335925 50 snprintf((_buf), (_max_len), (_fmt), __VA_ARGS__); \
MACRUM 0:119624335925 51 }while(0);
MACRUM 0:119624335925 52
MACRUM 0:119624335925 53
MACRUM 0:119624335925 54 /*
MACRUM 0:119624335925 55 * Structures
MACRUM 0:119624335925 56 */
MACRUM 0:119624335925 57
MACRUM 0:119624335925 58 /* kv data for test */
MACRUM 0:119624335925 59 typedef struct fsfat_kv_data_t {
MACRUM 0:119624335925 60 const char* filename;
MACRUM 0:119624335925 61 const char* value;
MACRUM 0:119624335925 62 } fsfat_kv_data_t;
MACRUM 0:119624335925 63
MACRUM 0:119624335925 64
MACRUM 0:119624335925 65 extern const uint8_t fsfat_test_byte_data_table[FSFAT_TEST_BYTE_DATA_TABLE_SIZE];
MACRUM 0:119624335925 66
MACRUM 0:119624335925 67 int32_t fsfat_test_create(const char* filename, const char* data, size_t len);
MACRUM 0:119624335925 68 int32_t fsfat_test_delete(const char* key_name);
MACRUM 0:119624335925 69 int32_t fsfat_test_filename_gen(char* name, const size_t len);
MACRUM 0:119624335925 70 #ifdef __cplusplus
MACRUM 0:119624335925 71 }
MACRUM 0:119624335925 72 #endif
MACRUM 0:119624335925 73
MACRUM 0:119624335925 74 #endif /* __FSFAT_TEST_H */