Sending and reception of big data file (1kB example)

Dependencies:   modem_ref_helper CRC DebouncedInterrupt

Committer:
Jeej
Date:
Thu May 28 09:08:51 2020 +0000
Revision:
14:a0241090f967
Parent:
12:ae262faaa641
Updated for v5.3.283.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jeej 0:a2bbc478f812 1 #include "files.h"
Jeej 0:a2bbc478f812 2 #include "hwcfg.h"
Jeej 0:a2bbc478f812 3
Jeej 0:a2bbc478f812 4 #include "kal_fs.h"
Jeej 0:a2bbc478f812 5
Jeej 0:a2bbc478f812 6 #define __DEVICE_ID__ 0x00000018
Jeej 0:a2bbc478f812 7
Jeej 0:a2bbc478f812 8 alp_file_header_t h_rev = {
Jeej 9:26cd994b5303 9 .perm = RWR_R_,
Jeej 0:a2bbc478f812 10 .prop = FS_PERMANENT_NOTIF,
Jeej 0:a2bbc478f812 11 .afid = FID_ACTP_RPT_FULL,
Jeej 0:a2bbc478f812 12 .ifid = IFID_REPORT,
Jeej 0:a2bbc478f812 13 .size = HAL_U32_BYTE_SWAP((uint32_t)sizeof(revision_t)),
Jeej 0:a2bbc478f812 14 .alloc= HAL_U32_BYTE_SWAP((uint32_t)sizeof(revision_t))
Jeej 0:a2bbc478f812 15 };
Jeej 0:a2bbc478f812 16
Jeej 0:a2bbc478f812 17 revision_t f_rev = {
Jeej 0:a2bbc478f812 18 .manufacturer_id = __MANUFACTURER_ID__,
Jeej 0:a2bbc478f812 19 /// Device ID: Arbitrary number, at user/customer choice
Jeej 0:a2bbc478f812 20 .device_id = __DEVICE_ID__,
Jeej 0:a2bbc478f812 21 /// Hardware Board ID:
Jeej 0:a2bbc478f812 22 .hw_version = __HW_VERSION__,
Jeej 0:a2bbc478f812 23 /// Firmware Version: made of
Jeej 0:a2bbc478f812 24 /// - major,minor and patch indexes
Jeej 0:a2bbc478f812 25 /// - fw_id : "build-flavour"
Jeej 0:a2bbc478f812 26 /// FW_ID | MAJOR | MINOR | PATCH | HASH |
Jeej 0:a2bbc478f812 27 // 1B | 1B | 1B | 2B | 4B |
Jeej 0:a2bbc478f812 28 .fw_version.id = 0,
Jeej 0:a2bbc478f812 29 .fw_version.major = 1,
Jeej 0:a2bbc478f812 30 .fw_version.minor = 0,
Jeej 14:a0241090f967 31 .fw_version.patch = 5,
Jeej 14:a0241090f967 32 .fw_version.hash = 0x20200528,
Jeej 0:a2bbc478f812 33 /// Not used
Jeej 0:a2bbc478f812 34 .cup_max_size = 0x00000000
Jeej 0:a2bbc478f812 35 };
Jeej 0:a2bbc478f812 36
Jeej 1:76a8a3cc5f2e 37 alp_file_header_t h_output_file = {
Jeej 9:26cd994b5303 38 .perm = RWRWRW,
Jeej 1:76a8a3cc5f2e 39 .prop = FS_VOLATILE,
Jeej 1:76a8a3cc5f2e 40 .afid = 0,
Jeej 1:76a8a3cc5f2e 41 .ifid = 0,
Jeej 1:76a8a3cc5f2e 42 .size = HAL_U32_BYTE_SWAP((uint32_t)sizeof(output_file_t)),
Jeej 1:76a8a3cc5f2e 43 .alloc= HAL_U32_BYTE_SWAP((uint32_t)sizeof(output_file_t))
Jeej 1:76a8a3cc5f2e 44 };
Jeej 1:76a8a3cc5f2e 45
Jeej 1:76a8a3cc5f2e 46 output_file_t f_output_file = {
Jeej 1:76a8a3cc5f2e 47 .data = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id pulvinar est. Mauris pretium arcu at facilisis rutrum. Nulla facilisi. "
Jeej 1:76a8a3cc5f2e 48 "Quisque auctor, massa et gravida semper, libero dui varius est, quis ornare dolor odio a turpis. Suspendisse in turpis vel risus porta "
Jeej 1:76a8a3cc5f2e 49 "aliquet et a nibh. Mauris vehicula purus ut risus convallis, id luctus erat tincidunt. Aenean vitae gravida nisi. Nulla eleifend lorem "
Jeej 1:76a8a3cc5f2e 50 "purus, non sagittis neque accumsan molestie. "
Jeej 1:76a8a3cc5f2e 51 "Praesent interdum semper viverra. Cras ut sodales quam. Etiam vitae orci sit amet lorem semper commodo. Phasellus elementum nec dui eget "
Jeej 1:76a8a3cc5f2e 52 "pellentesque. Proin eget dignissim nibh. In iaculis imperdiet enim, consequat gravida mi varius sed. Suspendisse eu elementum justo. "
Jeej 1:76a8a3cc5f2e 53 "Donec non mauris odio. Sed aliquet vestibulum risus non ultricies. Integer mollis neque id magna gravida auctor. Cras at auctor velit. "
Jeej 1:76a8a3cc5f2e 54 "Vivamus tempor dui purus, id commodo arcu iaculis a. Curabitur hendrerit, nibh sit amet gravida porttitor, leo magna gravida ex, non "
Jeej 1:76a8a3cc5f2e 55 "porta ligula quam ac risus. Mauri",
Jeej 1:76a8a3cc5f2e 56 .crc = 0,
Jeej 1:76a8a3cc5f2e 57 };
Jeej 1:76a8a3cc5f2e 58
Jeej 0:a2bbc478f812 59 alp_file_header_t h_input_file = {
Jeej 9:26cd994b5303 60 .perm = RWRWRW,
Jeej 0:a2bbc478f812 61 .prop = FS_VOLATILE,
Jeej 0:a2bbc478f812 62 .afid = 0,
Jeej 0:a2bbc478f812 63 .ifid = 0,
Jeej 0:a2bbc478f812 64 .size = HAL_U32_BYTE_SWAP((uint32_t)sizeof(input_file_t)),
Jeej 0:a2bbc478f812 65 .alloc= HAL_U32_BYTE_SWAP((uint32_t)sizeof(input_file_t))
Jeej 0:a2bbc478f812 66 };
Jeej 0:a2bbc478f812 67
Jeej 0:a2bbc478f812 68 input_file_t f_input_file = {
Jeej 0:a2bbc478f812 69 .data = {0},
Jeej 0:a2bbc478f812 70 .crc = 0,
Jeej 0:a2bbc478f812 71 };