Fork of my MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:45:51 2017 +0000
Revision:
0:f1d3878b8dd9
Initial commit

Who changed what in which revision?

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